SYS: Learn to use the rpm command.
To install (-i) a new package (here httpd-2.2.15-29.el6.x86_64.rpm), type:
# rpm -ivh httpd-2.2.15-29.el6.x86_64.rpm
To upgrade (-U) an existing package (here httpd-2.2.15-29.el6.x86_64.rpm), type:
# rpm -Uvh httpd-2.2.15-29.el6.x86_64.rpm
To erase (-e) an existing package (here httpd-2.2.15-29.el6.x86_64), type:
# rpm -evh httpd-2.2.15-29.el6.x86_64
To get the list of all the installed packages, type:
# rpm -qa
To get some details about a package (here httpd-2.2.15-29.el6.x86_64), type:
# rpm -qi httpd-2.2.15-29.el6.x86_64
To get the package file list (here httpd-2.2.15-29.el6.x86_64), type:
# rpm -ql httpd-2.2.15-29.el6.x86_64
To get the list of all the modified files in the system, type:
# rpm -qVa
To get the change history of a package (here openssl), type:
# rpm -q --changelog openssl
* Thu Oct 16 2014 Tomáš Mráz <tmraz@redhat.com> 1.0.1e-30.4
- use FIPS approved method for computation of d in RSA
...
* Tue Oct 26 1999 Bernhard Rosenkrdnzer <bero@redhat.de>
- inital packaging
- changes from base:
- Move /usr/local/ssl to /usr/share/ssl for FHS compliance
- handle RPM_OPT_FLAGS
To get the list of packages coming from a given repository (here remi), type:
# rpm -qa --qf '%{VENDOR} \t %{NAME}\n' | grep -i remi
Remi Collet libzip-last
Remi Collet remi-release
Remi Collet php-xml
Remi Collet php-pecl-zip
...
Caution: If it is very useful to know the rpm command to query the system, it’s better not to use it to install a package:
- This command doesn’t deal with the package dependencies: you will have to do it yourself with all sorts of additional difficulties.
- It breaks the yum transaction history (=>Warning: RPMDB altered outside of yum).
Use the yum command instead.
Leave a comment