SuperManito / LinuxMirrors

GNU/Linux 更换系统软件源脚本
https://linuxmirrors.cn
MIT License
2.11k stars 280 forks source link

腾讯云轻量全部源均修改失败 #19

Closed 1834423612 closed 1 year ago

1834423612 commented 1 year ago

1. 处理器架构

2. 使用环境

3. 使用环境版本

A:Linux VM-8-15-centos 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

4. 详细叙述您的问题

(1) 具体问题

A:执行脚本后提示Linux VM-8-15-centos 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 换源均错误

(2) 详细的系统日志

A:

+---------------------------------------------------+
|                                                   |
|   =============================================   |
|                                                   |
|       欢迎使用 Linux 一键更换国内软件源脚本       |
|                                                   |
|   =============================================   |
|                                                   |
+---------------------------------------------------+

#####################################################

            提供以下国内软件源可供选择:

#####################################################

 ❖   阿里云              1)
 ❖   腾讯云              2)
 ❖   华为云              3)
 ❖   网易                4)
 ❖   搜狐                5)
 ❖   清华大学            6)
 ❖   浙江大学            7)
 ❖   南京大学            8)
 ❖   重庆大学            9)
 ❖   兰州大学           10)
 ❖   上海交通大学       11)
 ❖   哈尔滨工业大学     12)
 ❖   中国科学技术大学   13)

#####################################################

        运行环境  CentOS Linux 7 x86_64
        系统时间  2023-01-30 00:11:35

#####################################################

└─ 请选择并输入你想使用的软件源 [ 1-13 ]:2

  └─ 默认使用镜像站的公网地址,是否继续? [Y/n] y

  └─ 检测到系统已安装 EPEL 扩展源,是否替换/覆盖为国内源? [Y/n] y

└─ 软件源是否使用 HTTP 协议? [Y/n] y

└─ 检测到系统存在已备份的 repo 源文件,是否覆盖备份? [Y/n] y

[*] 开始同步软件源...

已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Determining fastest mirrors
base                                                                                                           | 3.6 kB  00:00:00     
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tencentyun.com; 没有与主机名关联的地址"
正在尝试其它镜像。

 One of the configured repositories failed (EPEL for redhat/centos 7 - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=epel ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable epel
        or
            subscription-manager repos --disable=epel

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=epel.skip_if_unavailable=true

failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tencentyun.com; 没有与主机名关联的地址"

[ERROR] 软件源同步失败

请再次执行脚本并更换软件源后进行尝试,如果仍然同步失败那么可能由以下原因导致
1. 网络问题:例如网络异常、网络间歇式中断、由地区影响的网络因素等
2. 软件源问题:所选镜像站正在维护,或者出现罕见的少数文件同步出错导致软件源同步命令执行后返回错误状态
SuperManito commented 1 year ago

1. 处理器架构

  • [x] x86_64 x86_32
  • [ ] arm64 arm/v8 arm/v7 arm/v6
  • [ ] ppc64le s390x
  • [ ] Other

2. 使用环境

  • [ ] Debian
  • [ ] Ubuntu
  • [ ] Kali Linux
  • [ ] Red Hat Enterprise Linux
  • [x] CentOS
  • [ ] Fedora

3. 使用环境版本

A:Linux VM-8-15-centos 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

4. 详细叙述您的问题

(1) 具体问题

A:执行脚本后提示Linux VM-8-15-centos 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 换源均错误

(2) 详细的系统日志

A:

+---------------------------------------------------+
|                                                   |
|   =============================================   |
|                                                   |
|       欢迎使用 Linux 一键更换国内软件源脚本       |
|                                                   |
|   =============================================   |
|                                                   |
+---------------------------------------------------+

#####################################################

            提供以下国内软件源可供选择:

#####################################################

 ❖   阿里云              1)
 ❖   腾讯云              2)
 ❖   华为云              3)
 ❖   网易                4)
 ❖   搜狐                5)
 ❖   清华大学            6)
 ❖   浙江大学            7)
 ❖   南京大学            8)
 ❖   重庆大学            9)
 ❖   兰州大学           10)
 ❖   上海交通大学       11)
 ❖   哈尔滨工业大学     12)
 ❖   中国科学技术大学   13)

#####################################################

        运行环境  CentOS Linux 7 x86_64
        系统时间  2023-01-30 00:11:35

#####################################################

└─ 请选择并输入你想使用的软件源 [ 1-13 ]:2

  └─ 默认使用镜像站的公网地址,是否继续? [Y/n] y

  └─ 检测到系统已安装 EPEL 扩展源,是否替换/覆盖为国内源? [Y/n] y

└─ 软件源是否使用 HTTP 协议? [Y/n] y

└─ 检测到系统存在已备份的 repo 源文件,是否覆盖备份? [Y/n] y

[*] 开始同步软件源...

已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Determining fastest mirrors
base                                                                                                           | 3.6 kB  00:00:00     
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tencentyun.com; 没有与主机名关联的地址"
正在尝试其它镜像。

 One of the configured repositories failed (EPEL for redhat/centos 7 - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=epel ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable epel
        or
            subscription-manager repos --disable=epel

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=epel.skip_if_unavailable=true

failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try.
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tencentyun.com; 没有与主机名关联的地址"

[ERROR] 软件源同步失败

请再次执行脚本并更换软件源后进行尝试,如果仍然同步失败那么可能由以下原因导致
1. 网络问题:例如网络异常、网络间歇式中断、由地区影响的网络因素等
2. 软件源问题:所选镜像站正在维护,或者出现罕见的少数文件同步出错导致软件源同步命令执行后返回错误状态

mirrors.tencentyun.com 是内网用于访问镜像站的域名,如果你用的不是腾讯云的服务器那么是无法访问的,根据你运行脚本的选择我并不清楚为什么会出现这样的问题,我仔细检查了脚本逻辑没有发现存在bug,这可能是由于你本地环境所导致,这是一个令人匪夷所思的问题

根据脚本规则,所有的软件源配置文件都会先选择备份然后全部删除/清空,之后统一用官方模板重新创建,建议展示下你的 /etc/yum.repos.d/epel.repo 配置内容