centos7 用yum命令安装wget无法安装

执行yum -y install wget时,终端报错

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>

解决办法:

复制这段代码运行,默认源无法下载,从阿里云更新下载源

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

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在配置CentOS 7的yum源时,如果没有wget命令,你可以使用curl命令来下载所需的yum源文件。以下是使用curl命令下载阿里云的yum源文件的示例: ``` curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo ``` 这将从阿里云的镜像站点下载CentOS 7的yum源文件,并保存到/etc/yum.repos.d/CentOS-Base.repo路径下。你可以根据需要修改文件名和路径。 请注意,使用curl命令下载文件时,需要确保你的系统已经安装了curl工具。如果没有安装,可以使用以下命令进行安装: ``` yum install curl ``` 这样就可以使用curl命令来下载yum源文件了。 #### 引用[.reference_title] - *1* [CentOS7配置yum源](https://blog.csdn.net/l876460925/article/details/127411727)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [虚拟机给Centos7配置yum源(本地yum和网络yum)](https://blog.csdn.net/LShuo666/article/details/129021403)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值