About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Wednesday, October 30, 2013

YUM CONFIGURATION & INSTALLATION ON REDHAT LINUX

YUM CONFIGURATION & INSTALLATION ON REDHAT LINUX

Requirements:
1. Need to copy all linux rpm packages in one directory (if you have ftp/httpd then copy /var/www/html or /var/ftp/pub direcotry, also you can keep anywhere in your linux box but you can't use this server for other linux clients for yum installation...)

2. Need to install createrepo rpm on server side...

3. yum packages (This package will installed default)

Copy All RPM to your linux location:
keep RHEL DVD in dvd rom and copy /Server directory to your selected location, In my server its running httpd service and vsftpd service so I am keep all copied file under httpd location /var/www/html/yumpack/

[root@proxy1 RHEL5]# cp -R Server/ /var/www/html/yumpack/
[root@proxy1 RHEL5]#
[root@proxy1 Server]# pwd
/var/www/html/yumpack/Server
[root@proxy1 Server]#

Installation of createrepo rpm:
[root@proxy1 Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@proxy1 Server]#

Copy comps-rhel5-server-core.xml file to /var/www/html/yumpack/Server location from /var/www/html/yumpack/Server/repodata/

[root@proxy1 Server]# cd repodata/
[root@proxy1 repodata]# ls -ltr
total 10144
-rw-r--r-- 1 root root    1139 Oct 29 17:33 TRANS.TBL
-rw-r--r-- 1 root root 1010906 Oct 29 17:33 comps-rhel5-server-core.xml
-rw-r--r-- 1 root root 2400291 Oct 29 17:33 filelists.xml.gz
-rw-r--r-- 1 root root    1314 Oct 29 17:33 repomd.xml
-rw-r--r-- 1 root root  733418 Oct 29 17:33 primary.xml.gz
-rw-r--r-- 1 root root 6199888 Oct 29 17:33 other.xml.gz
[root@proxy1 repodata]#

[root@proxy1 repodata]# cp comps-rhel5-server-core.xml /var/www/html/yumpack/Server/
[root@proxy1 repodata]# cd ..
[root@proxy1 Server]#

[root@proxy1 Server]# ls -ltr |grep comp
-rw-r--r-- 1 root root    79270 Oct 29 17:33 compat-dapl-utils-2.0.13-4.el5.i386.rpm
-rw-r--r-- 1 root root  1010906 Oct 29 17:43 comps-rhel5-server-core.xml
[root@proxy1 Server]#

compat-dapl-utils-2.0.13-4.el5.i386.rpm this file content all rpm updates, that we have to update with group with that directory, follow below steps...
[root@proxy1 Server]# createrepo -vg comps-rhel5-server-core.xml /var/www/html/yumpack/Server/
1/2255
...
2254/2255 - esc-1.0.0-39.el5.i386.rpm
2255/2255 - xml-common-0.6.3-18.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@proxy1 Server]#

In this file updation it will update all /Server rpm packs, see above it has updated 2255/2255 packages

Modify /etc/yum.repos.d/rhel-debuginfo.repo file (This steps you can do in server as well as in client machine)
[root@proxy1 Server]# cd /etc/yum.repos.d/
[root@proxy1 yum.repos.d]#
Keep original file copy for your safety purpose
[root@proxy1 yum.repos.d]# ls -ltr
total 8
-rw-r--r-- 1 root root 254 Dec 16  2008 rhel-debuginfo.repo
[root@proxy1 yum.repos.d]# cp rhel-debuginfo.repo rhel-debuginfo.repo.org
[root@proxy1 yum.repos.d]#

[root@proxy1 yum.repos.d]# vi rhel-debuginfo.repo
[my_Server]
name=my_Yum_Server
baseurl=http://172.16.4.205:9542/yumpack/Server/
enabled=1
gpgcheck=0

###clear yum cache### (This step need to do only in server side)

[root@proxy1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@proxy1 yum.repos.d]#

###update the yum####  (This step need to do only in server side)
[root@proxy1 yum.repos.d]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
my_Server                                                                                                        | 1.1 kB    
00:00    
primary.xml.gz                                                                                                         | 791
kB     00:00    
my_Server                                                2255/2255
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
[root@proxy1 yum.repos.d]#

###Test Yum Working or not (This step you can check with Server or client [if client /etc/yum.repos.d/rhel-debuginfo.repo modified])

[root@proxy1 ~]# yum install nfs-utils
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.i386 1:1.0.9-40.el5 set to be updated
--> Processing Dependency: nfs-utils-lib >= 1.0.8-2 for package: nfs-utils
--> Processing Dependency: librpcsecgss.so.2 for package: nfs-utils
--> Processing Dependency: libnfsidmap.so.0 for package: nfs-utils
--> Running transaction check
---> Package nfs-utils-lib.i386 0:1.0.8-7.2.z2 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package                            Arch                      Version                              Repository                
           Size
=============================================================================================================================
Installing:
 nfs-utils                          i386                      1:1.0.9-40.el5                       my_Server                 
    380 k
Installing for dependencies:
 nfs-utils-lib                      i386                      1.0.8-7.2.z2                         my_Server                 
     55 k
Transaction Summary
=============================================================================================================================
Install      2 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)        
Total download size: 434 k
Is this ok [y/N]: yes
Downloading Packages:
(1/2): nfs-utils-lib-1.0.8-7.2.z2.i386.rpm                                                                             |  55
kB     00:00    
(2/2): nfs-utils-1.0.9-40.el5.i386.rpm                                                                                 | 380
kB     00:00    
----------------------------------------------------------------------------------------------------------------------------
Total                                                                                                         3.7 MB/s | 434
kB     00:00    
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nfs-utils-lib                                     [1/2]
  Installing     : nfs-utils                                         [2/2]
Installed: nfs-utils.i386 1:1.0.9-40.el5
Dependency Installed: nfs-utils-lib.i386 0:1.0.8-7.2.z2
Complete!
[root@proxy1 ~]#

Thanks and Regards,
Sandeep CC

No comments:

Post a Comment