Detailed description of Yum commands in Linux

Source: Internet
Author: User
Tags gpg

  What does Yum do?

With RedHat, linuxer of Fedora must have a headache for RPM's famous dependency hell (which is also a problem for all rpm-based releases ). Foo is needed by bar, bar is needed by foo. To load and unload a piece of software, we have to work hard to find out all the dependency problems. Several RPM search sites have become frequent places to patronize. If we encounter circular dependency, we will only have a dry eye. Sometimes you can add a -- nodeps parameter, but you may not see it. But can you ensure normal use of the software installed in this way? Can you uninstall the software without affecting the work of other software, i'm afraid no one can give a definite answer. At this moment, the hats only look at the apt of Debian, secretly envy. Fortunately, these are all past tense. The rpm-based release now also has a package management tool that automatically resolves dependencies like apt. One of the famous ones is apt 4rpm, which is basically the transplantation of Debian system apt in the RPM release version. But do you know the linuxer using RedHat and fedora? There is also an RPM package management system similar to APT, that is, yum. The fedora system has its own, and the Redhat has the corresponding RPM download. Compared with APT, yum features are not weak at all, and there are even many advantages over apt. For example, yum comes with the fedora system, so it can use the official fedora software source to complete various official releases> various upgrades. Yum is not bad for third-party software sources. Most repository notes that support APT also support yum, such as freshrpms, fedora. Us, and livna. In addition, yum has a detailed log to check when to upgrade and install software packages. The yum code is more streamlined than apt.

  I. What is yum?

Yum = yellow dog Updater. Modified is mainly used to conveniently add, delete, and update RPM packages. It automatically solves the dependency problem of packages.

It facilitates management of a large number of system update Problems

Note: The simplest reason for using Yum instead of APT is that ora comes

 Ii. Yum features

* Multiple resource libraries (repository) can be configured simultaneously)

* Simple configuration file (/etc/yum. conf)

* Automatically solves the dependency problem when RPM packages are added or deleted.

* Easy to use

* Maintain consistency with the RPM Database

  Iii. Install yum

Built-in ora

# Rpm-IVH yum-2.0.4-2.noarch.rpm

  Iv. Yum Configuration

Note: Modify and add the resource library in the configuration file to accelerate the download speed and have more updatable RPM packages to replace all/etc/yum. conf content

[Main]

Cachedir =/var/Cache/yum

Debuglevel = 2

Logfile =/var/log/yum. Log

Pkgpolicy = newest

Distroverpkg = fedora-release

Tolerant = 1

Exactarch = 1

[Fedora-us-1]

Name = Fedora Core 1 -- fedora us mirror

Base url = ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/ OS

[Fedora-us-1-updates]

Name = Fedora Core 1 updates -- fedora us mirror

Base url = 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 mirror

Base url = ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/stable

[Freshrpms]

Name = Fedora Linux $ releasever-$ basearch-freshrpms

Baseurl = http://ayo.freshrpms.net/fedora/linux/?releasever/?basearch/freshrpms

  V. Yum Application

Note: When the yum or yum resource library is updated for the first time, yum will automatically download all the required headers and place them in the/var/Cache/Yum Directory, which may take a long time.

Check which update RPM packages are available

# Yum check-Update

Install the RPM package so that xmms can play MP3

# Yum install xmms-mp3

Install mplayer and install related software automatically

# Yum install mplayer

Delete the licq package and delete the packages that are dependent on the package.

# Yum remove licq

Note: You will also be prompted to delete licq-gnome, licq-QT, and licq-text, which is very convenient.

System update (update all RPM packages that can be upgraded, including kernel)

# Yum-y update

Perform system updates on a regular basis every day

# Chkconfig Yum on

# Service Yum start

6. Yum instructions

* Update the RPM package

Check the updatable RPM package

# Yum check-Update

Update all RPM packages

# Yum update

Update the specified RPM package, such as updating the kernel and kernel source

# Yum update kernel-Source

For large-scale version upgrades, unlike Yum update, the old obsolete package is also upgraded.

# Yum upgrade

* Installation and deletion of RPM packages

Install RPM packages like xmms-mp3

# Yum install xmms-mp3

Delete an RPM package, including packages that depend on the package

# Yum remove licq

Note: You will also be prompted to delete licq-gnome, licq-QT, and licq-text.

* Parameters related to Yum temporary storage (/var/Cache/Yum /)

Clear temporary RPM package files

# Yum clean packages

Clear temporary RPM header files

# Yum clean Headers

Clear the existing RPM header file

# Yum clean oldheaders

Clear existing RPM header files and package files

# Yum clean or # Yum clean all

Note: equivalent to Yum clean packages + Yum clean oldheaders

* RPM package list

List all RPM packages that can be installed or updated in the resource library

# Yum list

List specific rpm packages that can be installed, updated, and installed in the resource library

# Yum list Mozilla

# Yum list Mozilla *

Note: Match characters can be used in RPM package names, for example, to list all RPM packages starting with Mozilla

List all updates to the RPM package in the resource library

# Yum list updates

List all installed RPM packages

# Yum List Installed

List RPM packages installed but not included in the resource library

# Yum list extras

Note: download and install the RPM package from other websites

* RPM package information display (the info parameter is the same as the list)

Lists information about all RPM packages that can be installed or updated in the resource library.

# Yum info

Lists the specific information of RPM packages that can be installed or updated and installed in the resource library.

# Yum info Mozilla

# Yum info Mozilla *

Note: Match characters can be used in RPM package names, such as listing all RPM packages starting with Mozilla

Lists information about all the RPM packages that can be updated in the resource library.

# Yum info updates

Lists information about all installed RPM packages.

# Yum info installed

Lists the installed RPM packages that are not included in the resource library.

# Yum info extras

Note: Download the installed RPM package information from other websites.

* Search for an RPM package

Search for RPM packages matching specific characters

# Yum search Mozilla

Note: Search for RPM package names and package descriptions

Search for RPM packages with specific file names

# Yum provides realplay

7. Securely update the RPM package of freshrpms.net

Install the GPG key for freshrpms.net # rpm -- import http://freshrpms.net/packages/RPM-GPG-KEY.txt

Edit/etc/yum. conf and add the following information to the end.

[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 *

Show key information

# Rpm-Qi gpg-pubkey-e42d547b-3960bdf1

Delete key

# Rpm e gpg-pubkey-e42d547b-3960bdf1

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.