Detailed explanation of Linux rpm command

share a drink no 2022-11-24 21:18:16 阅读数:479


There are two types of rpm executable installation packages: binary package (Binary) and source code package (Source).The binary package can be installed directly on the computer, while the source code package will be automatically compiled and installed by RPM.Source code packages often end in src.rpm as a suffix.

Common command combinations

-ivh: installation display installation progress –install–verbose–hash -Uvh: upgrade software package –Update; -qpl: list file information in RPM software package [Query Package list]; -qpi: list RPM softwarePackage description information [Query Package install package(s)]; -qf: Find which RPM package the specified file belongs to [Query File]; -Va: Verify all RPM packages and find lost files [View Lost];-e: delete package

#Check whether the program is installedrpm -q samba#Install by path and display progressrpm -ivh /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm#Specify the installation directoryrpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm#Used to check dependencies; not a real installation;rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm# Downgrade the new version to the old versionrpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm#Search whether the specified rpm package is installed, search for *httpd*rpm -qa | grep httpd --all#[Search rpm package] all files installation directoryrpm -ql httpd --list#[View rpm package] package informationrpm -qpi Linux-1.4-6.i368.rpm --query --package --install#[View rpm package]rpm -qpf Linux-1.4-6.i368.rpm --file# [View Package] Dependenciesrpm -qpR file.rpm#[extract file]rpm 2cpio file.rpm |cpio -div# [install new rpm]rpm -ivh file.rpm --install --verbose --hashrpm -ivh [url][/url]# [Upgrade an rpm]rpm -Uvh file.rpm --upgrade#[delete an rpm package]rpm -e file.rpm --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=+ upgrade package(s)--replacepkge force install the package regardless of whether the package is already installed--test install test, don't actually install--nodeps ignore package dependencies and force install--force ignore package and file conflictsQuery 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 codepackage install

Files ending in .src.rpm, these files are packaged from the source code of the software, users must use the command to install this type of RPM package:

 #This command will unpack the source code and compile and install itrpm --recompile vim-4.6-4.src.rpm# If the user uses this command, after the installation is complete, the compiled executable file will be repackaged into an RPM package of i386.rpm.rpm --rebuild vim-4.6-4.src.rpm 

In addition: # rpm -ivh --aid samba*.rpm (you must install rpmdb before you can use this method to install and exclude dependencies)

Woo la la la la if you like it, please like it, collect it or follow it

copyright:author[share a drink no],Please bring the original link to reprint, thank you.