首页 > 系统相关 >linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方法

linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方法

时间:2023-10-31 16:03:31浏览次数:42  
标签:bin x86 No python yum 64 rpm el7

https://blog.csdn.net/moveym/article/details/125569233

 

一、首先了解Linux系统下这两个命令的区别

yum:

属于:RedHat系列

常见系统有:Redhat、Centos、Fedora等

apt-get:

属于:Debian系列

常见系统:Debian、Ubuntu等

# 查看当前系统版本

cat /etc/redhat-release


网易镜像系统官网:http://mirrors.163.com/centos/7/os/x86_64/Packages/

可以修改需要的版本

# 下载yum相关依赖,前提创建目录,便于查找

# 创建存放目录
1 mkdir /usr/local/src/python
2 mkdir /usr/local/src/yum
# 下载yum依赖
cd /usr/local/src/yum # yum 目录

rpm -ivh --nodeps http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

rpm -ivh --nodeps http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

rpm -ivh --nodeps http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
# 运行python -bash: python: command not found,yum 运行依赖需要python环境,所以python环境也要安装

# 下载python依赖
cd /usr/local/src/python # 进入目录

#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-2.7.5-34.el7.x86_64.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-pycurl-7.19.0-17.el7.x86_64.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-devel-2.7.5-34.el7.x86_64.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-libs-2.7.5-34.el7.x86_64.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-urlgrabber-3.10-7.el7.noarch.rpm
#wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/rpm-python-4.11.3-17.el7.x86_64.rpm
# 安装python

1、rpm -ivh python-* rpm-python-*
出现安装包的依赖问题,此时如下解决即可:
warning: python-2.7.5-34.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
libcrypto.so.10()(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libcrypto.so.10(OPENSSL_1.0.1)(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libcrypto.so.10(libcrypto.so.10)(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libgdbm.so.4()(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libnsl.so.1()(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libnsl.so.1(GLIBC_2.2.5)(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libreadline.so.6()(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libssl.so.10()(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
libssl.so.10(libssl.so.10)(64bit) is needed by python-libs-2.7.5-34.el7.x86_64
liblua-5.1.so()(64bit) is needed by rpm-python-4.11.3-17.el7.x86_64
librpm.so.3()(64bit) is needed by rpm-python-4.11.3-17.el7.x86_64
librpmbuild.so.3()(64bit) is needed by rpm-python-4.11.3-17.el7.x86_64
librpmio.so.3()(64bit) is needed by rpm-python-4.11.3-17.el7.x86_64
librpmsign.so.1()(64bit) is needed by rpm-python-4.11.3-17.el7.x86_64
rpm = 4.11.3-17.el7 is needed by rpm-python-4.11.3-17.el7.x86_64


2、rpm -ivh python-* rpm-python-* --nodeps --force
--nodeps --force为不考虑依赖包,强制安装。

安装完后即可运行python:
# 安装yum

cd /usr/local/src/yum
rpm -ivh yum-* # 如果无法安装成功参考上面代码
运行yum,完美解决


————————————————
版权声明:本文为CSDN博主「Orange_ysen」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/moveym/article/details/125569233

标签:bin,x86,No,python,yum,64,rpm,el7
From: https://www.cnblogs.com/wcxia1985/p/17800451.html

相关文章

  • Noise pollution
    Noisereferstothesoundproducedbythevocalbodywhenitdoesirregularvibration.Fromaphysiologicalpointofview,allthesoundthatinterfereswithpeople'srest,studyandworkandinterfereswiththesoundyouwanttolistento,thatis,......
  • 单细胞测序 10x genomics
     单细胞转录组从研究方向看上,发育生物学、免疫、神经生物学、肿瘤是排名靠前的方向,这和我们平时遇到的高频研究方向基本吻合。另外,作为一个新兴的领域,10X单细胞转录组检测到细胞多,数据庞大,信息复杂,对数据分析带来诸多困难,因此算法类的文章(Computationalmethod)也高达76篇。从物种......
  • Mac 中安装 vue 脚手架后报错 vue: command not found
    解决方案安装node、npm查看npm全局安装位置npmroot-g正确位置/usr/local/lib/node_modules修改位置npmconfigsetprefix/usr/local重新安装脚手架sudonpminstall-g@vue/cli查看vue版本vue-v......
  • 数据库系列:MySQL引擎MyISAM和InnoDB的比较
    1、数据库核心知识点数据库系列:MySQL慢查询分析和性能优化数据库系列:MySQL索引优化总结(综合版)数据库系列:高并发下的数据字段变更数据库系列:覆盖索引和规避回表数据库系列:数据库高可用及无损扩容数据库系列:使用高区分度索引列提升性能数据库系列:前缀索引和索引长度的取舍......
  • NOIP 2022 考前学习日记
    前言学习记录本写太乱了,所以在这里打个草稿顺便记录一下学习过程,后面总结的时候康康有没有问题11月2日(今日运势:中平)上午:再次做了一下CSP-S2022的题,除了T4以外的都订正完了听yjy讲了一下kruskal重构树,还没做练习下午:看线性代数看的想睡觉;尝试做了一下【模板】矩阵快速......
  • 8 Innovative BERT Knowledge Distillation Papers That Have Changed The Landscape
    8InnovativeBERTKnowledgeDistillationPapersThatHaveChangedTheLandscapeofNLPContemporarystate-of-the-artNLPmodelsaredifficulttobeutilizedinproduction.Knowledgedistillationofferstoolsfortacklingsuchissuesalongwithseveralothe......
  • 'ProxyError('Cannot connect to proxy.', NewConnectionError
      MicrosoftVisualC++Redistributableisnotinstalled,thismayleadtotheDLLloadfailure.                Itcanbedownloadedathttps://aka.ms/vs/16/release/vc_redist.x64.exeTraceback(mostrecentcalllast): File"E:/other/lightvit......
  • 编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of unde
    编译第三方的前端项目时候出现下面问题 ERROR Failedtocompilewith1error                                                             ......
  • -bash: java: command not found笔记
    文章目录场景解决方案找java的方法find命令进行查找根据java进程找寻具体位置场景linux系统执行java命令时报错:-bash:java:commandnotfound。解决方案可能是没有安装java(这种情况比较少)或者安装了java但是没有设置环境变量(一般是这种情况)。找java的方法find命令进行查找......
  • Windows11 安装 nvm node版本管理工具
    在Windows11上安装并配置NVM与Node.js版本管理工具引言:Node.js是一款强大的开发工具,而版本管理工具NVM则可以帮助我们在不同的项目中灵活地切换和管理Node.js版本。本篇博客将为大家介绍如何在Windows11操作系统上安装NVM(NodeVersionManager)并使用它来管理Node.......