I. usage of RPM Package management; 1. software can be installed, deleted, upgraded, and managed; of course, software can also be installed and upgraded online; 2. you can use RPM to check which files are included in the software package and which software package the file belongs to. 3. the software package in the system is... capital
I,RPMUsage of package management; 1. you can install, delete, upgrade, and manage software. of course, you can also install and upgrade software online;
2. you can use RPM to check which files are included in the software package and which software package the file belongs;
3. check whether or not the software package in the query system is installed and its version;
4. as a developer, you can package your program as an RPM Package for release;
5. import, verify, and release of the software package signature GPG and MD5
6. check the dependency to see if any software package has disrupted the system due to incompatibility;
II,RPM;
Only root permissions can be used to install, delete, and update RPM software. any user can perform operations on the query function. if a common user has the permission to install directories, the RPM software can also be installed;
III,RpmA little simple usage;
In addition to the software package manager, we can also use rpm commands to install software packages. can all software packages be installed using rpm commands? No, the file ends with a. rpm suffix. sometimes we find file. rpm on some websites and install it with rpm;
1) InitializationRpmDatabase;
Run the rpm command to check whether an rpm Package is installed. The rpm database is also used. Therefore, we often use the following two commands to initialize the rpm database;
[Root @ localhost beinan] # rpm -- initdb
[Root @ localhost beinan] # rpm -- rebuilddb note: This takes a long time;
Note: These two parameters are extremely useful. sometimes the rpm system has a problem and cannot be installed or queried. most of them have a problem here;
2)RPMQuery functions of software package management:
Command format
Rpm {-q | -- query} [select-options] [query-options]
The query function of RPM is extremely powerful and one of the most important functions. For more details, refer to # man rpm.
1. query the software installed in the system;
1) query the installed software;
Syntax: rpm-q software name
Example:
[Root @ localhost beinan] # rpm-q gaim
Gaim-1.3.0-1.fc4
-Q is -- query, which means "q" in Chinese. this command indicates whether gaim is installed in the system. if gaim is installed, information is output. if gaim is not installed, will output the information that gaim has not been installed;
To view all installed packages in the system, add the-a parameter;
[Root @ localhost RPMS] # rpm-qa
If you view it by page, add another pipeline | and more commands;
[Root @ localhost RPMS] # rpm-qa | more
Find a software in all installed software packages, such as gaim. you can use grep to extract the software;
[Root @ localhost RPMS] # rpm-qa | grep gaim
The above function is the same as that output by rpm-q gaim;
2) query the software package of an installed file;
Syntax rpm-qf file name
Note: the absolute path of the file name must be specified.
Example:
[Root @ localhost RPMS] # rpm-qf/usr/lib/libacl. la
Libacl-devel-2.2.23-8
3) query where all installed software packages are installed;
Syntax: rpm-ql software name or rpm rpmquery-ql software name
Example:
[Root @ localhost RPMS] # rpm-ql lynx
[Root @ localhost RPMS] # rpmquery-ql lynx
4) query the information of an installed software package
Syntax format: rpm-qi software name
Example:
[Root @ localhost RPMS] # rpm-qi lynx
5) Check the configuration file of the installed software;
Syntax format: rpm-qc Software name
Example:
[Root @ localhost RPMS] # rpm-qc lynx
6) view the installation location of a software installation document:
Syntax format: rpm-qd software name
Example:
[Root @ localhost RPMS] # rpm-qd lynx
7) check the software packages and files on which the software is installed;
Syntax: rpm-qR software name
Example:
[Root @ localhost beinan] # rpm-qR rpm-python
Query the summary of installed software: for a software package that has been installed, we can combine a series of parameters, such as rpm-qil. for example:
[Root @ localhost RPMS] # rpm-qil lynx
2. View uninstalled software packages:
The premise is that you have a. rpm file, that is, you can view the file. rpm of the existing software;
1) view the purpose and version of a software package;
Syntax: rpm-qpi file. rpm
Example:
[Root @ localhost RPMS] # rpm-qpi lynx-2.8.5-23.i386.rpm
2) view the files contained in a software package;
Syntax: rpm-qpl file. rpm
Example:
[Root @ localhost RPMS] # rpm-qpl lynx-2.8.5-23.i386.rpm
3) view the document location of the software package;
Syntax: rpm-qpd file. rpm
Example:
[Root @ localhost RPMS] # rpm-qpd lynx-2.8.5-23.i386.rpm
5) view the configuration file of a software package;
Syntax: rpm-qpc file. rpm
Example:
[Root @ localhost RPMS] # rpm-qpc lynx-2.8.5-23.i386.rpm
4) view the dependency of a software package
3) installation, upgrade, and deletion of software packages;
1. install and upgrade an rpm package;
[Root @ localhost beinan] # rpm-vih file. rpm note: This is used to install a new rpm package;
[Root @ localhost beinan] # rpm-Uvh file. rpm note: This is used to upgrade an rpm package;
If dependency exists, resolve the dependency. In fact, the software package manager can solve the dependency well. See the previous introduction of the software package manager; if you cannot find the dependency package in the package manager, you can only compile the dependent package to solve the dependency or force the installation;
Syntax structure:
[Root @ localhost beinan] # rpm-ivh file. rpm -- nodeps -- force
[Root @ localhost beinan] # rpm-Uvh file. rpm -- nodeps -- force
For more parameters, see man rpm
Example application:
[Root @ localhost RPMS] # rpm-ivh lynx-2.8.5-23.i386.rpm
Preparing... ######################################## ### [100%]
1: lynx ####################################### #### [100%]
[Root @ localhost RPMS] # rpm-ivh -- replacepkgs lynx-2.8.5-23.i386.rpm
Preparing... ######################################## ### [100%]
1: lynx ####################################### #### [100%]
Note: The -- replacepkgs parameter is installed again with the installed software. sometimes it is not necessary too much;
Test the installation parameter -- test, which is used to check the dependency. it is not a real installation;
[Root @ localhost RPMS] # rpm-ivh -- test gaim-1.3.0-1.fc4.i386.rpm
Preparing... ######################################## ### [100%]
Downgrade from the new version to the old version, and add the -- oldpackage parameter;
[Root @ localhost RPMS] # rpm-qa gaim
Gaim-1.5.0-1.fc4
[Root @ localhost RPMS] # rpm-Uvh -- oldpackage gaim-1.3.0-1.fc4.i386.rpm
Preparing... ######################################## ### [100%]
1: gaim ####################################### #### [100%]
[Root @ localhost RPMS] # rpm-qa gaim
Gaim-1.3.0-1.fc4
Specify the installation directory for the package: add the-relocate parameter; the example below is to specify the gaim-1.3.0-1.fc4.i386.rpm to install in the/opt/gaim directory;
[Root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm
Preparing... ######################################## ### [100%]
1: gaim ####################################### #### [100%]
[Root @ localhost RPMS] # ls/opt/
Gaim
Specify the installation directory for the package: add the-relocate parameter; the example below is to specify the installation of the lynx-2.8.5-23.i386.rpm in the/opt/lynx directory;
[Root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/lynx -- badreloc lynx-2.8.5-23.i386.rpm
Preparing... ######################################## ### [100%]
1: lynx ####################################### #### [100%]
How can we call a program installed in a specified directory? Generally, the execution programs are stored in the bin or sbin Directory of the installation directory. Take a look at the example below. if there is an error output, make the corresponding link and use ln-s;
2. delete an rpm package;
First, you must learn to query the rpm Package. please refer to the previous instructions;
[Root @ localhost beinan] # rpm-e package name
For example, if I want to remove the lynx package, the complete operation should be:
[Root @ localhost RPMS] # rpm-e lynx
If there is a dependency, you can also use -- nodeps to ignore the dependency check to delete it. But do not do this as much as possible. it is best to use the software package manager systerm-config-packages to delete or add software;
[Root @ localhost fc40] # rpm -- import RPM-GPG-KEY
[Root @ localhost fc40] # rpm -- import RPM-GPG-KEY-fedora
For more information about the RPM signature function, see man rpm
V,RPMThe management package manager supports network installation and query;
For example, we want to query and install software packages through an image of Fedora Core 4.0;
Address:
Http://mirrors.kernel.org/fedora/core/4/i386/ OS /Fedora/RPMS/
Example:
Command format:
The http or ftp address of the rpm parameter rpm Package File
# RPMS-qpi http://mirrors.kernel.org/fedora/core/4/i386/ OS/Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm
# Rpm-ivh http://mirrors.kernel.org/fedora/core/4/i386/ OS/Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm.
Let's look at the opposite;
6. supplement the query of installed software packages; [Root @ localhost RPMS] # updatedb
[Root @ localhost RPMS] # locate software name or file name
Through updatedb, we can use locate to query where some software has been installed. when the system is first installed, it needs to execute updatedb and run it every other time to keep the installed software library up-to-date; updatedb is owned by the slocate software package. if you do not have this command, you must install slocate;
Example:
Example:
[Root @ localhost RPMS] # rpm2cpio gaim-1.3.0-1.fc4.i386.rpm | cpio-div
The extracted files are stored in usr and etc;
In fact, it is better to specify the installation directory to install software. you can also extract files;
Specify the installation directory for the package: add the-relocate parameter; the example below is to specify the gaim-1.3.0-1.fc4.i386.rpm to install in the/opt/gaim directory;
[Root @ localhost RPMS] # rpm-ivh -- relocate/=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm
Preparing... ######################################## ### [100%]
1: gaim ####################################### #### [100%]
[Root @ localhost RPMS] # ls/opt/
Gaim
In this way, all the gaim files are installed in/opt/gaim. we just back up the gaim directory and then unload the gaim. this is actually a usage of extracting files;
8,RPMConfiguration file;
For RPM Package management, the configuration file is rpmrc, which can be found in our system. for example, the rpmrc file in Fedora Core 4.0 is located;
[Root @ localhost RPMS] # locate rpmrc
/Usr/lib/rpm/rpmrc
/Usr/lib/rpm/redhat/rpmrc
You can view the details through rpm -- showrc. Oh... Don't ask me, I don't understand either. as long as you read this article and think it is useful to you, your level is similar to mine. our level is the same, so I cannot help you. please understand
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.