Detailed explanation of RPM commands (installation, upgrade, uninstallation)
rpm common commands
1. Install a package
# rpm -ivh
2. Upgrade a package
# rpm -Uvh
3. Uninstall a package
# rpm -e
4. Installation parameter
--force Even if the coverage belongs to The files of other packages are also forced to install
--nodeps If the installation of the RPM package depends on other packages, it will be forced to install even if other packages are not installed.
5. Query whether a package is installed
# rpm -q < rpm package name>
6. Get the information of the installed package
# rpm -qi < rpm package name>
7. List which files are in the package
# rpm -ql < rpm package name>
8. List which RPM package a file on the server belongs to
#rpm -qf
9. Several parameters can be used together
# rpm -qil <rpm package name>
10. List all installed rpm packages
# rpm -qa
11. List what files are included in an RPM package file that has not been installed into the system?
# rpm -qilp < rpm package name>
<>
1. Installation
Command format:
rpm -i ( or --install) options file1.rpm ... fileN.rpm
Parameters:
file1.rpm ... fileN.rpm The file name of the RPM package to be installed
Detailed options:
-h (or -- hash) output a hash token (``#'')
when installing --test Only test the installation, not the actual installation.
--percent Output the progress of the installation as a percentage.
--excludedocs do not install documentation files in packages --includedocs
install documentation
--replacepkgs force reinstallation of installed packages
--replacefiles replace files belonging to other packages
--force ignore package and file conflicts
--noscripts Do not run pre-installation and post-installation scripts
--prefix install the package to the path specified by
--ignorearch do not verify the structure of the package
--ignoreos do not check the operating system the package runs on
--nodeps do not check dependencies
--ftpproxy use as FTP proxy
--ftpport specify FTP port number as
common options
-v display additional information
-vv display debugging information
--root tells RPM to use the specified path as the "root directory", so that both pre-installers and post-
installers will be installed in this directory --rcfile
set the rpmrc file to
--dbpath set the path where the RPM repository is located to
two , delete
Command format:
rpm -e (or --erase) options pkg1 ... pkgN
Parameters
pkg1 ... pkgN : packages to be deleted
verbose options
--test only execute deleted tests
--noscripts do not run pre-installation and postinstaller script
--nodeps don't check dependencies
general option
-vv show debug info
--root tells RPM to use the specified path as the "root directory", so both preinstallers and
postinstallers will be installed in this directory
-- rcfile Set the rpmrc file to
--dbpath Set the path where the RPM data inventory is located
3. Upgrade
Command format
rpm -U ( or --upgrade) options file1.rpm ... fileN.rpm
Parameters
file1.rpm ... fileN.rpm package name
verbose option
-h (or --hash) output hash notation (``#'') when installing
--oldpackage allow "upgrades" to an older version
--test do upgrade tests only
--excludedocs don't install documentation files in packages --includedocs
install documentation
--replacepkgs force reinstallation of already installed packages
--replacefiles replace belonging Other packages' files
--force ignore package and file conflicts
--percent output the progress of the installation as a percentage.
--noscripts do not run pre-installation and post-installation scripts
--prefix install the package to the path specified by
--ignorearch do not verify the structure of the package
--ignoreos do not check the operating system the package runs on
--nodeps do not check Dependencies
--ftpproxy use as FTP proxy
--ftpport specify FTP port number as
common options
-v show additional information
-vv show debug information
--root make RPM use the specified path as the "root directory", thus preinstalling The program and the post-installer will be installed in this directory --rcfile
Set the rpmrc file to
--dbpath Set the path where the RPM data inventory is located.
Fourth , the query
command format:
rpm -q ( or --query) options
Parameters:
pkg1 ... pkgN : query installed packages
verbose option
-p (or ``-'') query package files
-f query which package belongs to
-a query all installed packages
--whatprovides query Packages that provide functionality
-g query packages belonging to a group
--whatrequires query all packages that require functionality
info options
show all package identifiers
-i show package summary information
-l show a list of files in a package
- c show a list of configuration files
-d show a list of documentation files
-s show a list of files in the package and show the status of each file
--scripts show install, uninstall, and verify scripts
--queryformat (or --qf) in user-specified way to show query information
--dump show all verified information for each file
--provides show the functions provided by the package
--requires (or -R) show the functions required by the package
general options
-v show additional information
-vv Display debugging information
--root Let RPM use the specified path as the "root directory", so that both pre-installers and post-installers will be installed in this directory
--rcfile Set the rpmrc file to
--dbpath Set the path where the RPM data inventory is located.
5. Verify the installed software package
Command format:
rpm -V ( or --verify, or -y) options
parameter
pkg1 ... pkgN The name of the software package to be verified
Package options
-p Verify against package file
-f Verify belonging packages
-a Verify Verify all packages
-g Verify all packages belonging to group
Verbose options
--noscripts do not run verification scripts
--nodeps no Verify dependencies
--nofiles Do not verify file attributes
Common options
-v show additional information
-vv show debug information
--root Make RPM use the specified path as the "root directory", so that both pre-installers and post-installers will be installed Go to this directory --rcfile
Set the rpmrc file to
--dbpath Set the path where the RPM database is located.
Sixth , verify the files in the package
Syntax:
rpm -K ( or --checksig) options file1.rpm ... fileN .rpm
parameters:
file1.rpm ... fileN.rpm The filename of the package
Checksig--Detailed options
--nopgp Do not verify PGP signatures
General options-
v Display additional information
-vv Display debugging information
--rcfile Set the rpmrc file to
7. Other RPM options--rebuilddb
Rebuild the RPM database
--initdb Create a new RPM repository
--quiet reduce output as much as possible
--help show help file
--version show current version of RPM
Detailed RPM command (install, upgrade, uninstall
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326049976&siteId=291194637
Recommended
Ranking