TOPIC 4

Date: 2/8/2017
Package management
Linux System Administration


Quiry RPM packages with rpm
Exercises
What packages are installed on the system?
rpm -qa
A friendly readable list comes after sorting the output:
rpm -qa | sort | less
Quiry package status with rpm:
rpm -q make
Display information about the installed package:
rpm -qi make
List the files contained in the package:
rpm -ql make 
Which package owns a file? For example, command /bin/ls
rpm -qf /bin/ls

RPM dependencies:
rpm -qR make

If there is no package dependencies or the dependencies have already been resolved, then a package can be simply installed with command rpm from its file. Otherwise, use YUM.
Install package make from its rpm file:
rpm -ivh make-3.82-23.el7.x86_64.rpm 
It says the package is already installed. Try to remove package make by using command rpm:
 
rpm -e make
It won't go because openssl package depends on it.

Quiry a package file, for example:
rpm -qp make-3.82-23.el7.x86_64.rpm
rpm -qlp make-3.82-23.el7.x86_64.rpm
rpm -qip make-3.82-23.el7.x86_64.rpm
The second command above shows the files contained in the package file, and the third command displays the info about the package.
More info about command rpm can be found in the man pages:
 
man rpm




Take me to the Course Website