Detailed explanation of Linux RPM command parameter usage to view rpm package dependencies

rpm executes the installation package
binary package (Binary) and source code package (Source). Binary packages can be installed directly on the computer, while source code packages will be automatically compiled and installed by RPM. Source code packages often end in src.rpm.
Common command combinations:
-ivh: install to display the installation progress --install--verbose--hash
-Uvh: upgrade the package --Update;
-qpl: list the file information in the RPM package [Query Package list];
-qpi : List the description information of RPM packages [Query Package install package(s)];
-qf: Find which RPM package the specified file belongs to [Query File];
-Va: Verify all RPM packages and find missing files [View Lost];
-e: delete the package
rpm -q samba //Check whether the program is installed
rpm -ivh /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm //Install and install by path Show progress
rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm //Specify the installation directory
rpm -ivh --test gaim-1.3.0-1.fc4.i386. rpm //Used to check dependencies; not a real installation;
rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm //The new version is downgraded to the old version
rpm -qa | grep httpd #[Search whether the specified rpm package is installed]--all search *httpd*
rpm -ql httpd #[Search rpm package]--list all file installation directories
rpm -qpi Linux-1.4-6.i368. rpm #[View rpm package]--query--package--install package information
rpm -qpf Linux-1.4-6.i368.rpm #[View rpm package]--file
rpm -qpR file.rpm #[View package] dependencies
rpm2cpio file.rpm |cpio -div #[extract file]
rpm -ivh file.rpm #[install 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 an rpm]
--upgrade rpm -e file.rpm #[ Delete an 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 the package is already installed
--test Install tests without actually installing
--nodeps Ignore package dependencies forcibly install
--force Ignore packages and files Conflicts of
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
files ending in .src.rpm, these files are packaged by the source code of the software , the user must use the command to install this type of RPM package:
rpm --recompile vim-4.6-4.src.rpm #This command will unpack the source code, compile and install it, if the user uses the command:
rpm -- rebuild vim-4.6-4.src.rpm #After the installation is complete, it will also repackage the compiled executable file into the RPM package of i386.rpm.

[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

rpm Attribute dependency package file

[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



In addition: # rpm -ivh --aid samba*.rpm (be sure to install rpmdb before you can install and exclude dependencies in this way)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326440865&siteId=291194637
Recommended