18 Mart 2014 Salı
Create local and http yum repositories (rhel6.3)
Purpose: Creating http based yum repo so that other servers on the local network can communicate with that and extract RPMs from it
1. Copy the content of the rhel 6.3 dvd into hard drive of the server . (I copy all its content on to directory /opt/yumrepository/rhel63 )
# find /opt/yumrepository/rhel63 -name *.rpm | wc -l
2. change the working directory to /opt/yumrepository/rhel63/Packages and install the following rpms
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm
3. To create the metadata we run createrepo . in the repo directory (/opt/yumrepository )
[root@yum1 yumrepository]# createrepo .
1341/3653 - rh63/Packages/libconfig-1.3.2-1.1.el6.i686.rpm
iso-8859-1 encoding on Ville Skyttä <ville.skytta@iki.fi> - 2.8.2-2
3653/3653 - rh63/Packages/gnome-media-libs-2.29.91-6.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@yum1 yumrepository]# ls
repodata rh63
[root@yum1 yumrepository]#
4. Configure yum to communicate with the metadata
[root@yum1 repodata]# cd /etc/yum.repos.d/
Create the repo ; rh63.repo
[root@yum1 yum.repos.d]# vi rh63.repo
and add the following content then save it
[rh63]
gpgcheck=1
name=rh63.repo
baseurl=file:///opt/yumrepository
5. The repository is GPG Signed (gpgcheck=1) , therefore install GPG key came with RHEL DVD
[root@yum1 rh63]# rpm --import /opt/yumrepository/rh63/RPM-GPG-KEY-redhat-release /opt/yumrepository/rh63/RPM-GPG-KEY-redhat-beta
6. Check it is working or not
[root@yum1 yum.repos.d]# yum list gcc.x86_64
Loaded plugins: product-id, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Available Packages
gcc.x86_64 4.4.6-4.el6 rh63
[root@yum1 yum.repos.d]#
6. To create HTTP based YUM repository ; the repository server will serve via apache httpd , so install it
[root@yum1 rh63]# yum install httpd
[root@yum1 rh63]# chkconfig httpd on
[root@yum1 rh63]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for yum1
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
[root@yum1 rh63]#
7. Configure Apache to serve data
[root@yum1 rh63]# cd /etc/httpd/conf.d/
[root@yum1 conf.d]# vi yumrepository.conf
Add the Alias
Alias /yumrepository/ "/opt/yumrepository/"
8.
[root@yum1 ~]# service httpd reload
Reloading httpd:
[root@yum1 ~]#
9.
[root@yum1 ~]# yum install lynx.x86_64
10. Check with lynx
[root@yum1 ~]# lynx http://localhost/yumrepository/repodata/repomd.xml
11. Disable file based repo using parameter enabled=0 in order to activate web based repo
[root@yum1 ~]# vi /etc/yum.repos.d/rh63.repo
[root@yum1 ~]# cat /etc/yum.repos.d/rh63.repo
[rh63]
enabled=0
gpgcheck=1
name=rh63.repo
baseurl=file:///opt/yumrepository
[root@yum1 ~]#
12. Create new HTTP repo
[root@yum1 ~]# vi /etc/yum.repos.d/rh63web.repo
add
[rh63web]
gpgcheck=1
name=rh63web.repo
baseurl=http://localhost/yumrepository/
[root@yum1 ~]# cat /etc/yum.repos.d/rh63web.repo
[rh63web]
gpgcheck=1
name=rh63web.repo
baseurl=http://localhost/yumrepository/
13.
[root@yum1 ~]# yum clean all
Loaded plugins: product-id, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning repos: rh63web
Cleaning up Everything
[root@yum1 ~]#
14.
[root@yum1 ~]# yum repolist all
Loaded plugins: product-id, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rh63web | 1.3 kB 00:00
rh63web/primary | 1.7 MB 00:00
rh63web 3653/3653
repo id repo name status
rh63 rh63.repo disabled
rh63web rh63web.repo enabled: 3,653
rhel-source Red Hat Enterprise Linux 6Server - x86_64 - Source disabled
rhel-source-beta Red Hat Enterprise Linux 6Server Beta - x86_64 - Source disabled
repolist: 3,653
[root@yum1 ~]#
15. Go to another machine on the local network and check
[root@was2 yum.repos.d]# cd /etc/yum.repos.d/
Create the repo ;
[root@was2 yum.repos.d]# vi rh63web.repo
change localhost with 192.168.2.17 which is the ip of the http based yum repository server
Add this content ;
[rh63web]
gpgcheck=1
name=rh63web.repo
baseurl=http://192.168.2.17/yumrepository/
enabled=1
16.
[root@was2 yum.repos.d]# yum list gcc*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rh63web | 1.3 kB 00:00
rh63web/primary | 1.7 MB 00:00
rh63web 3653/3653
Available Packages
gcc.x86_64 4.4.6-4.el6 rh63web
gcc-c++.x86_64 4.4.6-4.el6 rh63web
gcc-gfortran.x86_64 4.4.6-4.el6 rh63web
gcc-gnat.x86_64 4.4.6-4.el6 rh63web
gcc-java.x86_64 4.4.6-4.el6 rh63web
gcc-objc.x86_64 4.4.6-4.el6 rh63web
gcc-objc++.x86_64 4.4.6-4.el6 rh63web
[root@was2 yum.repos.d]#
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder