Yum Software Package Manager

Source: Internet
Author: User
Tags delete key ftp site
A good helper for solving dependencies !!! Software Package Manager

Yum (all called Yellow Dog Updater, modified) is a shell front-end Package Manager in fedora, RedHat, and Suse. Based on RPM package management, You can automatically download and install the RPM package from the specified server, automatically handle dependencies, and install all dependent software packages at a time, you do not need to download and install it repeatedly.

Software Package Source

Software packages available for Yum download include the fedora software package and the fedora extras from rpmfusion and rpm.livna.org, which are all maintained by the Linux community and are basically free software. All packages have an independent GPG signature, mainly for your system security. For users of Fedora Core 4.0, The rpm.livna.org signature is automatically imported and installed.

Graphical front-end

Yum graphic front-ends mainly include yumex and Kyum. They are not independent of yum, but the yum graphics front-end. That is to say, they are both based on Yum installation and configuration while installing and using yumex and Kyum; therefore, you must install and configure Yum before using yumex or Kyum.

Common command line commands

Install software (take foo-x.x.x.rpm as an example): Yum install foo-x.x.x.rpm

Common Yum commands

Delete software: Yum remove foo-x.x.x.rpm or yum erase foo-x.x.x.rpm upgrade software: Yum upgrade Foo or yum update Foo Query Information: Yum info Foo search software (take the field containing Foo as an example ): for other parameters of Yum search Foo, see man yum

 

 

