yum安装软件内容

linux  yum源改为阿里yum源

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

或者

 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

 CentOS 6

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

 或者

 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

 CentOS 7

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 或者 

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 3、之后运行yum makecache生成缓存

  解决 yum [Errno 256] No more mirrors to try

 输入下面的命令即可解决问题:

                        1.yum clean all         清除yum缓存

                              2. yum makecache   生成缓存

                              3. yum update          可更新全部

Centos6.9 yum安装htop报错解决过程

今天在学习linux过程中需要安装htop,但是我在直接yum -y install htop之后,系统提示:

No package htop available.
Error: Nothing to do 
我知道应该是没有安装成功的,但还是抱着侥幸的心理,输入htop命令,系统提示
[root@oldboy ~]# htop
-bash: htop: command not found
至此,最终肯定htop没有安装成功,于是就开始查找没有安装上的原因。
由于htop是一个扩展工具,是一个强大的进程管理前端工具,一般在centos系统源中没有,所以需要去fedora-epel(epel extra packages for enterprises linux 企业级linux扩展软件包)中下载。所以先安装 epel-release 
1、 对应centos版本安装
centos 6 
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

centos7
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

安装好之后在安装htop ,这次没有报错
yum -y install htop

2、第二个解决办法 
步骤一:yum install -y epel-release 
步骤二:yum install -y htop

安装  lrzsz  用于linux和windows 上传和下载文件

yum -y install lrzsz    上传到linux   #rz  下载到windows #sz  文件名

来源:站长百科

猜你喜欢

转载自www.cnblogs.com/1994july/p/13184470.html
今日推荐