Friday, October 23, 2009

How to Configure YUM



Most of the beginners in Linux faces a big problem when they are deploying a package i.e.; dependency failure. To resolve this issue redhat introduced a technology called YUM.
YUM is a repository system contains information about packages and files inside every RPMs
Don’t worry about redhat repository .Create your own Yum repository in a local system and enjoy
Here we go

1. You must have all CDs used for Redhat installation
2. 3 GB partition formatted in ext3
3. Ftp service
4. Create repo package

Create a directory in / called yum

# mkdir /yum

Create one partition using fdisk with 3 gb size
After creating partition reboot the system or use partprob command to rebuild partition table

Format partition

# mkfs.ext3 /dev/sdX

Mount the newly created partition to /yum

# mount /dev/sdX /yum

Add the same to fstab for mounting at system startup

Mount your 1st CD to /mnt

# mount /dev/cdrom /mnt

Copy Server, Cluster, ClusterStorage, VT directories to /yum

# cp –ai /mnt/Server /yum
# cp –ai /mnt/Cluster /yum
# cp –ai /mnt/ClusterStorage /yum
# cp –ai /mnt/VT /yum

Unmount 1st CD and mount 2nd CD to /mnt

Umount /dev/cdrom
Insert 2nd CD

# mount /dev/cdrom /mnt

Copy all the contents from /mnt/Server directory to /yum/ Server
Copy all the contents from /mnt/Cluster directory to yum/Cluster
Copy all the contents from /mnt/ClusterStorage to /yum/ ClusterStorage
Copy all the contents from /mnt/VT directory to /yum/VT

# cp –ai /mnt/Server /* /yum/Server/
# cp –ai /mnt/Cluster /* /yum/ Cluster /
# cp –ai /mnt/ClusterStorage /* /yum/ ClusterStorage /
# cp –ai /mnt/VT /* /yum/ VT /


Copy /yum/Server/repodata/comp-rhel5-server-core.xml to /tmp
Copy /yum/Cluster/repodata/comp-rhel5-cluster.xml to /tmp
Copy /yum/ClusterStorage/repodata/comp-rhel5-cluster-st.xml to /tmp
Copy /yum/VT/repodata/comp-rhel5-vt.xml to /tmp

# cp /yum/Server/repodata/comp-rhel5-server-core.xml /tmp
# cp /yum/Cluster/repodata/comp-rhel5-cluster.xml /tmp
# cp /yum/ClusterStorage/repodata/comp-rhel5-cluster-st.xml /tmp
# cp /yum/VT/repodata/comp-rhel5-vt.xml /tmp


Remove /yum/Server/repodata directory
Remove /yum/ Cluster /repodata directory
Remove /yum/ ClusterStorage /repodata directory
Remove /yum/ VT /repodata directory

# rm –fr /yum/Server/repodata
# rm –fr /yum/ Cluster /repodata
# rm –fr /yum/ ClusterStorage /repodata
# rm –fr /yum/ VT /repodata

Create your group repository using createrepo

#createrepo -g /tmp/ comp-rhel5-server-core.xml /yum/Server/
#createrepo –g /tmp/ comp-rhel5-cluster.xml /yum/ Cluster
#createrepo –g /tmp/c omp-rhel5-cluster-st.xml/yum/ ClusterStorage
#createrepo –g /tmp/ comp-rhel5-vt.xml /yum/ VT

Create repodata file in /etc/yum.repos.d/
1. Copy rhel-debuginfo.repo as Server.repo to the same directory
2. Open Server.repo
3. And change the portions highlighted
-----------------------------------------------------------
[Server]
Name=Ansil’s repo
Baseurl=ftp://your ip/Server/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
-----------------------------------------------------------

Copy Server.repo as Cluster.repo, ClusterStorage.repo, and VT.repo to the same directory (/etc/yum.repos.d/)

Change filed in “[ ]” for each file and put Cluster, ClusterStorage.repo, and VT for Cluster.repo, ClusterStorage.repo, and VT.repo respectively

Now your YUM repository is ready


Also you have to configure Ftp service for accessing this repository from outside

Open /etc/vsftpd/vsftpd.conf

1. Check line
anonymous_enable=YES
is uncommented

2. Add
anon_root=/yum
at the end of file

Restart Ftp service
# service vsftpd restart
# chkconfig –level 35 vsftpd on

ALL… DONE…!!!!!

Go to Application->Add/Remove Software

1 comment:

LVM thin provisioning - file system usage and pool usage dosn't match

When I was demonstrating LVM thin provisioning to new batch of campus hires ; they pointed out an important mismatch between thin pool usag...