search
Homephp教程PHP开发linux yum command

linux yum command

Dec 13, 2016 am 10:53 AM

linux yum command

yum (Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora and RedHat and SUSE.

Based on RPM package management, it can automatically download and install RPM packages from designated servers. It can automatically handle dependencies and install all dependent software packages at once, without the need to download and install them again and again.

yum provides commands to find, install, and delete a certain, a group, or even all software packages, and the commands are concise and easy to remember.

yum syntax

yum [options] [command] [package...]

options: Optional, options include -h (help), -y (when prompted during the installation process, select all "yes"), -q (do not display the installation process) and so on.

command: The operation to be performed.

The object of package operation.

Common yum commands

1. List all updateable software command: yum check-update

2. Update all software command: yum update

3. Install only specified software command: yum install

4. Only update the specified software command: yum update

7. Search package command: yum search

8. Clear cache command:

yum clean packages: Clear the software packages in the cache directory

yum clean headers: Clear the headers in the cache directory

yum clean oldheaders: Clear the old headers in the cache directory

yum clean, yum clean all (= yum clean packages; yum clean oldheaders): Clear the software packages and old headers in the cache directory

Example 1

Install pam-devel

       [root@www ~]# yum install pam-devel
Setting up Install Process
Parsing package install arguments
Resolving Dependencies  <==先检查软件的属性相依问题
--> Running transaction check
---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be updated
--> Processing Dependency: pam = 0.99.6.2-4.el5 for package: pam-devel
--> Running transaction check
---> Package pam.i386 0:0.99.6.2-4.el5 set to be updated
filelists.xml.gz          100% |=========================| 1.6 MB    00:05
filelists.xml.gz          100% |=========================| 138 kB    00:00
-> Finished Dependency Resolution
……(省略)

Example 2

Remove pam-devel

[root@www ~]# yum remove pam-devel
Setting up Remove Process
Resolving Dependencies  <==同样的,先解决属性相依的问题
--> Running transaction check
---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
 pam-devel               i386       0.99.6.2-4.el5   installed         495 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       0 Package(s)
Remove       1 Package(s)  <==还好,并没有属性相依的问题,单纯移除一个软件

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing   : pam-devel                    ######################### [1/1]

Removed: pam-devel.i386 0:0.99.6.2-4.el5
Complete!

Example 3

Use the function of yum to find out what software names start with pam?

[root@www ~]# yum list pam*
Installed Packages
pam.i386                  0.99.6.2-3.27.el5      installed
pam_ccreds.i386           3-5                    installed
pam_krb5.i386             2.2.14-1               installed
pam_passwdqc.i386         1.0.2-1.2.2            installed
pam_pkcs11.i386           0.5.3-23               installed
pam_smb.i386              1.1.7-7.2.1            installed
Available Packages <==底下则是『可升级』的或『未安装』的
pam.i386                  0.99.6.2-4.el5         base
pam-devel.i386            0.99.6.2-4.el5         base
pam_krb5.i386             2.2.14-10              base

Domestic yum source

NetEase (163) yum source is one of the best yum sources in China, both in terms of speed and software version, it is very good.

Set the yum source to 163 yum, which can improve the speed of software package installation and update, and prevent some common software versions from being found.

Installation steps

First backup /etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS- Base.repo.backup

Download the corresponding version repo file and put it into /etc/yum.repos.d/ (please make the corresponding backup before operation)

CentOS5: http://mirrors.163.com/.help /CentOS5-Base-163.repo

CentOS6: http://mirrors.163.com/.help/CentOS6-Base-163.repo

Run the following command to generate cache

yum clean all

yum makecache


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools