Create local repository for easy package installation in lack of internet

Sometimes after partial OS installation, when you need to install more packages, you do by yum command using online OS repository which is great. But under some installations when there is no internet available installing Packages from CD becomes hell. The most of the time is spent installing / searching dependencies. Well all these problems can be sorted by creating local repository and you can install packages by using yum and all your dependencies will be taken care.

 

CREATE LOCAL REPOSITORY

1. Copy all the Pakages (.rpm) from installation medium to local system e.g. /packages

2. Make sure you have createrepo command. if it is not there. install it using
“rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm”

4. run command “createrepo /packages”

5. create a file under /etc/yum.repos.d/ directory with any name say suresh.repo and add the following content in the file

[suresh]
name=Fedora Core $releasever - My Local Repo
baseurl=file:///packages/
enabled=1
gpgcheck=0
#gpgkey=file:///path/to/you/RPM-GPG-KEY

 

That’s all! Now you can install your packages using yum install <package-name>

Leave a Comment

Your email address will not be published.