Yum Command detailed

Source: Internet
Author: User
Tags delete key gpg

Yum Command detailed

As is known to all, Redhat and Fedora's software installation commands are RPM, but the biggest trouble with using RPM to install the software is the need to manually find the series of dependencies needed to install the software, which is super hassle. If the software does not need to uninstall it is very annoying to unload a dependency and cause other software to not be used. Happily, Fedora has finally rolled out an apt command yum similar to Ubuntu, making Fedora's software installation easy.
Yum has a feature:
* Multiple resource pools can be configured at the same time (Repository)
* Concise configuration file (/etc/yum.conf)
* Automatically resolve the dependency problems encountered when adding or removing RPM packages
* Easy to use
* Maintain consistency with the RPM database

yum.conf File instance:

[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
Baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/os

[fedora-us-1-updates]
Name=fedora Core 1 Updates--Fedora US Mirror
baseurl=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
BaseURL =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

1. Use Yum to find packages
Command: Yum Search
2. List all installable packages
Command: Yum list
3. List all updatable packages
Command: Yum list updates
4. List all installed packages
Command: Yum List installed
5. List all packages that are installed but not in Yum Repository
Command: Yum list extras
6. List the packages that you specify
Command: Yum list

7. Use Yum to get package information
Command: Yum Info

8. List information for all packages
Command: Yum Info
9. List all updatable package information
Command: Yum info updates
10. List all installed package information
Command: Yum info installed
11. List all package information that has been installed but not in Yum Repository
Command: Yum info extras
12. List which files the package provides
Command: Yum provides

5. Clear Yum Cache

Yum will store the downloaded packages and headers in the cache and not automatically delete them. If we feel that they are taking up disk space, you can use the Yum Clean command for cleanup, more precise usage is yum clean headers clear Header,yum Clean Packages erase downloaded RPM package, yum clean all clears all

1. Clear the package under the cache directory (/var/cache/yum)

Command: Yum Clean packages

2. Clear the Cache directory (/var/cache/yum) under the headers

Command: Yum Clean headers

3. Clear Cache Directory (/var/cache/yum) under the old headers

Command: Yum clean oldheaders

4. Clear the Cache directory (/var/cache/yum) under the package and the old headers

Command: Yum clean, yum clean all (= Yum clean packages; yum clean oldheaders)

The use of all of the above command parameters can be viewed in man:

* Yum plugin * Presto plug-in Presto plugin provides Fedora users with faster download speeds and minimizes download files: It downloads only the difference files after the RPM package upgrade instead of the entire RPM package. The Presto plugin is included in Fedora 11 in ofedora_firefoxicially (Fedora official and has Firefox support.) ), I recommend the use of. Note that if you install an N version of the RPM package and you do not have the N+1 version installed, the Presto plugin will not be able to upgrade directly to the n+2 version. In this case, you must download the n+2 version of RPM. But it's not a big deal, Yum will take care of everything. Install the Presto plug-in, please open the terminal, enter:

Yum Install Yum-presto

* Fastest Mirroring plugin As the plugin name says, this plugin can search for the fastest mirror server in your mirrored list and download packages from it. To install, please enter:

Yum Install Yum-fastestmirror

Now, use it like you normally use Yum. You can configure the various settings for this plugin in the following file:

Gedit/etc/yum/pluginconf.d/fastestmirror.conf
* Security plugin This plugin only allows you to search and install only security-related upgrades, and it is useful if you install Fedora in the server's productivity model. To install, please enter:

Yum Install yum-security

To apply security Plug-ins, enter:

Yum--security Update

To learn more or to report additional options or advisory information to Bugzilla, please read the manual:

Mans yum-security
* Allow degraded plug-ins Yum The default is not to allow you to downgrade a package, but sometimes the new version of the problem for you. In this case you can use this plugin to downgrade the software to the previous stable version. To install, please enter:

Yum Install Yum-allowdowngrade

To use it, enter:

Yum Update--allow-downgrade

You can disable the plugin by changing the options that are enabled in the following file:

Gedit/etc/yum/pluginconf.d/allowdowngrade.conf

Five. Yum Application
Note: When an update is used for the first time using the Yum or Yum Repository, Yum automatically downloads all required headers placed in the/var/cache/yum directory, which may take a long time.

Check for updatable RPM packages
#yum check-update

Install the RPM package so that Xmms can play mp3
#yum Install Xmms-mp3

Install MPlayer and automatically install related software
#yum Install MPlayer

Delete the Licq package and delete the package that is dependent on the package
#yum Remove Licq
Note: At the same time will be prompted to delete licq-gnome,licq-qt,licq-text, very convenient

System Update (update all RPM packages that can be upgraded, including kernel)
#yum-y Update

