linux command details how to use rpm command parameters

  • 2020-05-07 20:48:25
  • OfStack

rpm performs the installation package

Base 2 package (Binary) and source code package (Source). The base 2 package can be installed directly on the computer, and the source code package will be automatically compiled and installed by RPM. Source code packages often have the suffix src.rpm.
Common command combination:
-ivh: installation shows installation progress --install--verbose--hash
-Uvh: upgrade package -Update;
-qpl: lists the file information in the RPM package [Query Package list];
-qpi: lists the description information of the RPM package [Query Package install package(s)];
-qf: find which RPM package the specified file belongs to [Query File];
-Va: verify all RPM packages to find missing files [View Lost];
-e: delete package


rpm -q samba // Inquire whether the program is installed 
rpm -ivh /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm // Install by path and display progress 
rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm    // Specify installation directory 
rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm    // To check dependencies; It's not really an installation; 
rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm // The new version is relegated to the old one 
rpm -qa | grep httpd     #[ Search specified rpm Whether the package is installed ]--all search *httpd*
rpm -ql httpd         #[ search rpm package ]--list All files installed in the directory 
rpm -qpi Linux-1.4-6.i368.rpm #[ To view rpm package ]--query--package--install package information 
rpm -qpf Linux-1.4-6.i368.rpm #[ To view rpm package ]--file
rpm -qpR file.rpm       #[ Check the package ] dependencies 
rpm2cpio file.rpm |cpio -div   #[ Pull out the file ]
rpm -ivh file.rpm  #[ Install the new rpm]--install--verbose--hash
rpm -ivh http://mirrors.kernel.org/fedora/core/4/i386/os/Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm
rpm -Uvh file.rpm   #[ upgrade 1 a rpm]--upgrade
rpm -e file.rpm     #[ delete 1 a rpm package ]--erase

Common parameters:
Install/Upgrade/Erase options:


-i, --install                     install package(s)
-v, --verbose                     provide more detailed output
-h, --hash                        print hash marks as package installs (good with -v)
-e, --erase                       erase (uninstall) package
-U, --upgrade=<packagefile>+      upgrade package(s)
 - -replacepkge                     Force the package to be installed regardless of whether it has been installed 
--test                             Install test, do not actually install 
--nodeps                           Ignore software package dependencies to force installation 
--force                            Ignore software package and file conflicts 
Query options (with -q or --query):
-a, --all                         query/verify all packages
-p, --package                     query/verify a package file
-l, --list                        list files in package
-d, --docfiles                    list all documentation files
-f, --file                        query/verify package(s) owning file

RPM source code packaging installation
.src.rpm. These files are packaged from the source code of the software. To install this RPM package, the user must use the following command:


rpm --recompile vim-4.6-4.src.rpm  # This command unpacks the source code and compiles and installs it if the user USES the command: 
rpm --rebuild vim-4.6-4.src.rpm  # After the installation is complete, the compiled executable is also repackaged as i386.rpm  the RPM The software package. 
[root@localhost src]# rpm -ivh awstats-6.8-1.noarch.rpm
error: Failed dependencies:
perl(LWP::UserAgent) is needed by awstats-6.8-1.noarch
[root@localhost src]#

Use the rpm attribute dependency suite for the archive


[root@localhost src]# rpm -qpR awstats-6.8-1.noarch.rpm
/bin/sh
/usr/bin/perl
config(awstats) = 6.8-1
perl >= 0:5.005
perl(LWP::UserAgent)
perl(POSIX)
perl(Socket)
perl(Time::Local)
perl(strict)
perl(vars)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1


Related articles: