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).

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
HowTo: Kill TCP Connections in CLOSE_WAIT State
Viewed 15991 times since Thu, Feb 14, 2019
Szybkie sprawdzenie zewnętrznego adresu IP i hosta
Viewed 3451 times since Thu, May 24, 2018
List of 10 Must Know Oracle Database Parameters for Database Administrator
Viewed 130002 times since Thu, Jun 21, 2018
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 5742 times since Sun, Jan 9, 2022
Odpalenie polecenia tylko na jedną godzinę
Viewed 2908 times since Thu, May 24, 2018
Fix rpmdb: Thread died in Berkeley DB library
Viewed 21195 times since Fri, Feb 14, 2020
IPTABLES linux
Viewed 17166 times since Sat, Jun 2, 2018
Red Hat Enterprise Linux - Allow Root Login From a Specific IP Address Only
Viewed 2897 times since Wed, Oct 3, 2018
LOGROTATE – ARCHIWIAZACJA LOGÓW
Viewed 2085 times since Fri, Nov 30, 2018
RHEL: Getting/Setting hardware clock’s time
Viewed 3141 times since Sat, Jun 2, 2018