One of the main sys admin tasks is to install, update, uninstall software from operating system.
In order to update your RHEL5 system you need to choose one of the following methods :
- Red Hat Network Server from http://rhn.redhat.com (RHN),
- Red Hat Network Proxy Server (RHN Proxy),
- Red Hat Network Satellite Sever (RHN satellite)
Each of mentioned above methods work great and it is up to you to choose exact one.
RHN
Stands for Red Hat Network Server. You must have valid licence agreement with red hat in order to get updates and manage your systems through that page. What it basically does is it allows sys admin to administer updating, removing, installing packages in numerous systems from on place on the internet.
If you want to test it, you can register on the http://rhn.redhat.com, download RHEL5 30 days trial version and install it freely on you hardware or some virtualization platform (e.g. VBOX,VMWARE, etc.).
Then you can register your machine in the following way :
1.
chkconfig --list rhnsd2.
vi /etc/sysconfig/rhn/rhnsd3.
rhn_registerchkconfig --list rhnsd
In order to comunicate with RHN you need rhnsd daemon active on you system.
By using this command you check the status of this daemon. When you perfomed standard RHEL5 installation it is already configured and started by default.
If for some reason it is't, you have to enable it, assuming your runlevel is 3 it looks like this :
chkconfig --level 3 rhnsd onvi /etc/sysconfig/rhn/rhnsd
By default rhnsd daemon checks for updates in 240 ms intervals, if you want to change this value of variable from INTERVAL=240 to whatever you like :
vi /etc/sysconfig/rhn/rhnsdrhn_register
It is is a client program that registers your system with Red Hat Network
(or a Red Hat Network Satellite). After registering, your system can recieve soft-
ware updates, install new software, and remotely manage your system.
RHN allows you to register and push updates onto your systems as they appear in RHN. I allows you to do even more cause, from one place you can administer installation, uninstallation of packages for you systems.
It has also disadvantages like this that RHN have all hardware and software info about you RHEL5 installation and that machine must have access to internet in order to be visible in RHN.
If you system doen't have internet access or you don't want RHN to register all your installation info you should take into account use of RHN Proxy Server or RHN Satellite Server products.
RHN Proxy
Red Hat Network Proxy Server allows you to download packages to your local server and then instruct RHEL machines to use this servers repository of packages instead of repository from internet.
The simplest implementation of RHN Proxy is illustrated on hte picture below.
More basic info can be read here.
Technical details about implementing this solution can be read here.
RHN Satellite
Red Hat Network Satellite Server has the same functionalities as RHN Server but instead of being hosted by Red Hat on the internet it it hosted by you on your infratstructure typically in DMZ.
The same as RHN Proxy it requires special peace of software to run.
Basic info can be read here.
Technical info can be read here and here.
Now it is time to describe update clients in RHEL5. There are two :
- RPM
- YUM
RPM
Red Hat Package Manager is the main utility in RHEL to manage software. It allows :
- installation
- removal
- update
- check installation
- provide info about software
- find for software packages
Very useful information can be found here, I know that it comes from fedora but it is the same in RHEL.
I learned chapters 1-7, other ones are for advanced RPM usage and are irrelevant unless you are developer and want to prepare RPM packages.
Below are the most basic rpm commands used in day-to-day system administration :
List all installed packages :
rpm -qaList location and name of configuration file related particular package :
rpm -qc minicom-2.1-3List locations of documentation file related particular package :
rpm -qd minicom-2.1-3Listing files in a package from RPM database
rpm -ql minicom-2.1-3Display information about package from RPM database :
rpm -qi minicom-2.1-3Display information about package from RPM file :
rpm -qpi minicom-2.1-3.i386.rpmDisplay package name which contains a specified file name :
rpm -qf /bin/shInstall a package :
rpm -i minicom-2.1-3.i386.rpmUpdate a package :
rpm -U minicom-2.1-3.i386.rpmRemove a package :
rpm -e minicom-2.1-3Verify installed package for errors :
rpm -V minicom-2.1-3Verify entire system :
rpm -VaYUM
Yellow Dog Update Modifier does the same as RPM but have on advantage, it allows to install in one step dependencies. This operation is performed as a transaction so all or nothing is performed when there are some relations between packages.
It is the recommended tool for sys admins in order to deal with package management.
Usefull info can be found here.
If you wanted to use RPM to install packages you would face "dependency hell".
Some typical usage scenarios of YUM :
Check whether are some updates for your system :
yum check-updateApply/Install updates :
yum updateInstall package from RPM file :
yum install minicom-2.1-3.i386.rpmInstall a package from configured repositories :
yum install minicom.i386Remove a installed package
yum remove minicom.i386List all installed packages :
yum list installedList all packages : installed, available from repo :
yum list allSearches for which packages provide the requested dependency of file. This also takes wildcards for files :
yum provides MTALists any installed package which no longer appears in any of your enabled repositories. Useful for finding packages which linger between upgrades or things installed not from a repo :
yum list extrasLists any obsoleting relationships between any available package and any installed package :
yum list obsoletesLists any package in an enabled repository which is an update for any installed package
yum list updatesLists any package added to any enabled repository in the last seven(7) days
yum list recentDisplay info about installed package
yum info minicom.i386PACKAGE DEPENDENCIES
There are four dependencies in RHEL that system tracks :
- requires ---> which tracks the capabilities a package requires
- provides ---> which tracks the capabilities a package provides for other packages
- obsoletes ---> which describes the capabilities that if installed, conflict with capabilities in a package
- conflicts ---> which describes the capabilities that this package will make obsolete
You can check package dependencies by using, the rpm command :
Checking for requires capabilities :
rpm -qp --requires sendmail-8.12.5-7.i386.rpmChecking for provides capabilities :
rpm -q --provides tcshChecking for conflicts capabilities :
rpm -q --conflicts httpdChecking for obsoletes capabilities :
rpm -q --obsoletes httpd