#查看是否安装yum #
Rpm-qa | grep Yum
[Email protected] ~]# Rpm-qa | grep Yum
#寻找适合自己操作系统的yum安装包 (can be found through the browser) #
http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
[Email protected] huxiaoming]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/ yum-3.2.29-40.el6.centos.noarch.rpm
--2014-05-15 13:46:08--http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
Resolving mirror.centos.org ... 103.27.60.52
Connecting to mirror.centos.org|103.27.60.52|:80 ... Connected.
HTTP request sent, awaiting response ... OK
length:1019540 (996K) [application/x-rpm]
Saving to: echnical measured um-3.2.29-40.el6.centos.noarch.rpm echnical
100%[===================================================================================================>] 1,019,540 193k/s in 5.3s
2014-05-15 13:46:16 (188 kb/s)-echnical measured um-3.2.29-40.el6.centos.noarch.rpm echnical saved [1019540/1019540]
#安装yum包, we found two components missing, and we found the group component in Http://mirrors.163.com/centos/6.5/os/i386/Packages/#
[Email protected] huxiaoming]# RPM-IVH yum-3.2.29-40.el6.centos.noarch.rpm
Warning:yum-3.2.29-40.el6.centos.noarch.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
error:failed dependencies:
Yum-metadata-parser >= 1.1.0 is needed by Yum-3.2.29-40.el6.centos.noarch
Yum-plugin-fastestmirror is needed by Yum-3.2.29-40.el6.centos.noarch
http://mirrors.163.com/centos/6.5/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
http://mirrors.163.com/centos/6.5/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
#经历了一个搞笑的循环 #
[Email protected] huxiaoming]# RPM-IVH yum-metadata-parser-1.1.2-16.el6.i686.rpm
Warning:yum-metadata-parser-1.1.2-16.el6.i686.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
Preparing ... ########################################### [100%]
1:yum-metadata-parser ########################################### [100%]
[Email protected] huxiaoming]# RPM-IVH yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Warning:yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
error:failed dependencies:
Yum >= 3.0 is needed by Yum-plugin-fastestmirror-1.1.30-14.el6.noarch
[Email protected] huxiaoming]# RPM-IVH yum-3.2.29-40.el6.centos.noarch.rpm
Warning:yum-3.2.29-40.el6.centos.noarch.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
error:failed dependencies:
Yum-plugin-fastestmirror is needed by Yum-3.2.29-40.el6.centos.noarch
[Email protected] huxiaoming]# RPM-IVH yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Warning:yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
error:failed dependencies:
Yum >= 3.0 is needed by Yum-plugin-fastestmirror-1.1.30-14.el6.noarch
#发现需要两个包一块装才能过去 #
[Email protected] huxiaoming]# RPM-IVH yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Warning:yum-3.2.29-40.el6.centos.noarch.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
Preparing ... ########################################### [100%]
1:yum-plugin-fastestmirro########################################### [50%]
2:yum ########################################### [100%]
[email protected] huxiaoming]# Yum version
Loaded Plugins:fastestmirror, Product-id, Subscription-manager
#忽略这个提示, because I'm Rhel6 's system, using the CentOS source #
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Warning:rpmdb altered outside of Yum.
* * Found 1 pre-existing rpmdb problem (s), ' yum check ' output follows:
Rhn-check-1.0.0.1-16.el6.noarch has missing requires of Yum-rhn-plugin >= (' 0 ', ' 0.9.1 ', ' 35 ')
Installed: $releasever/i386 633:7e7920485b2882fc1951b685d95599d39372ec6b
Group-installed:yum 15:d8b0873c96b8df6702e74f3e8d737edc77ecb758
Version
wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo put it in the/etc/yum.repos.d/directory, back up the original Yum
[email protected] huxiaoming]# Yum Makecache
Loaded Plugins:fastestmirror, Product-id, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Determining fastest Mirrors
Http://mirrors.163.com/centos/%24releasever/os/i386/repodata/repomd.xml: [Errno] Pycurl ERROR-"The requested URL returned error:404 not Found "
Trying other mirror.
Error:cannot Retrieve repository metadata (Repomd.xml) for repository:base. Verify its path and try again
#需要通过修改 $releasever to the corresponding version, change all $releasever variables to the corresponding system version 6.5 #
[Email protected] yum.repos.d]# VI centos6-base-163.repo
[email protected] yum.repos.d]# Yum Clean all
Loaded Plugins:fastestmirror, Product-id, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Cleaning Repos:base Extras Updates
Cleaning up everything
[email protected] yum.repos.d]# Yum Makecache
Loaded Plugins:fastestmirror, Product-id, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Determining fastest Mirrors
Base | 3.7 KB 00:00
Base/group_gz | 212 KB 00:00
base/filelists_db | 4.9 MB 00:20
base/primary_db | 3.5 MB 00:10
base/other_db | 2.1 MB 00:07
Extras | 3.4 KB 00:00
extras/filelists_db | Ten KB 00:00
Extras/prestodelta | 901 B 00:00
extras/primary_db | KB 00:00
extras/other_db | 5.5 KB 00:00
Updates | 3.4 KB 00:00
updates/filelists_db | 1.8 MB 00:05
Updates/prestodelta | 206 KB 00:00
updates/primary_db | 2.9 MB 00:09
updates/other_db | MB 01:29
Metadata Cache Created
#试着安装一下gcc Success #
[[email protected] yum.repos.d]# Yum install gcc
Loaded Plugins:fastestmirror, Product-id, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--Running Transaction check
---> Package gcc.i686 0:4.4.7-4.el6 'll be installed
--Processing Dependency:cpp = 4.4.7-4.el6 for package:gcc-4.4.7-4.el6.i686
--processing dependency:cloog-ppl >= 0.15 for package:gcc-4.4.7-4.el6.i686
--Running Transaction check
---> Package cloog-ppl.i686 0:0.15.7-1.2.el6 'll be installed
--processing dependency:libppl_c.so.2 for package:cloog-ppl-0.15.7-1.2.el6.i686
--processing dependency:libppl.so.7 for package:cloog-ppl-0.15.7-1.2.el6.i686
---> Package cpp.i686 0:4.4.7-4.el6 'll be installed
--processing dependency:libmpfr.so.1 for package:cpp-4.4.7-4.el6.i686
--Running Transaction check
---> Package mpfr.i686 0:2.4.1-6.el6 'll be installed
---> Package ppl.i686 0:0.10.2-11.el6 'll be installed
--Finished Dependency Resolution
Dependencies resolved
=============================================================================================================== ================================
Package Arch Version Repository Size
=============================================================================================================== ================================
Installing:
GCC i686 4.4.7-4.el6 Base 8.2 M
Installing for dependencies:
CLOOG-PPL i686 0.15.7-1.2.el6 Base (k)
CPP i686 4.4.7-4.EL6 Base 3.4 M
MPFR i686 2.4.1-6.el6 Base 153 k
PPL i686 0.10.2-11.EL6 Base 1.3 M
Transaction Summary
=============================================================================================================== ================================
Install 5 Package (s)
Total Download Size:13 M
Installed size:29 M