Advanced management applications for Yum and rpm

Source: Internet
Author: User

First, the use of Yum installation and uninstall software, there is a prerequisite for Yum installed packages are RPM format.

The installed command is that Yuminstall ~,yum will query the database, whether there is a package, and if so, check its dependency conflict, if there is no dependency conflict, then it is best to download the installation; If so, you will be prompted to ask if you want to install dependencies at the same time, or delete conflicting packages. You can make your own judgments;

The delete command is, yum Remove ~, as with the installation, Yum will also query the database , give a solution to the dependencies of the hint.

Which ~ represents the software name
1. Install package with yum command: Yuminstall ~

2. Delete package with yum command: Yumremove ~



Second, use Yum query to install the software

We often encounter such a situation, want to install a software, only know that it is related to a certain aspect, but do not know exactly its name. At this point the Yum query function is working. We can use the Yum search keyword such a command to conduct searches, such as we want to install a instant messenger, but do not know exactly what, then it may be possible to use the Yum search Messenger such instructions for searching, Yum will search all available rpm descriptions, listing all the RPM packages described in Messeger, so we might get gaim,kopete and so on and choose from them.
Sometimes we also encounter the installation of a package, but do not know its purpose, we can use Yuminfo packagename this instruction to obtain information.

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 Yumrepository

Command: Yum list extras

6. List the specified packages

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 Yumrepository

Command: Yum info extras

12. List which files the package provides
Command: Yum provides~


Third, clear the 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 yumclean instruction to purge them, and the more precise use is Yum clean headers clear Header,yumclean packages to clear the downloaded RPM package, yum clean all to clear 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)


Four, yum command tool use Example

Yum Update upgrade System

Yum Install ~ Install the specified package

Yum Update ~ Upgrade specified package

Yum Remove ~ Uninstall the specified software

Yum grouplist View the software groups that are already installed and available on the system that can be installed

Yum Grooupinstall ~ Install one of the available software groups shown in the previous command

Yum grooupupdate ~ Update packages for the specified software group

Yum grooupremove ~ Uninstall packages in the specified software group

Yum deplist ~ query for specified package dependencies

Yum list yum\* lists all packages that start with Yum

Yum localinstall ~ Install RPM packages from hard drives and use Yum to resolve dependencies


V. Yum advanced Management and application skills

Tip 1: Speed up your yum. Use Yum extension yum-fastestmirror, personally think this plugin is very effective, the speed is really significantly improved,

#yum-y Installyum-fastestmirror
Note: On CentOS 4, the name is Yum-plugin-fastestmirror.


Tip 2: Expand your RPM pack a lot of packages the official did not, how to handle him. Want me to compile it myself? OK, you install this bag, this is Redhat5 oh. You can find it by yourself in Http://dag.wieers.com/rpm/FAQ.php#B.

# Red Hat Enterprise Linux 5/i386:

rpm-uhvhttp://apt.sw.be/redhat/el5/en/i386/rpmforge/rpms/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

# Red Hat Enterprise Linux 5/x86_64:
rpm-uhvhttp://apt.sw.be/redhat/el5/en/x86_64/rpmforge/rpms//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

#ATrpms
[Atrpms]
Name= centos-$releasever –atrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
Gpgcheck=1
Gpgkey=http://atrpms.net/rpm-gpg-key.atrpms


Tips 3:rpm Find. Still have the rpm bag can't find how to do, to below this website. Basically all are collected, you can use the advanced search to see. http://rpm.pbone.net/


Tip 4: Download the RPM source package through the Yum tool. The prerequisite is the installation of Yum-utils this package. If there is a installation.

#yum Downloader--source; RPM Source Pack

#yum Downloader--sourcevsftpd

Of course, there is no source package, but also to join a source

[LINUX-SRC]

name=centos$releasever-$basearch-source

baseurl=http://mirrors.163.com/centos/$releasever/os/srpms/

Enabled=1

Gpgcheck=1

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release


Tip 5: Software Group installation Sometimes we install the system and manage a class of software that is not installed, such as a development package for development, which we can install with a package.

#yum grouplist So you can list all the packages

For example, we're going to install development related packages

#yum Groupinstall "Development Libraries"

#yum groupinstall "Development Tools"


For example, we want to install Chinese support
#yum groupinstall "Chinese Support"

#yum deplist Package1 #查看程序package1依赖情况


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


[Root@f7 Common documents] $man Yum

Yum-y Install package name (Support *): automatic selection of y, automatic
Yum Install package name (support *): Manually select Y or n
Yum Remove Package name (* not supported)
RPM-IVH Package Name (support *): Install RPM Package
RPM-E Package name (not supported *): Uninstall RPM Package

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.