Loading

centos中常见的问题(1)

(1)在使用centos中下载vim时出现以下错误:

[root@ad363123020c /]# yum install vim
问题 1: module docker:uelc20:2020230105014926:bd07c72b-0.x86_64 requires module(container-tools:uelc20), but none of the providers can be installed
  - module container-tools:uelc20:2020220902112528:b5192a5c-0.x86_64 conflicts with module(container-tools:an8) provided by container-tools:an8:2020220106133314:b4ae771c-0.x86_64
  - module container-tools:an8:2020220106133314:b4ae771c-0.x86_64 conflicts with module(container-tools:uelc20) provided by container-tools:uelc20:2020220902112528:b5192a5c-0.x86_64
  - module container-tools:uelc20:2020221229072209:b5192a5c-0.x86_64 conflicts with module(container-tools:an8) provided by container-tools:an8:2020220106133314:b4ae771c-0.x86_64
  - module container-tools:an8:2020220106133314:b4ae771c-0.x86_64 conflicts with module(container-tools:uelc20) provided by container-tools:uelc20:2020221229072209:b5192a5c-0.x86_64
  - module container-tools:uelc20:2020230130082020:b5192a5c-0.x86_64 conflicts with module(container-tools:an8) provided by container-tools:an8:2020220106133314:b4ae771c-0.x86_64
  - module container-tools:an8:2020220106133314:b4ae771c-0.x86_64 conflicts with module(container-tools:uelc20) provided by container-tools:uelc20:2020230130082020:b5192a5c-0.x86_64
  - conflicting requests
问题 2: module rust-toolset:uelc20:2020221215055743:301fb081-0.x86_64 requires module(llvm-toolset:uelc20), but none of the providers can be installed
  - module llvm-toolset:uelc20:2020220702202350:37d8506f-0.x86_64 conflicts with module(llvm-toolset:an8) provided by llvm-toolset:an8:2020211222153255:37d8506f-0.x86_64
  - module llvm-toolset:an8:2020211222153255:37d8506f-0.x86_64 conflicts with module(llvm-toolset:uelc20) provided by llvm-toolset:uelc20:2020220702202350:37d8506f-0.x86_64
  - module llvm-toolset:uelc20:2020221115064120:37d8506f-0.x86_64 conflicts with module(llvm-toolset:an8) provided by llvm-toolset:an8:2020211222153255:37d8506f-0.x86_64
  - module llvm-toolset:an8:2020211222153255:37d8506f-0.x86_64 conflicts with module(llvm-toolset:uelc20) provided by llvm-toolset:uelc20:2020221115064120:37d8506f-0.x86_64
  - conflicting requests

 问题原因:模块依赖错误

 解决方法:

  #先通过如下命令查询模块状态
  dnf module info container-tools
  #在使用如下命令重启模块
  dnf module reset llvm-toolset -y

 扩展 :

  #启用模块:
  dnf module enable xxx
  #禁用模块:
  dnf module disable xxx
  #查看模块详情:
  dnf module info xxx
  #模块列表:
  dnf module list xxx 

(2)在使用centos中下载vim时出现以下错误:

[root@ad363123020c /]# yum install vim
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream                                                                   84  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

解决思路:

  • 使用翻译可以得出报错类型为源未找到,故可以确定为yum的问题
  • 那么只要换掉yum的依赖就ok了
  • 更换yum的步骤
#首先,进入到 yum 的 repos 目录
cd /etc/yum.repos.d/
#其次,修改 centos 文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
#然后,生成缓存更新(第一次更新,速度稍微有点慢,耐心等待两分钟左右)
yum makecache
#最后,运行 yum update 并重新安装 vim
yum update -y
yum -y install vim

 

posted @ 2024-03-06 16:18  小马窝  阅读(101)  评论(0)    收藏  举报