Linux Yum command

Source: Internet
Author: User

Linux Yum command

Yum (Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and Redhat as well as in SuSE.

Based on RPM package management, the ability to automatically download the RPM package from the specified server and install, can automatically handle dependency relationships, and install all dependent software packages at once, without the tedious download and installation.

Yum provides commands to find, install, and delete one, a group, or even all of the packages, and the commands are concise and well-remembered.

Yum syntax
[Options][command][package...]       
    • Options : optional, option includes-H (Help),-y (when the installation process prompts you to select all "Yes"),-Q (does not show the installation process), and so on.
    • command: the operation to be performed.
    • The object for the package operation.
Yum Common commands
    • 1. List all updatable software inventory commands: Yum check-update
    • 2. Update all software commands: Yum update
    • 3. Install only the specified software commands: Yum install <package_name>
    • 4. Update only the specified software commands: Yum update <package_name>
    • 5. List all installed software inventory commands: Yum list
    • 6. Remove Package Command: Yum remove <package_name>
    • 7. Find package Commands: Yum search <keyword>
    • 8. Clear the Cache command:
      • Yum Clean Packages: Clear the cache directory for packages
      • Yum Clean headers: Clear headers in cache directory
      • Yum Clean oldheaders: Clears the old headers from the cache directory
      • Yum Clean, yum clear all (= Yum packages; yum oldheaders): Clears the cache directory of the package and the old headers
Example 1

Installing Pam-devel

[[Email protected]~]#Yum Install Pam-DevelSettingUpInstall ProcessParsing PackageInstall argumentsResolving Dependencies <== checking the property dependencies of software first- RunningTransaction check---> PackagePam-Devel.I3860:0.99.6.2-4.el5 SetTo be updated- Processing Dependency:Pam= 0.99.6.2-4.el5 For Package:Pam-Devel- RunningTransaction check---> PackagePam.I3860:0.99.6.2-4.el5 SetTo be updatedfilelists.Xml.Gz100% |=========================|1.6 MB 00:05 filelists.. GZ 100% |=========================| 138 KB 00: 00-> finished dependency resolution ... (omitted)                  
Example 2

Remove Pam-devel

[[Email protected]~]#Yum Remove Pam-DevelSettingUpRemove ProcessResolving Dependencies <== the same, first solve the problem of attribute dependencies- RunningTransaction check---> PackagePam-Devel.I3860:0.99.6.2-4.el5 SetTo be erased- Finished Dependency ResolutionDependencies Resolved============================================================================= Package Arch Version Repository Size=============================================================================removing:Pam-Devel i3860.99.6.2-4.el5Installed495KTransaction Summary=============================================================================Install 0 Package(S)Update 0 Package(S)Remove 1 Package(S) <== Fortunately, and there is no attribute dependency problem, simply remove a softwareIs ThisOk[Y/N]:YDownloading Packages:RunningRpm_check_debugRunning Transaction TestFinished Transaction TestTransaction test succeededrunning transaction erasing< Span class= "PLN" > : Pam-devel ######################### [1/1]removed:  Pam-devel.0:0.99. 6.2-4.el5complete!    
Example 3

Using Yum's capabilities, find out what software names start with Pam.

[[Email protected]~]#Yum List Pam*Installed PackagesPam.I3860.99.6.2-3.27.El5 installedpam_ccreds.I3863-5Installedpam_krb5.I3862.2.14-1Installedpam_passwdqc.I3861.0.2-1.2.2Installedpam_pkcs11.I3860.5.3-23Installedpam_smb.I3861.1.7-7.2.1InstalledAvailable packages <== underneath is "upgradeable" or "not Installed" pam< Span class= "pun". i386 0.99. 6.2-4.el5 basepam< Span class= "pun" >-devel.0.99. 6.2-4.el5 basePAM_ Krb5. i386 2.2. 14-10 base      
Domestic Yum Source

NetEase (163) Yum Source is one of the best yum sources in the country, both speed and software version, are very good.

Setting the Yum source to 163 Yum can increase the speed of package installation and update, while avoiding the inability of some common software versions to be found.

Installation steps

Backup/etc/yum.repos.d/centos-base.repo First

/etc/yum.  Repos.  D/CentOS-Base.  /etc/yum.  Repos.  D/CentOS-Base.  Repo.  Backup                  

Download the corresponding version of the repo file, put in the/etc/yum.repos.d/(please do the appropriate backup before the 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 the cache

Yum Clean Allyum Makecache

Besides NetEase, there are other good sources of Yum in China, such as Zhong Ke and Sohu.

Zhong ke yum Source, installation method view: Https://lug.ustc.edu.cn/wiki/mirrors/help/centos

Sohu Yum Source Installation method view: http://mirrors.sohu.com/help/centos.html

Source: http://www.runoob.com/linux/linux-yum.html

Linux Yum command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.