Perform periodic system updates on a daily basis
#chkconfig Yum on
#service Yum Start

Seven. Secure update of Freshrpms.net RPM package
Install the Freshrpms.net GPG key
#rpm--import Http://freshrpms.net/packages/RPM-GPG-KEY.txt

Edit/etc/yum.conf, add the following information to the tail
[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



= = Set Unofficial Update Source = = =

The following is an example of installing the Rpmforge package to add an unofficial update source.

-Find packages that apply to Rhel5/centos5 to http://dag.wieers.com/rpm/packages/rpmforge-release/
-Download Packages for RHEL5/CENTOS5
<code>
# wget Http://dag.wieers.com/rpm/packag ... 6-1.el5.rf.i386.rpm
# RPM-IVH rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-rpmforge-*
</code>

You can see/etc/yum.repos.d/rpmforge.repo files after you install the Rpmforge-release package. Use Yum later to use this update

The source.
You can also add DAG warehouses by using the manual method below.

Establish Dag.repo, define unofficial libraries:

# Vi/etc/yum.repos.d/dag.repo

<code>
[Dag]
Name=dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
Gpgcheck=1
Enabled=1
Gpgkey=http://dag.wieers.com/packages/rpm-gpg-key.dag.txt
</code>
</note>

= = = Use Yum Extension Yum-fastestmirror = = = = =

When a warehouse configuration file (*.repo) uses mirrorlist or specifies multiple URLs in BaseURL, Yum-fastestmirror can automatically select the fastest mirror

Site. To speed up the download using Yum-fastestmirror, install it using the following command.


# yum-y Install Yum-fastestmirror


The Yum-fastestmirror configuration file is/etc/yum/pluginconf.d/fastestmirror.conf and is not normally modified.

FTP Sites in some colleges and universities in China

North Skynet
http://bingle.pku.edu.cn

Tsinghua university
ftp://www.lib.tsinghua.edu.cn/
ftp://ftp.net.edu.cn/

Peking university
http://bingle.pku.edu.cn
ftp://www.lib.pku.edu.cn/
ftp://ftp.pku.edu.cn/
Beijing Posts and Telecommunications
ftp://ftp.bupt.edu.cn/
ftp://ftp.buptnet.edu.cn/

Huazhong University of Technology
ftp://ftp.whnet.edu.cn/

Sichuan Electronic Technology Big
http://www2.cs.uestc.edu.cn/

Jinan University
ftp://202.116.9.61/
ftp://202.116.9.59/

Dalian University
ftp://ftp.dlut.edu.cn/

Shanghai jiaotong university
ftp://ftp.shnet.edu.cn/
ftp://mssite.sjtu.edu.cn/

Tongji University
ftp://ftp.tongji.edu.cn/

Nanjing University
ftp://ftp.nju.edu.cn/

Nanjing Institute of Posts and Telecommunications
ftp://ftp.njupt.edu.cn/

Nust
ftp://ftp.njnet.edu.cn/

Zhejiang University
ftp://ftp.zju.edu.cn/

China University of Science and Technology
ftp://ftp.ustc.edu.cn/

Da Xiamen University
ftp://ftp.xmu.edu.cn/

Shandong University
ftp://ftp.sdu.edu.cn/

Harbin Institute of Technology
ftp://ftp.hit.edu.cn/

Harbin University of Architecture
ftp://hrbucea.edu.cn/

Wuhan University of Surveying and mapping
ftp://ftp.wtusm.edu.cn/

Wuhan University of Water Conservancy and electric power
ftp://ftp.wuhee.edu.cn/

Zhongnan University of Finance and economics
ftp://ftp.znufe.edu.cn/

Zhongnan University of Technology
ftp://ftp.csut.edu.cn/

Changsha Railway Institute
ftp://ftp.csru.edu.cn/

University of National Defense Science and Technology
ftp://ftp.nudt.edu.cn/

Scut
ftp://ftp.scut.edu.cn/
ftp://ftp.gznet.edu.cn/

Shenzhen University
ftp://ftp.szu.edu.cn/

Zhongshan University
ftp://ftp.zsu.edu.cn/

Xian Jiaotong University
ftp://ftp.xjtu.edu.cn/
ftp://ftp.xanet.edu.cn/
ftp://ftp.pevirc.xjtu.edu.cn/

The Chinese University of Hong Kong
ftp://ftp.cuhk.hk/ 
ftp://ftp.cuhk.edu.hk/ 
ftp:// ftp.arts.cuhk.edu.hk/ 
ftp://ftp.erg.cuhk.edu.hk/ 
ftp://ftp.cs.cuhk.edu.hk/ 
ftp:// ftp.math.cuhk.edu.hk/ 

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.