Automation Installation Process of RHEL packages via yum

文/一觉亮天

 

Yum is a tool of RHEL for automating installation process of packages. As we all know, we can install packages using rpm command. But many rpm packages depend on other packages, and the depended packages may also depend on others. If it is up to the user to resolve the dependencies, it is a painful job. Fortunately there is yum.

 

If your RHEL release can get formal support of Red Hat, i.e. if you get a code to connect to Redhat Network, you can install any package via just “yum install package-name”. If you don’t, or if you don’t have an internet connection but you have a list of rpms locally, you can build your own yum packages repository.

 

The steps for building yum repository

 

Step1 createrepo

Yum repository can be provided via HTTP, FTP, or local file system. Say your rpms are put in /root/rpmpackages directory. You need first create repository descriptions of these rpms. Use the command followed,

 

createrepo /root/rpmpackages

 

Step2 put your repository into use

Yum’s config file is /etc/yum.conf. You can change /etc/yum.conf/gpgcheck to 0 for omitting the steps to check rightness of packages. Repository description files go into /etc/yum.repos.d/.

 

Repository description file is a file with “.repo” extention. An example “.repo” file followed. The key field in the “.repo” file is “baseurl”. It indicates the location of the repository. The urls can be http or ftp and so on. The “enabled” field indicates whether the repository is put into use.

 

Usually we get a RHEL CD disk. There are rpm packages in it. In the example file followed, I also add repository of the standard RHEL CD disk, because we often need to get dependency packages from it. (Take CD disk RHEL5.5 as example.)

 

#example.repo

[repo-name-specify-as-you-like]

name=description

baseurl=file:///root/rpmpackages

enabled=1

 

[rhel-svr]

name=rhel-svr

baseurl=file:///mnt/cdrom/Server

enabled=1

gpgcheck=0

 

[rhel-vt]

name=rhel-vt

baseurl=file:///mnt/cdrom/VT

enabled=1

gpgcheck=0

 

[rhel-clstr]

name=rhel-clstr

baseurl=file:///mnt/cdrom/Cluster

enabled=1

gpgcheck=0

 

[rhel-cs]

name=rhel-cs

baseurl=file:///mnt/cdrom/ClusterStorage

enabled=1

gpgcheck=0

 

Use yum to install packages

You can use yum to install packages through “yum install package-name”.

You can use yum to install a group of packages, too. Use “yum grouplist” to get the predefined groups in the current repositories. Use “yum groupinstall” to install a cluster of packages. How to make a installation group is beyond the scope of the article.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值