In this post, i will share on how to update and install the RPM packages from CD-ROM/DVD-ROM image on CentOS 6.2. This will very useful when you are running on slow internet connection. Instead of go through the internet connection, it is possible to use Local CD/DVD-ROM as your yum repository. There are two methods to install and configure local CentOS 6.2 yum repository. Both methods have been tested and working on CentOS 6.2 linux server. You can select any method that you most preferred. This may be also applicable on other version of CentOS server.
Method 1:
1. Insert DVD/ISO into DVD-Drive.
2. Mount the ISO from the DVD-ROM into /mnt directory :
[root@centos62 ~]# mount /dev/cdrom /mnt mount: block device /dev/sr0 is write-protected, mounting read-only
[root@centos62 ~]# vi /etc/yum.repos.d/centos62.repo
[CentOS6.2-Repository] name=DVD-CentOS6.2 repository baseurl=file:///mnt enabled=1 gpgcheck=0
Example :
[root@centos62 ~]# yum install httpd -y
1. Check the existing partition on your CentOS 6.2 server
[root@centos6 ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup-lv_root 18102140 1165764 16016824 7% / tmpfs 515444 0 515444 0% /dev/shm /dev/sda1 495844 29842 440402 7% /boot
[root@centos6 ~]# mkdir /mnt/localrepo
[root@centos6 ~]# mkdir -p /mnt/localrepo/{1,2,3}
[root@centos6 ~]# mount -o loop /dev/cdrom /mnt/localrepo/1
[root@centos6 ~]# df -lh Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 18G 1.2G 16G 7% / tmpfs 504M 0 504M 0% /dev/shm /dev/sda1 485M 30M 431M 7% /boot /dev/sr0 3.6G 3.6G 0 100% /mnt/localrepo/1
[root@centos6 ~]# mkdir /tmp/repo
[root@centos6 ~]# cp /mnt/localrepo/1/Packages/createrepo* /tmp/repo [root@centos6 ~]# cp /mnt/localrepo/1/Packages/deltarpm* /tmp/repo [root@centos6 ~]# cp /mnt/localrepo/1/Packages/libxml2-python* /tmp/repo [root@centos6 ~]# cp /mnt/localrepo/1/Packages/python-deltarpm* /tmp/repo [root@centos6 ~]# ls /tmp/repo createrepo-0.9.8-4.el6.noarch.rpm libxml2-python-2.7.6-4.el6.i686.rpm deltarpm-3.5-0.5.20090913git.el6.i686.rpm python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
[root@centos6 ~]# rpm -ivh /tmp/repo/* Preparing... ########################################### [100%] 1:deltarpm ########################################### [ 25%] 2:python-deltarpm ########################################### [ 50%] 3:libxml2-python ########################################### [ 75%] 4:createrepo ########################################### [100%]
[root@centos6 ~]# cd /mnt/localrepo/
[root@centos6 localrepo]# createrepo . 2704/3042 - 1/Packages/system-config-users-docs-1.0.8-1.el6.noarch.rpm iso-8859-1 encoding on Ville Skyttä - 2.8.2-2 3042/3042 - 1/Packages/zsh-4.3.10-4.1.el6.i686.rpm Saving Primary metadata Saving file lists metadata Saving other metadata [root@centos6 localrepo]# ls 1 2 3 repodata
[root@centos6 ~]# yum clean all Loaded plugins: fastestmirror Cleaning up Everything Cleaning up list of fastest mirrors
[root@centos6 ~]# vi /etc/yum.repos.d/local.repo [CentOS6.2-Repository] name=CentOS6.2 repository baseurl=file:///mnt/localrepo enabled=1 gpgcheck=0
0 comments:
Post a Comment