SYS: Configure a local repository. local repo

SYS: Configure a local repository.

Share this link

 

Create a directory where packages will be stored:

# mkdir /repo

Two options: mount the distribution DVD or copy it into /repo.
To mount the DVD, edit the /etc/fstab file and add the following line:

/dev/cdrom /repo iso9660 loop 0 0

Then, mount the DVD:

# mount -a

To copy the DVD, type:

# mount -o loop /dev/cdrom /mnt
# cd /mnt
# tar cvf - . | (cd /repo; tar xvf -)
# cd /; umount /mnt

Optionally, update the repository structure (if new packages have been added):

# yum install -y createrepo
# createrepo /repo

Create the /etc/yum.repos.d/local.repo file and add the following lines:

[repo]
name=Repo - Base
Baseurl=file:///repo
enabled=1

Note: If you don’t remember the syntax, read the yum.conf man page.

Clean up the yum cache:

# yum clean all

Additional Resources

RedHat provides an video about Creating a Local Repository and Sharing With Offline Systems (8min, 2018).

Posted - Mon, Oct 29, 2018 11:31 PM. This article has been viewed 10546 times.
Online URL: http://kb.ictbanking.net/article.php?id=430

Powered by PHPKB (Knowledge Base Software)