Package Managers

RPM Package Manager

The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages.

Each software package consists of an archive of files along with information about the package like its version, a description, and the like.

There is also a library API, permitting advanced developers to manage such transactions from programming languages such as C, Perl or Python.

RPM commands

Display the list of all the installed packages with name, version, release and architecure

rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"

Verify the integrity of an installed package

rpm -V <package-name>

# Example:

> rpm -V lvm2

S.5....T c /etc/lvm/lvm.conf

S.5....T c /etc/rc.d/init.d/lvm2-monitor

..5....T /lib/libdevmapper-event-lvm2mirror.so.2.02

S.5....T /sbin/lvm.static

.......T /usr/include/lvm2cmd.h

S.5....T /usr/lib/liblvm2cmd.a.2.02

S.5....T /usr/lib/liblvm2cmd.so.2.02

S.5....T /usr/sbin/lvm

S.5....T /usr/sbin/lvmdump

S.5....T d /usr/share/man/man5/lvm.conf.5.gz

S.5....T d /usr/share/man/man8/lvchange.8.gz

.......T d /usr/share/man/man8/lvconvert.8.gz

# Where:

#

# S File Size

# M File Mode (includes permissions and file type)

# 5 MD5 Checksum

# L Symbolic Link

# D Device (Major/Minor Numbers)

# U File Ownership

# G File Group

# T Modification Time

#

# c = configuration file

# d = documentation file

YUM Package Manager

The Yellowdog Updater (YUM) is an open-source command-line package-management utility for Linux operating systems using the RPM Package Manager.

Yum allows automatic updates, package and dependency management, on RPM-based distributions.

...

RedHat-specific Commands

Register a server by using the tool rhnreg_ks (RHN Classic)

rhnreg_ks --force --username <usr> --password <pwd>

rhnreg_ks --force --username <usr> --password <pwd> --proxy=http://<proxy_ip>:80

Register a server by using the new tool subscription-manager (RedHat Subscription Manager)

Eventually add the proxy settings in the configuration file /etc/rhsm/rhsm.conf

proxy_hostname = 192.16.2.248

proxy_port = 8080

than run the command subscription-manager repos --enable

# add the repository RHEL6 HA

subscription-manager repos --enable=rhel-ha-for-rhel-6-server-rpms

Execute the command subscription-manager list to show the subscriptions being consumed by this system

subscription-manager list --consumed

If you need to remove en entitlement (in the example RHEL6 FasTrack)

subscription-manager repos --disable=rhel-6-server-fastrack-rpms \

--disable=rhel-6-server-optional-fastrack-rpms