search by tags

for the user

adventures into the land of the command line


the redhat package manager is a command line driven package management system capable of installing, uninstalling, verifying, querying, and updating software packages with the .rpm extension each rpm contains an archive of files along with information about the package like its version, a description, dependancies and instructions about where to put the files it contains RPM will keep track of installed versions of packages, but it will not resolve dependancies, and so if dependant packages are not present, the installation will fail some useful rpm commands display a list of all installed packages

$ rpm -qa
$ rpm -qa | grep something

display a list of recently installed packages

$ rpm -qa --last

find out what package a file belongs to

$ rpm -qf /bin/bash

find out what dependancies an rpm file has

$ rpm -qpR file.rpm

install a package

$ rpm -ivh somepackage_v1.rpm

upgrade a package

$ rpm -Uvh somepackage_v2.rpm

downgrade a package

$ rpm -Uvh --oldpackage somepackage_v1.rpm

erase a package

$ rpm -ev somepackage

a neat thing you can do with RPMs is the ability to rollback your system to RPMs that were installed by you on a specific date

as root user, check that RPM rollback has been setup here

$ vim /etc/rpm/macros

#check file contains
%_repackage_all_erasures 1

and here

$ vim /etc/yum.conf

#check file contains

after you’ve installed an rpm check that a copy of the RPM(s) you’ve installed exist in

$ ls -l /var/spool/repackage/

this is where RPM rollback will get the rpms to rollback with

to rollback an RPM

$ rpm -Uvh --rollback 'Month Day'

#example, if you want to rollback to RPMs from Mar 20th
$ rpm -Uvh --rollback 'March 20'

pretty neat