September 29, 2007

Creating a Private Repository In RHEL5 and installing Packages with yum

To create a private repositroy in RHEL5 the following package should be installed in your system.

Createrepo *.rpm file - To know the package is installed in your system or not ?
rpm –qa grep createrepo* (or) rpm-q createrepo
To install it : rpm –ivh createrepo*।rpm

rpm –qa grep yum* (or) rpm-q yum
To install it : rpm –ivh yum*.rpm (All Packages)


Run command createrepo –v /package/RPMS
(Put all your packages in /var/www/html/(Create Directory for RPM packages) and start your http server by executing the command service httpd start or chkconfig –level 12345 httpd on
Or
Put all your packages in var/ftp/pub/RPMS and start your ftp server with service vsftpd start or chkconfig –level 35 vsftpd on)

Ex:- createrepo –v /var/www/html/RPMS
Do
http://localhost/RPMS/ (firefox)

You have created a repoistory.

Configuring yum package manager

Create a file in /etc/yum।repos.d for your repository.

Enter the following infromation
[RHEL RPM Repositroy ]
Name = private
Baseurl= URL of RPM packages (http://localhost/RPMS)
Enabled=1
Gpgcheck=0 or 1 (local system 0 ) or (GNU Public license if gpgcheck is 1)

Test it with ...yum list anypackage
You can install your packages by typing ....yum install *anypackage*

No comments: