yum的卸载与安装

[root@littlelawson ~]# rpm -qa yum
yum-3.2.29-81.el6.centos.noarch
[root@littlelawson ~]# rpm -qa | grep yum | xargs rpm -e --nodeps
[root@littlelawson ~]# rpm -qa yum
[root@littlelawson ~]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
--2018-07-05 10:39:47--  http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
Resolving mirror.centos.org... 103.27.60.52, 2605:9000:401:102::2
Connecting to mirror.centos.org|103.27.60.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1042364 (1018K) [application/x-rpm]
Saving to: “yum-3.2.29-81.el6.centos.noarch.rpm100%[======================================================>] 1,042,364   1.53M/s   in 0.6s    

2018-07-05 10:39:48 (1.53 MB/s) - “yum-3.2.29-81.el6.centos.noarch.rpm” saved [1042364/1042364]

[root@littlelawson ~]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
--2018-07-05 10:39:57--  http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
Resolving mirror.centos.org... 103.27.60.52, 2605:9000:401:102::2
Connecting to mirror.centos.org|103.27.60.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27224 (27K) [application/x-rpm]
Saving to: “yum-metadata-parser-1.1.2-16.el6.x86_64.rpm100%[======================================================>] 27,224      --.-K/s   in 0.1s    

2018-07-05 10:39:58 (200 KB/s) - “yum-metadata-parser-1.1.2-16.el6.x86_64.rpm” saved [27224/27224]

[root@littlelawson ~]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
--2018-07-05 10:40:08--  http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
Resolving mirror.centos.org... 103.27.60.52, 2605:9000:401:102::2
Connecting to mirror.centos.org|103.27.60.52|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-07-05 10:40:09 ERROR 404: Not Found.

[root@littlelawson ~]# wget yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
--2018-07-05 10:41:50--  http://yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm/
Resolving yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm... failed: Name or service not known.
wget: unable to resolve host address “yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm”
[root@littlelawson ~]# wget yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
--2018-07-05 10:42:42--  http://yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm/
Resolving yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm... failed: Name or service not known.
wget: unable to resolve host address “yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm”
[root@littlelawson ~]# ls
anaconda-ks.cfg   frSite.properties   Main$$anonfun$1.class
bigdata           hadoop_temp         Main.class
chageHostName.sh  HelloLinux.txt      metastore_db
changeLimit.sh    hosts               myvalue
closeHugePage.sh  IdeaProjects        region_split_info_two.txt
copyFile.sh       installLDAP.sh      region_split_info.txt
create            install.log         Templates
derby.log         install.log.syslog  TestConstructor.class
Desktop           ip_dns.map          test.sh
donation          ip_host.map         yum-3.2.29-81.el6.centos.noarch.rpm
erroryum          johndoe             yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@littlelawson ~]# rpm -ivh yum-*
error: Failed dependencies:
    yum-plugin-fastestmirror is needed by yum-3.2.29-81.el6.centos.noarch
[root@littlelawson ~]# wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
--2018-07-05 10:44:51--  http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
Resolving mirrors.aliyun.com... 180.163.155.12, 180.163.155.10, 180.163.155.11, ...
Connecting to mirrors.aliyun.com|180.163.155.12|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-07-05 10:44:51 ERROR 404: Not Found.

[root@littlelawson ~]# rpm -ivh yum-fastestmirror-1.1.26-11.el6.centos.noarch.rpm
error: open of yum-fastestmirror-1.1.26-11.el6.centos.noarch.rpm failed: No such file or directory
[root@littlelawson ~]# ll
total 1832
-rw-------.  1 root root    3336 Apr  4 07:25 anaconda-ks.cfg
drwxr-xr-x.  2 root root    4096 May 10 23:21 bigdata
-rwxr-xr-x.  1 root root     171 Jul  3 20:30 chageHostName.sh
-rw-r--r--.  1 root root     423 Jul  4 17:13 changeLimit.sh
-rwxr-xr-x.  1 root root     593 Jul  4 16:32 closeHugePage.sh
-rwxr-xr-x.  1 root root      91 Jul  4 13:55 copyFile.sh
-rw-r--r--.  1 root root       0 Jun 16 03:12 create
-rw-r--r--.  1 root root  392932 Apr 28 05:21 derby.log
drwxr-xr-x.  2 root root    4096 Apr 27 07:47 Desktop
drwxr-xr-x. 12 root root    4096 Apr  9 06:49 donation
-rw-r--r--.  1 root root  246329 Jul  5 10:17 erroryum
-rw-r--r--.  1 root root     190 Mar 14 03:19 frSite.properties
drwxr-xr-x.  3 root root    4096 Jul  3 17:13 hadoop_temp
-rw-r--r--.  1 root root      54 Jul  4 14:00 HelloLinux.txt
-rw-r--r--.  1 root root      42 Jul  3 18:52 hosts
drwxr-xr-x.  8 root root    4096 Jun 30 10:00 IdeaProjects
-rwxr-xr-x.  1 root root     693 Jul  4 18:31 installLDAP.sh
-rw-r--r--.  1 root root   41364 Apr  4 07:25 install.log
-rw-r--r--.  1 root root    9154 Apr  4 07:23 install.log.syslog
-rw-r--r--.  1 root root      66 Jul  3 19:57 ip_dns.map
-rw-r--r--.  1 root root      66 Jul  3 18:53 ip_host.map
-rw-r--r--.  1 root root       0 Jun 16 03:12 johndoe
-rw-r--r--.  1 root root    1201 May  2 09:02 Main$$anonfun$1.class
-rw-r--r--.  1 root root     969 May  2 09:02 Main.class
drwxr-xr-x.  5 root root    4096 Apr 28 05:21 metastore_db
-rw-r--r--.  1 root root       0 Jun 16 03:12 myvalue
-rw-r--r--.  1 root root      24 Jun 16 04:45 region_split_info_two.txt
-rw-r--r--.  1 root root      54 Jun 16 03:13 region_split_info.txt
drwxr-xr-x.  2 root root    4096 Jun 30 09:35 Templates
-rw-r--r--.  1 root root    2933 May  2 11:01 TestConstructor.class
-rw-r--r--.  1 root root      58 Jul  3 20:01 test.sh
-rw-r--r--.  1 root root 1042364 Mar 23  2017 yum-3.2.29-81.el6.centos.noarch.rpm
-rw-r--r--.  1 root root   27224 Sep 25  2011 yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@littlelawson ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
--2018-07-05 10:48:24--  http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
Resolving mirror.centos.org... 103.27.60.52, 2605:9000:401:102::2
Connecting to mirror.centos.org|103.27.60.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 33660 (33K) [application/x-rpm]
Saving to: “yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm100%[======================================================>] 33,660      --.-K/s   in 0.07s   

2018-07-05 10:48:24 (487 KB/s) - “yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm” saved [33660/33660]

[root@littlelawson ~]# rpm -ivh yum-*
warning: yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [ 33%]
   2:yum-plugin-fastestmirro########################################### [ 67%]
   3:yum                    ########################################### [100%]

请记住下面这个linux包的地址:
http://mirror.centos.org/centos/7/os/x86_64/Packages/

你可能感兴趣的:(Linux)