首页 > 系统相关 >Centos误删系统自带python2.7,yum报错恢复方法

Centos误删系统自带python2.7,yum报错恢复方法

时间:2023-08-29 20:12:44浏览次数:46  
标签:x86 Centos python python2.7 centos 64 org 报错 el7

 

使用wget分别下载python以及yum的rpm包

资源地址如下:                   http://vault.centos.org

mkdir /usr/local/src/python
cd /usr/local/src/python
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-2.7.5-76.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-devel-2.7.5-76.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-libs-2.7.5-76.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/python-virtualenv-15.1.0-2.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-build-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-build-libs-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-libs-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-python-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/rpm-sign-4.11.3-35.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-plugin-aliases-1.1.31-50.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-50.el7.noarch.rpm
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm

 

强制安装

[root@master01 python]# rpm -Uvh --replacepkgs libxml2-python*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:libxml2-python-2.9.1-6.el7_2.3 ################################# [100%]
[root@master01 python]# rpm -Uvh --replacepkgs python*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:python-libs-2.7.5-76.el7 ################################# [ 8%]
2:python-2.7.5-76.el7 ################################# [ 15%]
3:python-backports-1.0-8.el7 ################################# [ 23%]
4:python-chardet-2.2.1-1.el7_1 ################################# [ 31%]
5:python-devel-2.7.5-76.el7 ################################# [ 38%]
6:python-ipaddress-1.0.16-2.el7 ################################# [ 46%]
7:python-backports-ssl_match_hostna################################# [ 54%]
8:python-setuptools-0.9.8-7.el7 ################################# [ 62%]
9:python-pycurl-7.19.0-19.el7 ################################# [ 69%]
10:python-urlgrabber-3.10-9.el7 ################################# [ 77%]
11:python-virtualenv-15.1.0-2.el7 ################################# [ 85%]
12:python-kitchen-1.1.1-5.el7 ################################# [ 92%]
13:python-iniparse-0.4-9.el7 ################################# [100%]
[root@master01 python]# rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 10%]
2:rpm-python-4.11.3-35.el7 ################################# [ 20%]
3:yum-plugin-fastestmirror-1.1.31-5################################# [ 30%]
4:yum-3.4.3-161.el7.centos ################################# [ 40%]
5:yum-utils-1.1.31-50.el7 ################################# [ 50%]
6:yum-plugin-aliases-1.1.31-50.el7 ################################# [ 60%]
7:yum-plugin-protectbase-1.1.31-50.################################# [ 70%]
Cleaning up / removing...
8:yum-utils-1.1.31-54.el7_8 ################################# [ 80%]
9:yum-plugin-fastestmirror-1.1.31-5################################# [ 90%]
10:yum-3.4.3-168.el7.centos ################################# [100%]

 

标签:x86,Centos,python,python2.7,centos,64,org,报错,el7
From: https://www.cnblogs.com/vzhangxk/p/17665730.html

相关文章

  • python3.6使用wordcloud 1.9报错ValueError: Only supported for TrueType fonts
    该版本的wordcloud的源码中显示不兼容python3.6 解决办法:修改wordcloud源码修改前508:box_size=draw.textbox((0,0),word,font=transposed_font,anchor="lt")510:result=occupancy.sample_position(box_size[3]+self.margin,......
  • 在CentOS8下安装MySQL8.0.31
    一、登录官网主页:https://www.mysql.com/downloads/,选择社区版下载,如下图: 选择MySQLCommunityServer: 选择Archives: 按照下图步骤,获取下载的IP地址  最终拿到的官网地址为:https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.31-1.el8.x86_64.rpm-bun......
  • 【Python】报错处理笔记
    shutil.rmtree(path)报错:PermissionError:[WinError5]分析:对应的目录或文件被设置了只读属性解决方案:defremove_readonly(func,path,_):#错误回调函数,改变只读属性位,重新删除"Clearthereadonlybitandreattempttheremoval"os.chmod(path,stat.S_I......
  • Centos7 配置清华源
    1备份现有的yum源cd/etc/yum.repos.d/mkdirbakmv*.repo/etc/yum.repos.d/bak2创建清华yum源vim/etc/yum.repos.d/QingHua.repo#CentOS-Base.repo##ThemirrorsystemusestheconnectingIPaddressoftheclientandthe#updatestatusofeachmirror......
  • Mybatis Plus报错: can not find lambda cache...
    使用mybatisplus时使用Lambda表达式做查询条件会遇到mybatis拿不到缓存问题:错误1:com.baomidou.mybatisplus.core.exceptions.MybatisPlusException:cannotfindlambdacacheforthisentity错误2:cannotfindlambdacacheforthisproperty[XXX]ofentity[com.XXX.X......
  • 报错 PEP 8: expected 2 blank lines, found 1
    PyCharm提示:PEP8:expected2blanklines,found1类或方法前需要空两行解决方法:Ctrl+Alt+L格式化一下就OK了。或者手动在前面敲一行......
  • Centos7安装VNC
    安装vnc#检查可用版本[root@vnc~]#yum--showduplicateslisttigervnc-server#安装vnc[root@vnc~]#yuminstall-ytigervnc-server#设置密码[root@vnc~]#vncpasswdPassword: #最低六位Verify:Wouldyouliketoenteraview-onlypassword(y/n)?n#是否创建只......
  • mysql报错:The last packet successfully received from the server was 51,384,505 mi
    这个报错是MySQL连接超时导致的。当MySQL客户端在一段时间内没有收到来自服务器的数据包时,会触发这个错误。产生这个错误的可能原因有:1.网络问题:可能是网络连接不稳定或延迟过高,导致数据包在传输过程中丢失或延迟。2.MySQL服务器负载过高:如果MySQL服务器负载过高,无法及......
  • 连接redis后 ,报错: ERR wrong number of arguments for ‘hset‘ command“怎么解决
    原因:ERRwrongnumberofargumentsfor‘hset‘command触发代码 解决方法:可能是java不匹配我本地3.2版本的redis,我换一个更大版本的redis就解决了 ......
  • Jar包替换文件报错
    Ithasbeencompressedandnestedjarfilesmustbestoredwithoutcompression.Pleasecheckthemechanismusedtocreateyourexecutablejarfile替换jar包的img文件后启动报错解决方案首先要把lib下的jar包拉出来,进行文件替换,压缩方式使用存储;然后将jar包再拉到li......