CentOS software installation methods: rpm and yum

Source: Internet
Author: User

Centos software installation can be divided into two types:

[Centos] rpm file installation, using the rpm Command similar to the [ubuntu] deb File Installation, using the dpkg Command [centos] yum installation similar to the [ubuntu] apt-get Installation

Rpm command

(1) Querying System for Installed Software Information

For an rpm package, "-" and ". "consists of the following components: * package name * version information * release version * running platform. When noarch appears, it indicates that the software is platform compatible.

1) Check the software installed in the query system.

rpm -qa 

2) query the software package of an installed file;

Absolute path of rpm-qf file name

3) query where all installed software packages are installed;

The software name is defined as: the rpm package removes the platform information and suffix Information

Rpm-ql software name

4) query the information of an installed software package

Rpm-qi software name

5) Check the configuration file of the installed software;

Rpm-qc software name

6) view the installation location of a software installation document:

Rpm-qd software name

7) Check the software packages and files on which the software is installed;

Rpm-qR software name


(2) querying information about uninstalled software packages

1) view the purpose and version of a software package;

Rpm-qpi rpm file

2) view the files contained in a software package;

Rpm-qpl rpm file

3) view the document location of the software package;

Rpm-qpd rpm file

4) view the configuration file of a software package;

Rpm-qpc rpm file

5) view the dependency of a software package

Rpm-qpR rpm file


(3) installation, upgrade, and deletion of software packages

1) install or upgrade an rpm package

Rpm-ivh rpm file [install] rpm-Uvh rpm file [update]

2) delete an rpm package

Rpm-e Software name

How to forcibly Delete the software regardless of the dependency, add -- nodeps after the above command


(4) signature Import

Rpm -- import signature file rpm -- import RPM-GPG-KEY

Yum command

(1) Basic concepts of yum 1) What is yum?
Yum = Yellow dog Updater. Modified is mainly used to conveniently Add/delete/update RPM packages. It can automatically solve the dependency problem of packages and facilitate management of a large number of system updates.

2) yum features

You can configure a simple configuration file (/etc/yum. conf) for multiple resource libraries (Repository) at the same time to automatically solve the dependency problems encountered when adding or deleting an rpm package. This makes it easy to maintain consistency with the RPM database.

3) install yum

CentOS comes with (yum-*. noarch. rpm) # rpm-ivh yum-*. noarch. rpm first needs to import the RPM-GPG-KEY of the system before enabling yum for the first time:


(2) Use of yum commands

When you use the yum management software for the first time, yum automatically downloads the required headers and stores them in the/var/cache/yum directory;

1) Update the rpm package


# Check the software packages that can be updated
Yum check-update
# Update all software packages
Yum update

# Update a specific software package
Yum update kernel

# Large-scale upgrade
Yum upgrade

2) Installation and deletion of rpm packages

# Installation and deletion of rpm packages
Yum install xxx [service name]
Yum remove xxx [service name]

3) yum cache-related information


# Clear cache rpm package files
Yum clean packages
# Clear cache rpm header files
Yum clean headers
# Clear old header files in the cache
Yum clean old headers
# Clear old rpm header files and package files in the cache
Yum clean all

4) query software package information

# 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 firfox *
N: You can use wildcards in the rpm package name to query similar rpm packages.

# List all the rpm packages that can be updated 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
N: download and install the rpm package through a website such

# Rpm package information display (the info parameter is the same as the list), listing all rpm packages that can be installed or updated in the resource library
Yum info

# List specific installed or updated rpm packages in the resource library and their information

Yum info firefox *
N: Match characters can be used in rpm package names.

# List all updates to rpm packages in the resource library
Yum info updates

# List all installed rpm packages

Yum info installed

# List the rpm packages installed but not included in the resource library
Yum info extras
N: Download the installed rpm package information through a website such

# Search for rpm packages matching specific characters
Yum search firofox
# Search for rpm Packages containing specific files
Yum provides firefox


(3) yum software source update

Http://mirrors.163.com/.help/centos.html


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.