CentOS6 yum install wget失败

在CentOS6.1系统上使用`yum -y install wget`时遇到报错,通过替换系统repo文件成功解决。具体步骤包括进入`/etc/yum.repos.d`目录,编辑`CentOS-Base.repo`文件,将镜像地址更改为阿里云镜像源,然后执行`yum clean all`和`yum makecache`进行缓存更新,从而恢复正常安装。
摘要由CSDN通过智能技术生成

使用CentOS 6.1 运行 yum -y install wget 安装 wget 时报错失败了,于是百度谷歌搜索了一大堆,尝试之后都不行,之后发现直接替换 repo 文件就能搞定
在这里插入图片描述
步骤如下:

1、cd /etc/yum.repos.d

2、更改CentOS-Base.repo里的内容

vi CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
 
[base]
name=CentOS-6.6 - Base
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[updates]
name=CentOS-6.6 - Updates
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[extras]
name=CentOS-6.6 - Extras
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[centosplus]
name=CentOS-6.6 - Plus
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[contrib]
name=CentOS-6.6 - Contrib
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

3、更新 yum

yum clean all

yum makecache

完成以上步骤,即可正常安装 wget

当运行"yum -y install wget"命令时,如果提示"没有可用软件包wget"的错误,可能是由于没有安装相应的软件源导致的。可以尝试以下几种方法解决该问题: 1. 确保系统已经正确连接到互联网。可以通过ping命令测试网络连接是否正常,例如"ping www.google.com"。 2. 检查系统的软件源配置,确认是否启用了正确的软件源。可以编辑/etc/yum.repos.d/目录下的repo文件,检查是否包含了正确的软件源信息。 3. 如果没有找到wget软件包,可以尝试更新软件源缓存,然后再执行安装命令。可以使用"yum clean all"清除缓存,并使用"yum makecache"重新生成缓存。 4. 可以尝试使用完整的wget软件包路径进行安装,例如"yum install -y http://mirrors.kernel.org/fedora-epel/7/x86_64/w/wget-1.19.5-8.el7.x86_64.rpm"。 综上所述,您可以尝试检查网络连接、软件源配置以及更新软件源缓存来解决"yum -y install wget"命令报错的问题。如果仍然无法解决,您可以尝试使用完整的软件包路径进行安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [yum安装wget失败,替换yum源为阿里yum源并重新安装](https://blog.csdn.net/wejack/article/details/123407556)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [CentOS7下安装Mysql5.7(完整教程-yum源)](https://download.csdn.net/download/weixin_38651165/14049045)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [yum安装wget命令](https://blog.csdn.net/magi1201/article/details/112659896)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值