首页 > 系统相关 >centos os7 和redhat 7 安装yum源失败的解决办法

centos os7 和redhat 7 安装yum源失败的解决办法

时间:2023-10-25 17:12:50浏览次数:26  
标签:http centos redhat mirrors repos os7 base yum com

首先看我的报错

[Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"

yum源配置出现了问题

cd /etc/yum.repos.d/
vi local.repo#里面装的是Centos-7.repo Centos-Base.repo
查看内容如下
# CentOS-Base.repo
#
# The mirror system uses the connecting
# update status of each mirror to pick 
# geographically close to the client.  
# unless you are manually picking other
#
# If the mirrorlist= does not work for 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - mirror
failovermethod=priority
baseurl=http://mirrors.aliyun.com/cento
        http://mirrors.aliyuncs.com/cen
        http://mirrors.cloud.aliyuncs.c
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/

就会发现$releasever重复出现多次,导致url地址不正确
验证:
1.复制url地址到浏览器中看是否能够访问
image

访问不了,说明url地址确实出现了错误
修改url地址
输入 ":" 进入末行模式
然后输入 %s/$releasever/7/g
保存并退出
然后发现有了新的问题
yum clean all
报错

Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Cleaning repos: base etras extras
     ...: train updates updatess virt
Other repos take up 11 M of disk space (use --verbose for details)

Loaded plugins: fastestmirror

fastestmirror是yum的一个加速插件
这个地方是插件提示信息
意思是插件不能用了。
既然不能用了,那我们就禁用它

1.修改插件的配置文件

vi /etc/yum/pluginconf.d/fastestmirror.conf

enabled = 1//由1改为0,禁用该插件

2.修改yum的配置文件
vi /etc/yum.conf

plugins=1//改为0,不使用插件

3 清除缓存并重新构建yum 源
yum clean all
yum clean dbcache
yum makecache

然后发现仍然yum clean不成功

Repository base is listed more than once in the configuration

说有重复的名称
改名字或者删除
这里我选择删除掉aliyun的yum源

yum clean all

仍然报错

Cleaning repos: base etras train updatess virt
Other repos take up 11 M of disk space (use --verbose for details)

清洁存储库:其他存储库占用 11 M 磁盘空间(有关详细信息,请使用 --verbose)


回溯快照
仍然报错

[root@controller yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Bad id for repo: root@controller yum.repos.d, byte = @ 4
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Cleaning repos: base extras train updates virt
Other repos take up 11 M of disk space (use --verbose for details)

下次再写吧无语了

标签:http,centos,redhat,mirrors,repos,os7,base,yum,com
From: https://www.cnblogs.com/humlogs/p/17787440.html

相关文章

  • CentOS_7安装docker
    CentOS_7安装dockerInstallDockerEngineonCentOS官网文档:https://docs.docker.com/engine/install/centos/#1更新依赖sudoyumupdate#2卸载旧docker及其依赖(如果有就执行)并删除资源sudoyumremovedocker\docker-client\......
  • RecureCRT连接VMware虚拟机Centos7及网络配置
    1.确认物理机ip地址2.打开VMware,点击网络适配器并且选择NET模式3.打开WMware,点击左上角编辑,虚拟网络编辑器,设置子网ip和子网掩码 4.设置好之后点击上图中的NET设置,查看网关IP5.打开并进入虚拟机,配置网络信息,输入如下命令:vim/etc/sysconfig/network-scripts/ifconfig-e**......
  • centos7.9设置永久明细路由
    centos7.9设置永久明细路由1.创建配置文件/etc/sysconfig/static-routesstatic-routes默认没有此文件,需要手动创建2.编辑配置文件static-routes,添加以下内容:anynet10.86.134.0/24gw202.96.104.1#上面意思为10.86.134.0/24的网络数据都从202.96.104.1访问。也就是202.96.104.1......
  • centos7安装Docker(2023/10/24)
    centos7安装Docker(2023/10/24)一、安装前必读系统配置方面,这里使用的是Centos7Linux内核:官方建议3.10以上。注意:本文的命令使用的是root用户登录执行,非root用户所有命令前面要加sudo1.查看当前的内核版本1uname-r如图为3.10,满足条件。 2.使用root权限更......
  • 【CentOS7】启动 CentOS7 系统时卡在开机界面 7 解决办法
    【CentOS7】启动CentOS7系统时卡在开机界面7解决办法本文参考:https://www.51c51.com/danpianji/xinxi/89/73120.html目录一、问题如题二、解决步骤1.进入grub界面2.修改BIOSLegacy或UEFIBIOS模式启动的3.挂载系统根&RW读写权限4.修改/etc/selinux/config配置......
  • Centos7部署Zabbix6.4(手把手学会)
    编译安装zabbix1、在编译之前,先要安装几个编译环境,不然没法编译[root@zabbix~]#yuminstalllibevent-devel-y[root@zabbix~]#yuminstall-ynet-snmp-devel[root@zabbix~]#yum-yinstallmysql-devel2、由于CentOS7默认的gcc版本较低为4.8,因此无法顺利编译安装成......
  • centos修改ip
    1.查看网卡ipaddr2.进入配置文件路径cd/etc/sysconfig/network-scripts3.查看路径下文件ls4.编辑网卡配置文件vimifcfg-eth05.文件内容参考TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=......
  • Centos7 安装/卸载 vsftpd
    安装vsftpd[root@localhost~]#yum-yinstallvsftpd查看安装路径[root@localhost~]#whereisvsftpdvsftpd:/usr/sbin/vsftpd/etc/vsftpd/usr/share/man/man8/vsftpd.8.gz查看目录[root@localhost~]#ll/etc/vsftpd/-rw-------1rootroot125Mar222017ftpuser......
  • Centos7 - ftp login 530
    问题描述[root@localhostdevops]#ftp192.168.18.12938001Connectedto192.168.18.129(192.168.18.129).220(vsFTPd3.0.2)Name(192.168.18.129:root):test3331Pleasespecifythepassword.Password:530Loginincorrect.Loginfailed.查看/etc/vsftpd/ftpusers-......
  • centos7磁盘动态扩容
    1.查看磁盘空间df-h  2.fdisk-l  查看当前的磁盘分区信息(主要是分区表信息) linux新增磁盘后,用fdisk等命令查询不到#ls/sys/class/scsi_host/(会看到有host0、host1...hostN,对每个host进行如下操作) echo"---">/sys/class/scsi_host/host0/scanecho"--......