买了个服务器一直没怎么用,这几天学习gitbook 想着用一下。结果出现了这个错误,找了好多博客,然并卵。想让朋友帮我看一下,不尿我,留下了没本事的泪水, 我一怒重新装了系统。谁拍谁。
过了半月,天晓得发生了什么, 又出现了这个错误,想死的心都有了。四处找资料,查找博客,方法太多了,可能是我的姿势不对,很多不能用。如果再次重装系统,我可能疯掉。
解决办法
rpm -qa |grep yum
rpm -aq|grep yum|xargs rpm -e --nodeps
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
rpm -ivh --force --nodeps python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --force --nodeps yum-3.4.3-167.el7.centos.noarch.rpm
rpm -ivh --force --nodeps yum-plugin-fastestmirror-1.1.31-53.el7.noarch.rpm
yum
http://mirrors.163.com/centos/7/os/x86_64/Packages/
2020-08-14
报错Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Nothing to do
于是我又下载重装
-bash: /usr/bin/yum: No such file or directory
/etc/yum.repos.d 备份,并创建同名文件 yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//把本地缓存的依赖关系先干掉!
yum clean all
编辑新下载的源文件,修改其中的版本号
# vim CentOS-Base.repo
编辑文件,把文件里面的$releasever全部替换为版本号:6最后保存
:%s/$releasever/6/g
保存文件即可
:wq
然后软件包的依赖关系:
yum makecache
参考
https://blog.csdn.net/qq_36299025/article/details/90901055
https://blog.csdn.net/wbzcl/article/details/82390377
[Errno 5] [Errno 2] No such file or dir
/usr/bin/yum 第一行对应的python版本
/usr/libexec/urlgrabber-ext-down 第一行对应的python版本
yum clean all
yum makecache
2020-08-06
安装用yum 安装 yum install jenkins
报错http://pkg.jenkins.io/redhat-stable/jenkins-2.251-1.1.noarch.rpm: [Errno 14] HTTPS Error 404 - Not Found ] 0.0 B/s | 0 B --:--:-- ETA
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
Error downloading packages:
jenkins-2.251-1.1.noarch: [Errno 256] No more mirrors to try.
意思是源不行了,换源吧,可能因为我是用的百度的服务器, 源是百度的
换成清华换源
yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存