[root@apple ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
[root@apple ~]#
Yum will look for remote repository information on the files stored in /etc/yum.repos.d/ . A sample file here.
[base]
name=CentOS-$releasever – Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
Yum commands:
Yum has wide range of commands to install, update, check-update, list packages etc. Here let us see some important ones.
1) yum check-update : This returns list of packages that requires update on your machine.q
[root@apple ~]# yum check-update
Loading “fastestmirror” plugin
Loading mirror speeds from cached hostfile
* rpmforge: ftp-stud.fht-esslingen.de
agg.x86_64 2.5-1.el5.rf rpmforge
cadaver.x86_64 0.22.5-1.el5.rf rpmforge
firefox.x86_64 3.0.5-1.el5.centos updates
firefox.i386 3.0.5-1.el5.centos updates
iso-codes.noarch 1.0a-1.el5.rf rpmforge
lftp.x86_64 3.7.6-1.el5.rf rpmforge
libwpd.x86_64 0.8.14-1.el5.rf rpmforge
mtr.x86_64 2:0.75-1.el5.rf rpmforge
nmap.x86_64 2:4.20-1.el5.rf rpmforge
2) yum list : List all packages installed on your machine as well as the packages available in your repository.
[root@apple ~]# yum list
Loading “fastestmirror” plugin
Loading mirror speeds from cached hostfile
* rpmforge: fr2.rpmfind.net
Installed Packages
Deployment_Guide-en-US.noarch 5.2-11.el5.centos installed
GConf2.i386 2.14.0-9.el5 installed
3) yum update : This updates the whole machine or a package on the system. To update a package, pass argument to yum update [ ex : yum update spamassassin ]
4) yum install : To install a package, use this command. If you use “-y” option with yum update or yum install, that supresses all user input.
[root@apple ~]# yum install tomcat5
Loading “fastestmirror” plugin
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
tomcat5 x86_64 5.5.el5_2.1 updates 358 k
Installing for dependencies:
ant x86_64 1.6.5-2jpp.2 base 2.3 M
axis x86_64 1.2.1-2jpp.6 base 3.6 M
5) yum info : This is used to list a description and summary information about installed & available packages
[root@apple ~]# yum info NetworkManager-gnome
Loading “fastestmirror” plugin
Loading mirror speeds from cached hostfile
* rpmforge: fr2.rpmfind.net
Installed Packages
Name : NetworkManager-gnome
Arch : x86_64
Epoch : 1
Version: 0.6.4
Release: 8.el5
Size : 415 k
Repo : installed
Summary: GNOME applications for use with NetworkManager
Description:
This package contains GNOME utilities and applications for use with
NetworkManager, including a panel applet for wireless networks.