Creating an Offline YUM repository for LAN
Last updated on March 12th, 2018 at 07:39 pm
In our earlier tutorial, we discussed “How we can create our own yum repository with ISO image & by mirroring an online yum repository”. Creating your own yum repository is a good idea but not ideal if you are only using 2-3 Linux machines on your network. But it definitely has advantages when you have large number of Linux servers on your network that are updated regularly or when you have some sensitive Linux machines that can’t be exposed to Internet directly.
When we have large number of Linux systems & each system is updating directly from internet, data consumed will be enormous. In order to save the data, we can create an offline yum & share it over our Local network. Other Linux machines on network will then fetch system updates directly from this Local yum, thus saving data & also transfer speed also be very good since we will be on our local network.
We can share our yum repository using any of the following or both methods:
- Using Web Server (Apache)
- Using ftp (VSFTPD)
We will be discussing both of these methods but before we start, you should create a YUM repository using my earlier tutorial (READ HERE)
Using Web Server
Firstly we need to install web-server (Apache) on our yum server which has IP address 192.168.1.100. Since we have already configured a yum repository for this system, we will install apache web server using yum command,
Next, we need to copy all the rpm packages to default apache root directory i.e. /var/www/html or since we have already copied our packages to /YUM, we can create a symbolic link from /var/www/html to /YUM
Restart you web-server to implement changes
Configuring client machine
Configurations for sharing Yum repository on server side are complete & now we will configure our client machine, with an IP address 192.168.1.101, to receive updates from our created offline yum.
Create a file named offline-yum.repo in /etc/yum.repos.d folder & enter the following details,
We have configured your Linux machine to receive updates over LAN from your offline yum repository. To confirm if the repository is working fine, try to install/update packages using yum command.
Using FTP server
For sharing our YUM over ftp, we will firstly install the required package i.e vsftpd
Default root directory for vsftp is /var/ftp/pub, so either copy rpm packages to this folder or create a symbolic link from /var/ftp/pub,
Now, restart server for implement the changes
Configuring client machine
We will now create a file named offline-yum.repo in /etc/yum.repos.d , as we did above & enter the following details,
Your client machine is now ready to receive updates over ftp. For configuring vsftpd server to share files with other Linux system , read tutorial here.
Both methods for sharing an offline yum over LAN are good & you can choose either of them, both of these methods should work fine. If you are having any queries/comments, please share them in the comment box down below.