Home > php教程 > PHP开发 > body text

Summary of RPM package installation, query, uninstall command and detailed explanation of yum command in Linux

高洛峰
Release: 2017-01-07 13:57:19
Original
2360 people have browsed it

I have been using ubuntu before. Installing and uninstalling software is basically using apt-get, which is very simple, and the software dependencies encountered in the process will be automatically handled for us, similar to fool-proof installation. In addition, under the Linux operating system, almost all software can be installed, uninstalled and managed through RPM. The full name of RPM is Redhat Package Manager, which is a software proposed by Redhat Company for managing software packages under Linux. When installing Linux, except for a few core modules, almost all other modules are installed through RPM. RPM has five operating modes: installation, uninstallation, upgrade, query and verification.

RPM installation operation

Command:

rpm -i The name of the package file to be installed

For example:

rpm -i example.rpm installs the example.rpm package;

rpm -iv example.rpm installs the example.rpm package and displays the file information being installed during the installation process;

rpm -ivh example.rpm Install the example.rpm package and display the file information being installed and the installation progress during the installation process;

RPM query operation

Command:

rpm -q …

Additional query commands:

a Query all installed packages The following two additional commands are used to query the information of the installation package;

i Display the information of the installation package;

l displays the directories where all the files in the installation package are installed;

s displays the status of all files in the installation version and the directories where they are installed; the following two additional commands are used to specify the query Whether it is an installation package or an installed file;

p queries the information of the installation package;

f queries the information of an installed file;

Example As follows:

rpm -qa | grep tomcat4 Check whether tomcat4 is installed;

rpm -qip example.rpm Check the information of the example.rpm installation package;

rpm -qif /bin/df View the information of the installation package where the /bin/df file is located;

rpm -qlf /bin/df View the directory where each file in the installation package where the /bin/df file is located is installed;

RPM uninstall operation

Command:

rpm -e Installation package that needs to be uninstalled

Before uninstalling, you usually need to use the rpm -q...command to check Enter the name of the installation package that needs to be uninstalled.

For example:

rpm -e tomcat4 Uninstall tomcat4 software package

RPM upgrade operation

Command:

rpm -U required The upgraded package

is as follows:

rpm -Uvh example.rpm Upgrade example.rpm package

RPM Verification operation

Command:

rpm -V Packages that need to be verified

Examples are as follows:

rpm -Vf /etc/tomcat4/tomcat4.conf

The output information is similar to the following:

S.5....T c /etc/tomcat4/tomcat4.conf

Among them, S means that the file size has been modified, and T means that the file date has been modified. Due to space limitations, please refer to the rpm help file for more verification information: man rpm

Other additional commands for RPM

--force forced operations such as forced installation and deletion;

--requires displays the dependencies of the package;

--nodeps ignores the dependencies and continues the operation;

The following is a detailed introduction to the usage of the yum command by the editor of Script House. So what is YUM? It is the abbreviation of Yellow dog Updater Modified. Its purpose is to solve the dependencies of RPM packages and facilitate users to install, delete, upgrade and other software.
If you are a Linux beginner, you will definitely be troubled by software installation. Although RPM packages solve a certain level of problems, the dependencies of some RPM packages are very troublesome. The emergence of some RPM package management methods such as YUM and APT has made the installation of software on the Linux platform easier. So what is YUM? It is the abbreviation of Yellow dog Updater Modified. This article will introduce the use of the yum command in detail. The configuration of the YUM warehouse will be described in detail in other technical documents on the 51 open source site.

The usage of the yum command will be described in detail below:

Main parameters:

-y Does not require user confirmation of the operation to occur

1 .Use YUM to install and delete software

Yum will query the database to see if there is such a software package. If so, check its dependency conflict. If there is no dependency conflict, download and install it; if so, a prompt will be given. , asking whether you want to install dependencies at the same time, or delete conflicting packages, you can make your own judgment.
#yum install software name //Use YUM to install the specified software package
#yum remove software name //Use YUM to delete the specified software package
#yum localinstall RPM package file //Use YUM to install the local RPM package
#yum groupinstall //Install all software in the specified group
#yum groupremove packagegroup //Remove all software in the specified group
Note: install, localinstall Difference: When using install, the specified software package will be downloaded and installed from the YUM server, while the software specified by localinstall is installed using RPM packages, and the packages required for dependencies are downloaded and installed from the YUM server.

2. Use YUM to query software information

#yum check-update //List all updateable software lists
#yum -y update //Upgrade all installed software
#yum -y update //Upgrade Specified software package
#yum upgrade //Large-scale version upgrade, different from yum update, even the old obsolete packages are upgraded
#yum groupupdate //Update the specified software Software packages in the group
#yum info software name //Display information related to the specified software package
#yum info updates //Display information about all software packages that can be updated
#yum info installed //Show all Information about installed software packages
#yum info extras //Display information about all installed software packages but not in the YUM repository
#yum groupinfo //Display information about the specified group
#yum list                                                                                                                                
#yum list Software name //List the installation status of the specified software package
#yum list available //List all rpm packages that can be installed in the resource library
#yum list available / /List all installable rpm packages in the resource library that match the regular expression
#yum listinstalled //List all installed software packages
#yum list installed //List resources All installed rpm packages in the library that match the regular expression
#yum list extras //List all installed software packages that are not in the YUM repository
#yum list extras //Column Extract installed rpm packages that match the regular expression but are not included in the resource library
#yum grouplist                                                                                                              Search the YUM source for the specified keyword
#yum search //Detect the names, descriptions, overviews and listed maintainers of all available software, and find values ​​that match the regular expression
#yum list recent //List recently added software packages to the resource library
#yum provides Value
#yum deplist //Display the dependency information of the software package

3. Clear the YUM cache

yum will store the downloaded software package and header in the cache in and will not be automatically deleted.

#yum clean packages //Clear the software packages in the cache directory (/var/cache/yum)

#yum clean headers //Clear the headers in the cache directory (/var/cache/yum)
#yum clean oldheaders //Clear the old headers in the cache directory (/var/cache/yum)
#yum clean all //Clear the software packages and old headers in the cache directory (/var/cache/yum)
#yum clean //Same as above, clear the software packages and old headers in the cache directory (/var/cache/yum)

yum command usage examples

1. Upgrade the system


#yum update

2. Install the specified software package

# yum -y install vsftpd

3. Upgrade the specified software package

# yum -y update mysql

4. Uninstall the specified software package

# yum -y remore vsftpd mysql

5. Check what has been installed in the system and available software groups. For available software groups, you can choose to install

# yum grouplist

6. Install one of the available software groups displayed in the previous command. God's Editor-Emacs, about 12 software packages are installed

# yum -y groupinstall Emacs

7. Update the software packages in the specified software group

# yum -y groupupdate Emacs

8. Uninstall the software packages in the specified software group. For Emacs, 12 software packages were installed during installation, but only 4 software packages were uninstalled during uninstallation!

# yum -y groupremove Emacs

9. Clear the rpm header files and package files in the cache

# yum clean all

10. Search related Software package

# yum -y search Emacs

11. Display information about the specified software package

# yum info Emacs

and rpm -qi emacs The information displayed is similar, but not identical

12. Query the dependency information of the specified software package. There are many modules that emacs depends on.

# yum deplist emacs

13. List all software packages starting with yum

# yum list yum*

14. List the rpm packages that have been installed but are not included in the resource library

# yum list extras


For more related articles about RPM package installation query and uninstall command summary and yum command details in Linux, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template