Linux Learning article---CentOS yum command detailed

Source: Internet
Author: User
Tags delete key ftp site gpg

Yum has the following characteristics:
* Multiple repositories can be configured at the same time (Repository)
* Concise configuration file (/etc/yum.conf)
* Automatic resolution of dependency issues encountered when adding or removing RPM packages
* Easy to use
* Maintain consistency with RPM database

Yum, the abbreviation for Yellow Dog Updater modified, was originally developed by the developer of Yellow Dog's release, Terra Soft, written in Python, then called yup (Yellow dog Updater), This was followed by an improvement by the [email protected] development team at Duke University. Yum's mission is to automate upgrades, install/remove RPM packages, collect information about RPM packages, check dependencies and automatically prompt users to resolve them. Yum's key is to have a reliable repository, as the name implies, this is the repository of software, it can be an HTTP or FTP site, can also be a local software pool, but must contain the RPM header, header includes the RPM package of various information, including description, function, Provide files, dependencies, etc. it is by collecting these headers and analyzing them that the remaining tasks can be completed automatically.


All configuration information for 1.yum is stored in a configuration file called yum.conf, usually located in the/etc directory, which is a priority for the entire Yum system:

Simple parsing of the Yum configuration file:

Cachedir:yum cache directory, yum stores downloaded RPM packages and databases, typically/var/cache/yum.
DebugLevel: Debug level, 0──10, default is 2
The Logfile:yum log file, which is/var/log/yum.log by default.
Exactarch, there are two options 1 and 0, which represents whether to upgrade only the packages that are consistent with your installation of the package CPU, and if set to 1, if you install a i386 rpm, Yum will not upgrade with a 686 package.
The gpgchkeck= has 1 and 2 choices, which represent whether or not GPG verification is performed, and if not, the default seems to be checked.

2. Common commands:

    1. List all updatable software inventory commands: Yum check-update 2. Install all Update software (update all RPM packages that can be upgraded, including kernel) command: Yum Update 3. Install only the specified software commands: Yum I Nstall 4. Update only the specified software commands: Yum update PackageName 5. Find package Commands: Yum search 6. List all packages that can be installed command: Yum list 7. List all updatable Package commands: Yum list updates 8. Lists all installed package commands: Yum List installed 9. List all installed packages that are not in Yum Repository command: Yum Lis T Extras 10. Lists the specified package commands: Yum list packagename 11. Lists the specified package information command: Yum info packagename 12. List all package information commands: Yum in  Fo 13. List all updatable package information commands: Yum info updates 14. Lists all installed package information commands: Yum info installed 15. List all devices installed but not in Yum Repository Package Information command: Yum info Extras 16. Lists which file commands are provided by the package: Yum provides packagename 17. Remove Package Command: Yum Remove 18. Clear the Cache directory ( /var/cache/yum) under the package command: Yum Clean packages 19. Clear the headers command under the cache directory (/var/cache/yum): Yum Clean headers 20. Clear the Cache directory ( /var/cache/yum) under the old headers command: Yum clean oldheaders 21. Clear the package under the cache directory (/var/cache/yum) and the old headers command: Yum-clean, yum CLE An any (= Yum Clean packAges Yum clean oldheaders) 22. A large-scale version upgrade, unlike Yum Update, even the old obsolete package also upgrades the command: Yum upgrade
Regular system updates are performed daily #chkconfig yum On#service Yum start


3.yum Command additions:

1. About the Yum Update command:

Yum Update,yum downloads the RPM header from the server's header directory and places it in the local cache, which may take some time. After the header has been downloaded, yum will determine if there is an updatable package, and if so, it will ask for your comments and whether it is updated. After agreeing to the update, Yum begins to download the package and calls the RPM installation, which may take some time, depending on the number of software to be updated and the network condition, in case the network is broken, it doesn't matter, it will be done again.

Yum update PackageName an upgrade of a separate package.

2. About Yum install and delete commands:

Install the command is, yum install Xxx,yum will query the database, there is no such package, if any, then check its dependency conflict, if there is no conflict-dependent, then it is best to download the installation, if there is, will be prompted to ask whether you want to install dependencies at the same time, or delete conflicting packages, You can make your own judgments.
Delete the command is, yum remove xxx, as with the installation, Yum will also query the database, giving a hint to resolve the dependency.

3. About the Yum Query command:

We often encounter this situation, want to install a software, only know that it is related to a certain aspect, but do not know exactly its name. This is when Yum's query function works. You can use the Yum search keyword command to search, such as we want to install a instant Messenger, but do not know exactly what, it may be possible to use the Yum search Messenger, such as the search for a command, Yum searches all available rpm descriptions, lists all the RPM packages that are described in the Messeger, so we may get gaim,kopete and so on and choose from them.

Sometimes we have a package installed, but we do not know its purpose, we can use Yum Info packagename This command to get information.

4. About the Yum Cache command:

Yum stores the downloaded packages and headers in the cache without deleting them automatically. If we feel that they are taking up disk space, you can use the Yum Clean command to clear them, and more precisely use Yum clean headers to clear Header,yum clean packages clear the downloaded RPM package, yum clean all clears all.

4.yum configuration:

Note: Modify and add the repository in the configuration file, speed up the download speed and have more updatable RPM packages Replace all/etc/yum.conf contents with [main]cachedir=/var/cache/yumdebuglevel=2logfile=/ Var/log/yum.logpkgpolicy=newestdistroverpkg=fedora-releasetolerant=1exactarch=1[fedora-us-1]name=fedora Core 1-- Fedora US mirrorbaseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/os[fedora-us-1-updates]name= Fedora Core 1 Updates-Fedora US mirrorbaseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/updates[ Fedora-us-1-stable]name=fedora Linux (Stable) for Fedora Core 1--Fedora US mirrorbaseurl=ftp://mirrors.kernel.org/ Fedora.us/fedora/fedora/1/i386/yum/stable[freshrpms]name=fedora Linux $releasever-$basearch-freshrpmsbaseurl= http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

5. Secure Update freshrpms.net RPM package

Installing the Freshrpms.net GPG key

RPM--importhttp://freshrpms.net/packages/rpm-gpg-key.txt

Edit/etc/yum.conf, add the following information to the trailer
[Freshrpms]
Name=fedora Linux $releasever-$basearch-freshrpms
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
Gpgcheck=1


Note:
Check GPG Key
# Rpm-qa gpg-pubkey*

Display key Information
#rpm-qi GPG-PUBKEY-E42D547B-3960BDF1

Delete key
#rpm-E Gpg-pubkey-e42d547b-3960bdf1



Linux Learning article---CentOS yum command detailed

Related Article

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.