Yum command details
In general, the software installation commands for Redhat and Fedora are rpm,
The biggest trouble with installing a software is to manually find a series of dependencies required to install the software, if the software does not need to be uninstalled, it may cause other software to be detached due to a dependency.
Parts cannot be used. Happily, fedora finally launched the command Yum similar to APT in Ubuntu, making it easy to install the fedora software.
Yum has the following 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
Yum, short for Yellow Dog Updater modified, was initially developed by the developer Terra of the Yellow Dog release.
Soft R & D, written in Python, was also called Yup (Yellow Dog
Updater), which was later improved by the Linux @ Duke development team of Duke University. Yum is designed to automatically upgrade, install/remove RPM packages, and collect
Turn off the information, check the dependency, and automatically prompt the user to solve the problem. The key to Yum is to have a reliable repository. As the name suggests, this is the software repository, which can be an HTTP or FTP site,
It can also be a local software pool, but it must contain the RPM header,
The header includes various RPM package information, including descriptions, functions, provided files, dependencies, etc. It is the collection and analysis of these headers that can automatically complete the remaining tasks.
1. all configuration information of yum is stored in a file named Yum. in the conf configuration file, it is usually located in the/etc directory, which is the top priority of the entire Yum system. I checked this file in F7. Let's take a look:
[Hanlong @ wh_eric F7 common documentation] $ sudo more/etc/yum. conf
[Main]
Cachedir =/var/Cache/yum
Keepcache = 0
Debuglevel = 2
Logfile =/var/log/yum. Log
Exactarch = 1
Obsoletes = 1
Gpgcheck = 1
Plugins = 1
Metadata_expire = 1800
# Put your repos here or in separate files named file. Repo
# In/etc/yum. Repos. d
The following is a brief description of this document:
Cachedir: directory of the yum cache, where Yum stores the downloaded RPM package and database, generally/var/Cache/yum.
Debuglevel: debug level, 0-10. The default value is 2.
Logfile: the log file of yum. The default value is/var/log/yum. log.
Exactarch has two options: 1 and 0, indicating whether to upgrade only the same package as the CPU system of your installation package. If it is set to 1, if you have installed an i386 rpm, yum will not be upgraded with a 686 package.
Gpgchkeck = there are two options: 1 and 0, which respectively indicate whether or not to perform GPG verification. If this option is not selected, it is also checked by default.
2. Well, the next step is to use yum. First, use Yum to upgrade the software. Most Yum operations must have the permissions of Super Users. Of course, you can use sudo.
Yum
Update. This step is required. yum downloads the RPM header from the header directory of the server and stores it in the local cache. This may take some time,
It brings us convenience. What is the time spent? After the header is downloaded, yum determines whether an updatable software package exists. If yes, yum will ask you for your opinion and whether it is updated.
Y, keep the system up
Date is always good. At this time, yum starts to download the software package and uses the call rpm for installation. This may take some time, depending on the number of software to be updated and the network condition. In case the network is disconnected, it doesn't matter.
Once. After the upgrade, you only need to use Yum check-update every day to check whether there are any new ones. If yes, use yum
Update to keep the system up-to-date and block all discovered vulnerabilities. Use Yum update packagename to upgrade a single package.
Now we can simply list some commands for Yum software upgrade:
(Update: I used RPM to install wine one by one. I first installed the link and then installed the wine MAIN package. But I just found a good post on the forum, install Yum locally. The parameter is-localinstall.
$ Yum localinstall wine -*
In this way, yum will automatically install all dependencies without the need to install RPM one by one, saving a lot of work.
There is another parameter similar to this one:
$ Yum localupdate wine -*
If a new version of wine is available and you download it locally, you can update wine locally .)
1. List all software updates
Command: Yum check-Update
2. Install all Update Software
Command: Yum update
3. Only install the specified Software
Command: Yum install
4. Update only the specified Software
Command: Yum update
5. list all the software that can be installed
Command: Yum list
3. Use Yum to install and uninstall software. The premise is that the software packages installed by Yum are in RPM format.
The installation command is: Yum install XXX. Yum queries the database to check whether this software package exists. If yes, check its dependency conflict. If no dependency conflict exists, download and install it; if yes, you will receive a prompt asking if you want to install dependencies at the same time or delete conflicting packages. You can make your own judgment.
The DELETE command is yum remove XXX. Like the installation command, yum also queries the database and provides a prompt to solve the dependency.
1. install the software package with yum
Command: Yum install
2. Use Yum to delete a software package
Command: Yum remove
4. Use Yum to query the software you want to install
We often encounter such a situation, we want to install a software, only know it is related to a certain aspect, but cannot know its name. In this case, the yum query function takes effect. You can use yum
Search Keyword command to search. For example, if you want to install an instant messenger, but you do not know what it is, you may wish to use
Yum search
If you search for commands such as messenger, yum searches for all available RPM descriptions and lists all RPM packages related to messeger. Therefore, we may obtain
GAIM, kopete, and so on.
Sometimes we install a package without knowing its purpose. We can use the yum info packagename command to obtain information.
1. Use Yum to find the Software Package
Command: Yum search
2. List all installable software packages
Command: Yum list
3. list all updatable software packages
Command: Yum list updates
4. list all installed software packages
Command: Yum List Installed
5. list all software packages installed but not in Yum Repository
Command: Yum list extras
6. List the specified software packages
Command: Yum list
7. Use Yum to obtain the software package information
Command: Yum info
8. list information about all software packages
Command: Yum info
9. list information of all updatable software packages
Command: Yum info updates
10. list information about all installed software packages
Command: Yum info installed
11. list information about all software packages installed but not in Yum Repository
Command: Yum info extras
12. List the files provided by the Software Package
Command: Yum provides
5. Clear Yum Cache
Yum stores the downloaded software package and header in the cache, but does not automatically delete it. If we think they occupy disk space, we can use yum
Clean command to clear, more accurate usage is yum clean headers clear header, yum clean
Packages clears the downloaded RPM package, and Yum clean all clears all
1. Clear the software packages under the cache directory (/var/Cache/YUM)
Command: Yum clean packages
2. Clear headers under the cache directory (/var/Cache/YUM)
Command: Yum clean Headers
3. Clear the old headers under the cache directory (/var/Cache/YUM)
Command: Yum clean oldheaders
4. Clear the software packages and old headers in the cache directory (/var/Cache/YUM ).
Command: Yum clean, yum clean all (= Yum clean packages; YUM clean oldheaders)
You can use man to view all the preceding command parameters:
[Hanlong @ wh_eric F7 common documentation] $ man yum

From: http://han-long.cn/blog/archives/45
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
Install yumHaha, fedora comes with it!
# Rpm-IVH yum-2.0.4-2.noarch.rpm

Iv. Yum Configuration
Note: you can modify and add the resource library in the configuration file to accelerate the download speed and have more updatable RPM packages.
Replace all content in/etc/yum. conf
[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 of 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

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.