使用yum 什么命令都是这个
1. 查看centos7.2系统本身所安装的yum依赖包
[root@zf-test-web01-4 ~]# rpm -qa|grep yum
yum-plugin-fastestmirror-1.1.31-34.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-132.el7.centos.0.1.noarch
2. 卸载这些软件包
[root@zf-test-web01-4 ~]# rpm -e yum-plugin-fastestmirror-1.1.31-34.el7.noarch --nodeps
warning: /etc/yum/pluginconf.d/fastestmirror.conf saved as /etc/yum/pluginconf.d/fastestmirror.conf.rpmsave
[root@zf-test-web01-4 ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
[root@zf-test-web01-4 ~]# rpm -e yum-3.4.3-132.el7.centos.0.1.noarch --nodeps
[root@zf-test-web01-4 ~]#
3. 进入centos镜像网站找到自己对应系统需要的yum包
查看系统的命令:
[root@zf-test-web01-4 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
查看系统的位数:
[root@zf-test-web01-4 ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa7ff68f13de25936a098016243ce57c3c982e06, stripped
4.下载yum依赖包
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
5. 安装yum依赖包
[root@zf-test-web01-4 ~]# rpm -ivh yum-*
Preparing... ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 33%]
2:yum-plugin-fastestmirror-1.1.31-3################################# [ 67%]
3:yum-3.4.3-132.el7.centos.0.1 ################################# [100%]
然后按照这个网址干活就可以了
http://mirrors.ustc.edu.cn/help/centos.html 现在这个网址用上了,可以说厉害了
[root@zf-test-web01-4 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@zf-test-web01-4 yum.repos.d]# yum makecache
如果可以安装了 就是ok了 不行的话下面你还又可以选择
使用yum 什么命令都是这个
failure: repodata/repomd.xml from testing-devtools-2-centos-7: [Errno 256] No more mirrors to try.
http://people.centos.org/tru/devtools-2/7/x86_64/RPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
参照网上的做法: (一般yum有变更都需要这两个操作)
yum clean all
yum clean metadata
然后在使用
yum update
还是错误。
仔细看下错误:
http://download.fedoraproject.org/pub/fedora/linux/releases/17/Everything/x86_64/os/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found : http://download.fedoraproject.org/pub/fedora/linux/releases/17/Everything/x86_64/os/repodata/repomd.xml
就是源的配置问题嘛!
yum repolist enabled 只有一个
解决
cd /etc/yum.repos.d 修改devtools-2.repo后缀名
[root@VM_16_14_centos yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Repository epel is listed more than once in the configuration
Repository packages-microsoft-com-prod is listed more than once in the configuration
Cleaning repos: base epel extras packages-microsoft-com-prod updates
Cleaning up list of fastest mirrors
Other repos take up 7.1 M of disk space (use --verbose for details)
[root@VM_16_14_centos yum.repos.d]# yum makecache
ok 了哈哈