[root@TDB yum.repos.d]# yum repolist all
Loaded plugins: refresh-packagekit, security
http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64/repodata/repomd.xml:
[Errno 14] PYCURL ERROR 6 - "Couldn't resolve host
'public-yum.oracle.com'"
Trying other mirror.
repo id repo name
status
InstallMedia Oracle Linux 6.3
disabled
ol6_UEK_base Unbreakable Enterprise Kernel for Oracle Linux 6Server
disabled
ol6_UEK_latest Latest Unbreakable Enterprise Kernel for Oracle Linux
enabled: 0
ol6_ga_base Oracle Linux 6Server GA installation media copy (x86_6
disabled
ol6_iso local-source
enabled: 0
ol6_latest Oracle Linux 6Server Latest (x86_64)
enabled: 0
ol6_u1_base Oracle Linux 6Server Update 1 installation media copy
disabled
ol6_u2_base Oracle Linux 6Server Update 2 installation media copy
disabled
ol6_u3_base Oracle Linux 6Server Update 3 installation media copy
disabled
repolist: 0
发现ol6_iso的状态也是0,正常应该是好几千才对,cd到目录下修改其他repo的后缀,使之失效
[root@TDB Packages]# cd /etc/yum.repos.d
[root@TDB yum.repos.d]# ls
local.repo packagekit-media.repo public-yum-ol6.repo
[root@TDB yum.repos.d]# mv packagekit-media.repo packagekit-media
[root@TDB yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6
但是在只有本地源生效的情况下依然用yum安装依然报错,经过一番研究发现其实只需要把
gpgkey=file:///u01/ol63_source/RPM-GPG-KEY-oracle这一列的RPM-GPG-KEY-oracle改为和iso镜像当中的RPM-GPG-KEY开头的名称相同即可,例如redhat 镜像目录中的是RPM-GPG-KEY-redhat-release ,那么编辑.repo替换RPM-GPG-KEY-oracle,保存退出。
例如oracle enterprise linux 6.3的镜像文件夹内的名称就是 RPM-GPG-KEY-oracle
[root@TDB ol63_source]# ls
EFI GPL LoadBalancer README-en.html RELEASE-NOTES-x86_64-en.html ResilientStorage Server
EULA HighAvailability media.repo RELEASE-NOTES-en RELEASE-NOTES-x86-en RPM-GPG-KEY supportinfo
eula.en_US images Packages RELEASE-NOTES-en.html RELEASE-NOTES-x86-en.html RPM-GPG-KEY-oracle TRANS.TBL
eula.py isolinux README-en RELEASE-NOTES-x86_64-en repodata ScalableFileSystem UEK2
然后查看 repolist
[root@TDB Packages]# yum repolist all
Loaded plugins: refresh-packagekit, security
repo id repo name status
ol6_iso local-source enabled: 3,563
repolist: 3,563
发现状态已经正常了,然后再来安装
[root@TDB Packages]# rpm -Uvh unixODBC-2.2.14-11.el6.i686.rpm
warning: unixODBC-2.2.14-11.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
libltdl.so.7 is needed by unixODBC-2.2.14-11.el6.i686
libreadline.so.6 is needed by unixODBC-2.2.14-11.el6.i686
[root@TDB Packages]# yum install unixODBC-2.2.14-11.el6.i686.rpm
Loaded plugins: refresh-packagekit, security
ol6_iso | 3.7 kB 00:00 ...
Setting up Install Process
Examining unixODBC-2.2.14-11.el6.i686.rpm: unixODBC-2.2.14-11.el6.i686
Marking unixODBC-2.2.14-11.el6.i686.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package unixODBC.i686 0:2.2.14-11.el6 will be installed
--> Processing Dependency: libltdl.so.7 for package: unixODBC-2.2.14-11.el6.i686
--> Processing Dependency: libreadline.so.6 for package: unixODBC-2.2.14-11.el6.i686
--> Running transaction check
---> Package libtool-ltdl.i686 0:2.2.6-15.5.el6 will be installed
---> Package readline.i686 0:6.0-4.el6 will be installed
--> Processing Dependency: libtinfo.so.5 for package: readline-6.0-4.el6.i686
--> Running transaction check
---> Package ncurses-libs.i686 0:5.7-3.20090208.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
unixODBC i686 2.2.14-11.el6 /unixODBC-2.2.14-11.el6.i686 1.1 M
Installing for dependencies:
libtool-ltdl i686 2.2.6-15.5.el6 ol6_iso 44 k
ncurses-libs i686 5.7-3.20090208.el6 ol6_iso 250 k
readline i686 6.0-4.el6 ol6_iso 176 k
Transaction Summary
=============================================================================================================================================================
Install 4 Package(s)
Total size: 1.6 M
Total download size: 470 k
Installed size: 2.3 M
Is this ok [y/N]: y
Downloading Packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 28 MB/s | 470 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from file:/u01/ol63_source/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
Userid: "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
From : file:/u01/ol63_source/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : ncurses-libs-5.7-3.20090208.el6.i686 1/4
Installing : readline-6.0-4.el6.i686 2/4
Installing : libtool-ltdl-2.2.6-15.5.el6.i686 3/4
Installing : unixODBC-2.2.14-11.el6.i686 4/4
Verifying : libtool-ltdl-2.2.6-15.5.el6.i686 1/4
Verifying : ncurses-libs-5.7-3.20090208.el6.i686 2/4
Verifying : unixODBC-2.2.14-11.el6.i686 3/4
Verifying : readline-6.0-4.el6.i686 4/4
Installed:
unixODBC.i686 0:2.2.14-11.el6
Dependency Installed:
libtool-ltdl.i686 0:2.2.6-15.5.el6 ncurses-libs.i686 0:5.7-3.20090208.el6 readline.i686 0:6.0-4.el6
Complete!