Linux rpm related commands

RPM(RedHat Package Manager)

Binary package (Binary) as well as the source code package (Source) two. The binary package can be installed directly on the computer, and the source code package will be compiled and installed automatically by the RPM. Source code packages often use src.rpm as a suffix.

1.Common command combination:

-ivh:--install--verbose--hash(Installation and display progress).
-Uvh:--Update--verbose--hash(Upgrade package).
-qpl:List files in the RPM package[Query Package list].
-qpi:List description information for RPM packages[Query Package install package(s)].
-qf:Find the specified file belonging to which RPM software package[Query File].
-Va:Check all RPM packages to find lost files[View Lost].
-e:Delete pack


rpm -q samba //Query program is installed

rpm -ivh  /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm //Install and display progress by path
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    //Used to check dependencies, not real installation.
rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm //The new version was relegated to an older version.

rpm -qa | grep httpd      #[Search for the specified RPM package is installed]--all
rpm -ql httpd         #[Search RPM package]--list

rpm -qpi Linux-1.4-6.i368.rpm #[Search RPM package]--query--package--install package
rpm -qpf Linux-1.4-6.i368.rpm #[Search RPM package]--file
rpm -qpR file.rpm       #[view] dependency relationship
rpm2cpio file.rpm | cpio -div    #[Extract file]

rpm -ivh file.rpm  #[Install new rpm]--install--verbose--hash
rpm -ivh

rpm -Uvh file.rpm    #[Upgrade rpm]--upgrade
rpm -e file.rpm      #[Delete a RPM package]--erase

2.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                     Regardless of whether the package has been installed, are forced to install the software package
--test                            Installation tests are not actually installed
--nodeps                          Ignore dependencies on software packages to install
--force                           Ignore the conflict between the package and the file

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

3.RPM source code package installation

.src.rpm the end of the file, these files are packaged by the source code of the software, the user wants to install the RPM package, you must use the command:



rpm --recompile vim-4.6-4.src.rpm   #This command will put the source code and compile and install it, if the user is using the command.

rpm --rebuild vim-4.6-4.src.rpm  #After the installation is complete, will compile the executable file generated by the re packaged into RPM i386.rpm software package.

Pingbacks are closed.

Comments are closed.