It is used to installed software’s, security updates and some OS recommended fixes often in multiple systems in local environment. It's very fast downloaded process compared with direct method, because local repository connected over the fast LAN, so that we will save our Internet Bandwidth usage.
Server Details
Hostname: server.local
IP Address: 192.168.1.5
Hostname: server.local
IP Address: 192.168.1.5
Client Details
Hostname: client.local
IP Address: 192.168.1.6
Hostname: client.local
IP Address: 192.168.1.6
Add the below lines in both server and client host entries.
192.168.1.5 server.local server
192.168.1.6 client.local client
192.168.1.6 client.local client
Disable the firewalls in both server and client end.
Step 1: Copy the installation source from CentOS DVD
First mount the CentOS DVD into /mnt directory.
[root@server ~]# mount /dev/srv /mnt/
[root@server ~]# cd /mnt/Packages/
[root@server Packages]# mkdir -p /var/ftp/pub/Server
[root@server Packages]# cp *.* /var/ftp/pub/Server/
Step 2: Install Prerequisites RPM Packages
Now install vsftpd package
[root@server ~]# cd /mnt/Packages/
[root@server Packages]# rpm -ivh vsftpd-2.2.2-11.el6_3.1.i686.rpm
[root@server Packages]# /etc/init.d/vsftpd start
[root@server Packages]# chkconfig vsftpd on
Install createrepo package, for that we need some dependency packages
[root@server Packages]# rpm -ivh libxml2-python-2.7.6-8.el6_3.4.i686.rpm
[root@server Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm
[root@server Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
Install createrepo package
[root@server Packages]# rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
Step 3: Create local repository file
[root@server ~]# vi /etc/yum.repos.d/centlocal.repo
[centlocal]
name=Local YUM Repository
baseurl=file:///var/ftp/pub/Server
gpgcheck=0
enabled=1
Step 4: Build the local repository
[root@server ~]# createrepo -v /var/ftp/pub/Server/
After local repository created, rename the existing repository files under /etc/yum.repos.d/ directory
Now check yum repository is working fine or not.
[root@server ~]# yum clean all
[root@server ~]# yum list all
Step 5: Client end setup
Create repository file under /etc/yum.repos.d/ directory
[root@client ~]# vi /etc/yum.repos.d/centlocal.repo
[centlocal]
name=Local YUM Repository
baseurl=ftp://192.168.1.5/pub/Server
gpgcheck=0
enabled=1
Client end also we need to rename existing repository files under /etc/yum.repos.d/ directory to avoid any conflicts.
Check whether local repository is working from client end
[root@client ~]# yum clean all
[root@client ~]# yum list all
[root@client ~]# yum install screen
Now we are able to install packages from our server local repository.
No comments:
Post a Comment