Redhat Enterprise Linux 는 상용 리눅스로 유지보수에 대한 Subscription을 구매후 Redhat RHN을 통해 Subscription 활성화 후 아래와 같이 OS상에서 rhn_register 과정을 통해 yum 유지보수 서비스를 받을 수 있다.
[root@REL-Server01 ~]# [root@REL-Server01 ~]# [root@REL-Server01 ~]# rhn_register [root@REL-Server01 ~]# [root@REL-Server01 ~]# |
하지만 RHN ID와 Subscription 에 이상이 없음에도 아래와 같은 에러와 함께 yum service를 제공 받을 수 없을 때가 있다.
[root@REL-Server01 ~]# [root@REL-Server01 ~]# cat /etc/sysconfig/rhn/up2date | grep serverURL serverURL[comment]=Remote server URL serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC disallowConfChanges=noReboot;sslCACert;useNoSSLForPackages;noSSLServerURL;serverURL;disallowConfChanges; [root@REL-Server01 ~]# [root@REL-Server01 ~]# nc -z xmlrpc.rhn.redhat.com 80 Connection to xmlrpc.rhn.redhat.com 80 port [tcp/http] succeeded! [root@REL-Server01 ~]# [root@REL-Server01 ~]# nc -z xmlrpc.rhn.redhat.com 443 Connection to xmlrpc.rhn.redhat.com 443 port [tcp/https] succeeded! [root@REL-Server01 ~]# [root@REL-Server01 ~]# [root@REL-Server01 ~]# [root@REL-Server01 ~]# yum check Loaded plugins: rhnplugin, security Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 309, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 157, in main base.getOptionsConfig(args) File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig self.conf File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 664, in <lambda> conf = property(fget=lambda self: self._getConfig(), File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 253, in _getConfig self.plugins.run('init') File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/lib/yum-plugins/rhnplugin.py", line 127, in init_hook svrChannels = rhnChannel.getChannelDetails() File "/usr/share/rhn/up2date_client/rhnChannel.py", line 86, in getChannelDetails sourceChannels = getChannels() File "/usr/share/rhn/up2date_client/rhnChannel.py", line 112, in getChannels up2dateChannels = s.up2date.listChannels(up2dateAuth.getSystemId()) File "/usr/share/rhn/up2date_client/rhnserver.py", line 64, in __call__ raise up2dateErrors.SSLCertificateVerifyFailedError() up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The certificate is expired. Please ensure you have the correct certificate and your system time is correct. [root@REL-Server01 ~]# [root@REL-Server01 ~]# |
Redhat 에 SR을 통해 답변 받은 결과로는 yum 사용전 rhn 인증 과정을 거치게 되며 이때 사용되는 패키지가 손상되었거나 구버전일 경우 Redhat Yum Repository 의 인증 정보와 일치하지 않아 생기는 에러일 수 있다는 답변을 받았다.
이에 다음과 같은 조치로 Yum Repository 를 복구가 가능하다.
1. 해당 OS의 버전을 확인
[root@REL-Server01 /]# [root@REL-Server01 /]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.8 (Tikanga) [root@REL-Server01 /]# [root@REL-Server01 /]# uname -a Linux REL-Server01 2.6.18-308.el5xen #1 SMP Fri Jan 27 17:26:57 EST 2012 x86_64 x86_64 x86_64 GNU/Linux [root@REL-Server01 /]# [root@REL-Server01 /]# getconf LONG_BIT 64 [root@REL-Server01 /]# [root@REL-Server01 /]# |
2. 해당 OS의 최신 ISO를 준비
rhel-server-5.9-x86_64-dvd.iso |
3. 아래와 같이 추가된 해당 OS ISO를 마운트
(XenServer 이하 VM 환경이기 때문에 Xen ISO Attach 를 통하여 CD-ROM 형식으로 마운트)
[root@REL-Server01 /]# [root@REL-Server01 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda2 20G 3.0G 16G 17% / /dev/xvda6 20G 4.1G 15G 23% /usr /dev/xvda5 20G 3.9G 15G 21% /var /dev/xvda3 30G 17G 11G 62% /home /dev/xvda1 996M 53M 892M 6% /boot tmpfs 16G 0 16G 0% /dev/shm /dev/xvdb1 20G 448M 19G 3% /PostgresPlus /dev/xvdc1 296G 16G 265G 6% /data /dev/xvde1 37G 689M 35G 2% /pg_xlog /dev/xvde2 37G 5.4G 30G 16% /archive [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# fdisk -l 2>&- | grep Disk Disk /dev/xvdb: 21.4 GB, 21474836480 bytes Disk /dev/xvda: 107.3 GB, 107374182400 bytes Disk /dev/xvdc: 322.1 GB, 322122547200 bytes Disk /dev/xvde: 161.0 GB, 161061273600 bytes Disk /dev/xvdd: 4298 MB, 4298059776 bytes [root@REL-Server01 /]# [root@REL-Server01 /]# ls -lrt /dev/xv* brw-r----- 1 root disk 202, 66 Jan 10 06:39 /dev/xvde2 brw-r----- 1 root disk 202, 65 Jan 10 06:39 /dev/xvde1 brw-r----- 1 root disk 202, 64 Jan 10 06:39 /dev/xvde brw-r----- 1 root disk 202, 33 Jan 10 06:39 /dev/xvdc1 brw-r----- 1 root disk 202, 32 Jan 10 06:39 /dev/xvdc brw-r----- 1 root disk 202, 16 Jan 10 06:39 /dev/xvdb brw-r----- 1 root disk 202, 7 Jan 10 06:39 /dev/xvda7 brw-r----- 1 root disk 202, 4 Jan 10 06:39 /dev/xvda4 brw-r----- 1 root disk 202, 0 Jan 10 06:39 /dev/xvda brw-r----- 1 root disk 202, 2 Jan 10 06:39 /dev/xvda2 brw-r----- 1 root disk 202, 6 Jan 10 06:39 /dev/xvda6 brw-r----- 1 root disk 202, 5 Jan 10 06:39 /dev/xvda5 brw-r----- 1 root disk 202, 3 Jan 10 06:39 /dev/xvda3 brw-r----- 1 root disk 202, 1 Jan 10 06:39 /dev/xvda1 brw-r----- 1 root disk 202, 17 Jan 10 06:39 /dev/xvdb1 crw--w---- 1 root tty 204, 191 Jan 14 22:59 /dev/xvc0 brw-r----- 1 root disk 202, 48 Jan 17 17:53 /dev/xvdd [root@REL-Server01 /]# [root@REL-Server01 /]# mount -t iso9660 -o loop /dev/xvdd /mnt [root@REL-Server01 /]# [root@REL-Server01 /]# df -h | grep xvdd /dev/xvdd 4.1G 4.1G 0 100% /mnt [root@REL-Server01 /]# |
4. mount 된 ISO 파일내 mediaid 정보 확인 및 yum local repository 생성을 위한 repo config 작성
[root@REL-Server01 /]# [root@REL-Server01 /]# head -1 /mnt/.discinfo 1354216429.587870 [root@REL-Server01 /]# [root@REL-Server01 /]# vi /etc/yum.repos.d/local.repo [root@REL-Server01 /]# [dvd-server] mediaid=1354216429.587870 name=RHEL 5 Server DVD baseurl=file:///mnt/Server gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release enabled=1 gpgcheck=1 |
5. Local Repository 이용을 위한 Redhat Repository 정보 및 인증 정보 disable 처리
[root@REL-Server01 /]# vi /etc/yum/pluginconf.d/rhnplugin.conf [root@REL-Server01 /]# [main] enabled = 1 # 0으로 변경 gpgcheck = 1
[rhel-i386-server-5] enabled = 1 # 0으로 변경
[root@REL-Server01 /]# [root@REL-Server01 /]# vi /etc/yum/pluginconf.d/security.conf [root@REL-Server01 /]# [main] enabled=1 # 0으로 변경
[root@REL-Server01 /]# [root@REL-Server01 /]#
|
6. Yum Repository 캐시정보 삭제 및 Local Repository 패키지를 통한 rhn-tools-client 등 관련 패키지 업데이트
[root@REL-Server01 /]# [root@REL-Server01 /]# yum clean all Cleaning up Everything [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# yum update -y rhn* dvd-server | 1.5 kB 00:00 dvd-server/primary | 932 kB 00:00 dvd-server 3335/3335 Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package rhn-check.noarch 0:0.4.20-86.el5 set to be updated ---> Package rhn-client-tools.noarch 0:0.4.20-86.el5 set to be updated --> Processing Dependency: python-dmidecode for package: rhn-client-tools ---> Package rhn-setup.noarch 0:0.4.20-86.el5 set to be updated ---> Package rhn-setup-gnome.noarch 0:0.4.20-86.el5 set to be updated ---> Package rhnlib.noarch 0:2.5.22-7.el5 set to be updated ---> Package rhnsd.x86_64 0:4.7.0-14.el5 set to be updated --> Running transaction check ---> Package python-dmidecode.x86_64 0:3.10.13-1.el5_5.1 set to be updated --> Processing Conflict: rhn-client-tools conflicts yum-rhn-plugin < 0.5.4-16.el5 --> Restarting Dependency Resolution with new changes. --> Running transaction check ---> Package yum-rhn-plugin.noarch 0:0.5.4-29.el5 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================================================================================================================== Updating: rhn-check noarch 0.4.20-86.el5 dvd-server 45 k rhn-client-tools noarch 0.4.20-86.el5 dvd-server 922 k rhn-setup noarch 0.4.20-86.el5 dvd-server 123 k rhn-setup-gnome noarch 0.4.20-86.el5 dvd-server 153 k rhnlib noarch 2.5.22-7.el5 dvd-server 71 k rhnsd x86_64 4.7.0-14.el5 dvd-server 34 k yum-rhn-plugin noarch 0.5.4-29.el5 dvd-server 62 k Installing for dependencies: python-dmidecode x86_64 3.10.13-1.el5_5.1 dvd-server 89 k
Transaction Summary ============================================================================================================================================================================================================================================================================== Install 1 Package(s) Update 7 Package(s) Remove 0 Package(s) .
.
.
생략
.
.
. |
7. 상기 5번 Step에서 수정한 Redhat Repository Enable 값 복구 처리 및 Local Repository config 삭제
[root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# vi /etc/yum/pluginconf.d/rhnplugin.conf [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# vi /etc/yum/pluginconf.d/security.conf [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# rm -f /etc/yum.repos.d/local.repo [root@REL-Server01 /]#
[root@REL-Server01 /]# |
8. Mount 된 OS ISO umount 처리 및 yum 캐쉬 삭제 후 yum check을 통한 확인
[root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# umount /mnt [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]# yum clean all Loaded plugins: rhnplugin, security Cleaning up Everything [root@REL-Server01 /]# [root@REL-Server01 /]# [root@REL-Server01 /]#
[root@REL-Server01 /]# [root@REL-Server01 /]# yum check-update Loaded plugins: rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. rhel-x86_64-server-5 | 1.4 kB 00:00 rhel-x86_64-server-5/primary | 5.6 MB 00:00 rhel-x86_64-server-5 15778/15778 Skipping security plugin, no data
Deployment_Guide-en-US.noarch 5.8-1.el5 rhel-x86_64-server-5 ImageMagick.i386 6.2.8.0-15.el5_8 rhel-x86_64-server-5 ImageMagick.x86_64 6.2.8.0-15.el5_8 rhel-x86_64-server-5 NetworkManager.i386 1:0.7.0-13.el5 rhel-x86_64-server-5 NetworkManager.x86_64 1:0.7.0-13.el5 rhel-x86_64-server-5 NetworkManager-glib.i386 1:0.7.0-13.el5 rhel-x86_64-server-5 NetworkManager-glib.x86_64 . . . 생략 . . .
|
9. 복구완료된 yum 을 통해 필요한 패키지 확인 및 설치
[root@REL-Server01 /]# [root@REL-Server01 /]# yum provides */e4fsck Loaded plugins: rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. rhel-x86_64-server-5/filelists | 32 MB 01:03 e4fsprogs-1.41.12-3.el5.x86_64 : Utilities for managing the fourth extended (ext4) filesystem Repo : rhel-x86_64-server-5 Matched from: Filename : /sbin/e4fsck . . . 생략 . . .
[root@REL-Server01 /]# yum install -y e4fsprogs* Loaded plugins: rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package e4fsprogs.x86_64 0:1.41.12-4.el5_10 set to be updated ---> Package e4fsprogs-devel.i386 0:1.41.12-4.el5_10 set to be updated ---> Package e4fsprogs-devel.x86_64 0:1.41.12-4.el5_10 set to be updated ---> Package e4fsprogs-libs.i386 0:1.41.12-4.el5_10 set to be updated ---> Package e4fsprogs-libs.x86_64 0:1.41.12-4.el5_10 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================================================================================================================== Installing: e4fsprogs x86_64 1.41.12-4.el5_10 rhel-x86_64-server-5 1.1 M e4fsprogs-devel i386 1.41.12-4.el5_10 rhel-x86_64-server-5 516 k e4fsprogs-devel x86_64 1.41.12-4.el5_10 rhel-x86_64-server-5 581 k e4fsprogs-libs i386 1.41.12-4.el5_10 rhel-x86_64-server-5 109 k e4fsprogs-libs x86_64 1.41.12-4.el5_10 rhel-x86_64-server-5 105 k
Transaction Summary ============================================================================================================================================================================================================================================================================== Install 5 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 2.4 M Downloading Packages: (1/5): e4fsprogs-libs-1.41.12-4.el5_10.x86_64.rpm . . . 생략 . . .
|