Вы находитесь на странице: 1из 5

1.What is yum?

Yum or Yellow dog Update, Modified is a package manager that was developed by Duke University to
improve the installation of RPMs.
Yum searches numerous repositories for packages and their dependencies so they may be installed
together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5 uses Yum to fetch
packages and install RPMs.
Yum uses a configuration file at /etc/yum.conf. Also refer yum(8) man page for more information.
There are multiple ways by which you can install a repository on the system
and install/update packages :
 Add an existing repository.

 Setup a new repository having packages populated from ISO's downloaded from RHN.

 Register the system on RHN and subscribed to the channels depending on the subscription you have.

If you wish to add a new yum repository to the system refer - How can I add a new yum repository as a
source to install software?
If you wish to install a repository and fetch updates from DVD ISO image, you can refer - How do I setup
a yum or up2date repository to use a locally mounted DVD with Red Hat Enterprise Linux 4 and 5?
If you want to register your system on RHN you can refer-How do I access Red Hat Network (RHN) to
download software, updates, and security errata?
To access the repositories from Red Hat Network (RHN) to which you are entitled to - you need to
register the system on RHN and subscribe to the required channels. Please consult the RHN FAQ list, for
more information about registering with RHN, subscribing systems and other common questions around
RHN.

2.How do I use it?

Yum must be running as root. Here are some useful commands:


1) Install a package:
# yum install package

Example:

# yum install httpd

2) Remove a package:
# yum remove package

Example:

# yum remove httpd

3) Update a package:
# yum update package

Example:

# yum update httpd

4) Search for a package:


# yum search package

Example:

# yum search httpd

5) Find information about a package:


# yum info package

Example:

# yum info httpd

6) List packages containing a certain term:


# yum list term

Example:

# yum list httpd

7) Find what package provides a particular file:


# yum whatprovides 'path/filename'

Example:

# yum whatprovides 'etc/httpd.conf'

# yum whatprovides '*/libXp.so.6'

8) Update all installed packages with kernel package :


# yum update

Example:

# yum update

9) To update a specific package:


# yum update

Example:

# yum update openssh-server


RHEL 6 YUM Server and Client Configuration
Yum server IP = 192.168.1.100
Yum server hostname = server1.example.com

Should be flush the iptables and restart the network service

iptables -L
iptables -F
service iptables save
service iptables restart

service network restart

Step 1: Insert the RHEL 6 CD

[root@server Desktop]# cd /media/RHEL_6.1\ x86_64\ Disc\ 1/Packages/

Yum server required packages

[root@server Packages]# rpm -ivh vsftpd*


[root@server Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
[root@server Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
[root@server Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm

Step 2: Check the installed packages

[root@server1 Desktop]# rpm -qa vsftp*


vsftpd-2.2.2-6.el6_0.1.x86_64

[root@server1 Desktop]# rpm -qa deltarpm*


deltarpm-3.5-0.5.20090913git.el6.x86_64

[root@server1 Desktop]# rpm -qa python-deltarpm*


python-deltarpm-3.5-0.5.20090913git.el6.x86_64

[root@server1 Desktop]# rpm -qa createrepo*


createrepo-0.9.8-4.el6.noarch
Step 3 : FTP service start

[root@server Packages]# service vsftpd status

[root@server Packages]# service vsftpd start

[root@server Packages]# service vsftpd status


[root@server Packages]# chkconfig vsftpd on

Step 4: Copy the rhel6 dvd content

[root@server Packages]# cd

[root@server ~]# cp -rf /media/RHEL_6.1\ x86_64\ Disc\ 1/ /var/ftp/pub/

[root@server ~]# cd /var/ftp/pub/


[root@server pub]# ls
RHEL_6.1 x86_64 Disc 1

[root@server pub]# mv RHEL_6.1\ x86_64\ Disc\ 1/ rhel6.1

[root@server pub]# ls
rhel6.1

Step 5: Single mode installation createrepo

[root@server ~]# createrepo -v /var/ftp/pub/

[root@server ~]# cd /var/ftp/pub/

[root@server pub]# ls
repodata rhel6.1

Step 6: Group installation createrepo

[root@server repodata]# cp –rf


/var/ftp/pub/rhel6.1/repodata/5819e9580b5a81a9eec9e2c6e91fc9992a7ccadaa3bcd5ecb2e87a8669eefcec-comps-
rhel6-Server.xml /var/ftp/pub/repodata/

[root@server ~]# createrepo -g


/var/ftp/pub/repodata/5819e9580b5a81a9eec9e2c6e91fc9992a7ccadaa3bcd5ecb2e87a8669eefcec-comps-rhel6-
Server.xml /var/ftp/pub/

Step 7 : Create the repo file.

[root@server ~]# vim /etc/yum.repos.d/server.repo


[server]
name=rhel6.1 yum server 64bit
baseurl=file:///var/ftp/pub
enabled=1
gpgcheck=0
[root@server ~]# yum clean all
[root@server ~]# yum makecache
[root@server ~]# yum list all
[root@server ~]# yum grouplist

----------------------------------------------------------------------------------------------------------------------------

Yum client repo configuring

Yum client IP = 192.168.1.101


Yum client hostname = client1.example.com

[root@client~]# vim /etc/yum.repos.d/client.repo


[client]
name=rhel6.1 yum client 64bit
baseurl=ftp://192.168.1.100/pub
enabled=1
gpgcheck=0

[root@client~]# yum clean all


[root@server ~]# yum makecahe
[root@client~]# yum list all
[root@server ~]# yum grouplist

Вам также может понравиться