[Centos] common Yum commands

Source: Internet
Author: User

Ref: http://www.linuxsky.org/doc/newbie/200801/230.html

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 <package_name>

4. Update only the specified Software
Command: Yum update <package_name>

5. list all the software that can be installed
Command: Yum list

Use Yum to install and delete Software
It is common to install the system to add and delete software. Yum is also competent for this task, as long as the software is installed by rpm.
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 <package_name>

2. Use Yum to delete a software package
Command: Yum remove <package_name>

Use Yum to query Software Information
We often encounter such a situation. To install a software, we only know that it has something to do with it, but we cannot know its name exactly. In this case, the yum query function takes effect. You can use commands such as Yum search keyword to search. For example, if you want to install instant messenger, but you don't know what it is, you can use commands such as Yum search messenger to search, yum searches for all available RPM descriptions and lists all RPM packages related to messeger in the descriptions. We may obtain 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 <keyword>

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 <package_name>

7. Use Yum to obtain the software package information
Command: Yum info <package_name>

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 <package_name>

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 is a brain

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)

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.