Frequently Used commands for installing and detaching software using yum

Source: Internet
Author: User

1. 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 ~, Yum queries the database to see if this software package exists. If yes, it checks its dependency conflicts. If no dependency conflict exists, download and install it. If yes, a prompt is displayed, you can determine whether to install dependencies or delete conflicting packages at the same time;
The DELETE command is: yum remove ~, Like the installation, yum also queries the database and provides a prompt to solve the dependency.

Where ~ Representative Software name

1. Run YUM install ~ to install the software package ~

2. Run the YUM remove ~ command to delete the software package with yum ~

2. 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. We can use commands such as yum search keyword for search. For example, if we want to install an Instant Messenger, but we don't know what it is, we may use commands such as yum search messenger for search, yum searches for all available rpm descriptions and lists all rpm packages related to messeger. Therefore, we may get gaim, kopete, and so on, and select from them.
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 ~

3. 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 the yum clean command to clear them. More accurately, we use yum clean headers to clear the header and yum clean packages to clear the downloaded rpm package, yum clean all clear 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)

4. yum command tool example

Yum update system upgrade

Yum install ~ Install the specified Software Package

Yum update ~ Upgrade a specified Software Package

Yum remove ~ Uninstall specified Software

Yum grouplist: View installed and available software groups in the system. Available Software groups can be installed.

Yum grooupinstall ~ Install one of the available software groups displayed in the previous command

Yum grooupupdate ~ Update a software package for a specified Software Group

Yum grooupremove ~ Detach a software package from a specified Software Group

Yum deplist ~ Queries the dependencies of a specified software package.

Yum list yum \ * list all software packages starting with yum

Yum localinstall ~ Install the rpm package from the hard disk and use yum to solve the dependency

5. yum advanced management application skills

Tip 1: speed up your yum. Use the yum extension plug-in yum-fastestmirror. I personally think this plug-in is very effective and the speed is actually significantly improved,

# Yum-y install yum-fastestmirror

Note: On Centos 4, the name is yum-plugin-fastestmirror.

Tip 2: Expand your rpm package so many packages are not officially available. How can I fix it? Should I compile it myself? Okay. You have installed this package. This is from redhat5. You can come to http://dag.wieers.com/rpm/FAQ.php# B on your own.

# 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

Tip 3: Find the rpm. What should I do if the rpm package cannot be found? Go to the following website. Basically all collected, you can use advanced look to see. http://rpm.pbone.net/

Tip 4: Use the yum tool to download the RPM source code package. The premise is that you have installed the yum-utils package.

# Yum downloader -- source; RPM source code package

# Yum downloader -- source vsftpd

Of course, if there is no source package, you need to add 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 have installed the system and managed that a type of software is not installed. For example, for Development kits, we can install them using software packages.

# Yum grouplist to list all software packages

For example, we want 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 # view package1 Dependencies


You can use man to view all the preceding command parameters:

[Root @ F7 common documentation] $ man yum

 


Yum-y install package name (* supported): automatically selects y, fully automated
Yum install package name (* supported): manually select y or n
Yum remove package name (not supported *)
Rpm-ivh package name (supported *): Install the rpm package
Rpm-e package name (not supported *): uninstall the rpm package


Upgrade the kernel: # yum install kernel-headers kernel-devel

Author: "Xiao Fei's blog"
 

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.