Dec 24, 2008

Subscribe to our feed

Subscribe
If you are new to this place then you can subscribe to our feeds to get updates on posts.

LINUX - How to create a local YUM repository

Hi Guys,


This is my first Post. I am really excited to talk about YUM which has solved all the problem in Linux for installing packages . The cool feature is that it takes care of all the dependencies.


Let me teach you how to configure YUM in Redhat 5 .Since in Redhat 5 you cannot directly use yum since we require licence.Imagine you forgot to install a package say for example perl what will you do?.It may not be simple just to download the package But think about its dependencies YUM may be configured with ftp http or local I will explain all.


First of all while installing redhat 5 please please make sure you install createrepo package ( very very important)


Let create a local yum repository with ftp service.


1:First create a folder name Server in /var/ftp/pub/

#mkdir -p /var/ftp/pub/Server

2: copy all the packages from the cd or dvd to /var/ftp/pub/Server

# cd /media/
 
# cd Packages

# cp -rf * /var/ftp/pub/Server

3: Once all the packages are copied in /var/ftp/pub/Server . We need to run this command
 
#cd /var/ftp/pub

#createrepo -v Server/

4: After running the command go into the folder Server/ .You will be able to see repodata folder

5: Go into to the folder and check whether four .xml files are created.
 
6: Great that is it your yum repository is ready .
 
7: Now just start the ftp service
 
# service vsftpd restart
 
8:Now we need to edit the Yum configuration file
 
#cd /etc/yum.repos.d
 
9:Now we will edit the file
 
# vi rheldebug.info
 
10: Please edit remove all the lines and make this entry
 
[rhel-server]
 
name=
 
baseurl=ftp://< youripaddress >/pub/Server
 
enable = 1
 
gpgcheck = 0
 
save this file
 
Now run this command
 
#yum clean all
 
Thats it now the yum server is ready
 
for http service
 
just add the packages in /var/www/html/Server
 
follow step 3
 
restart the httpd service
 
make an entry in vi /etc/yum.repos.d/rheldebug.info
 
here in baseurl://http:///html/Server
 
and for ordinary yum
 
make this entry in vi /etc/yum.repos.d/rheldebug.info
 
baseurl://file:///
 
eg baseurl://file:///var/ftp/pub/Server


Related Posts by Categories



0 comments: on "LINUX - How to create a local YUM repository"

Post a Comment