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
Linux 16 Useful Bandwidth Monitoring Tools to Analyze Network Usage in Linux
Viewed 15692 times since Mon, Sep 21, 2020
LVM: Reduce root PV/VG
Viewed 5374 times since Sat, Jun 2, 2018
RHEL: Displaying system info (firmware, serial numbers... )
Viewed 12280 times since Sun, May 27, 2018
YUM CRON RHEL7: Configure automatic updates.
Viewed 2111 times since Fri, Oct 26, 2018
A Quick and Practical Reference for tcpdump
Viewed 12671 times since Fri, Jul 27, 2018
Open SSL Encrypt & Decrypt Files With Password Using OpenSSL
Viewed 8655 times since Mon, Feb 18, 2019
Linux nslookup Command Examples for DNS Lookup
Viewed 9155 times since Sat, Sep 29, 2018
Inxi: Find System And Hardware Information On Linux
Viewed 2464 times since Sat, Jun 2, 2018
Check Detailed CPU Information In Linux With CoreFreq [Advanced]
Viewed 2561 times since Thu, Apr 18, 2019
Fałszujemy rozpoznania skanerów #1
Viewed 3194 times since Mon, May 21, 2018