麒麟V10配置centos8阿里yum源,简单粗暴

该文描述了在aarch64架构的KylinLinuxV10系统中,如何备份原有的yum源,并替换成阿里云的CentOS-8镜像源。通过创建或下载CentOS-Base.repo文件,然后修改内容设置多个阿里云镜像地址,确保gpgkey的验证,并最后执行yum缓存清理和更新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

备份/etc/yum.repos.d/kylin_aarch64.repo

首先查看系统版本和CPU架构

[root@localhost ~]# cat /etc/kylin-release 
Kylin Linux Advanced Server release V10 (Tercel)
[root@localhost ~]# uname -p
aarch64

新建/etc/yum.repos.d/CentOS-Base.repo文件,或者直接

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

修改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-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/BaseOS/$basearch/os/
        http://mirrors.aliyuncs.com/centos/8/BaseOS/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/extras/$basearch/os/
        http://mirrors.aliyuncs.com/centos/8/extras/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/8/extras/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/centosplus/$basearch/os/
        http://mirrors.aliyuncs.com/centos/8/centosplus/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/PowerTools/$basearch/os/
        http://mirrors.aliyuncs.com/centos/8/PowerTools/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/8/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official


[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/8/AppStream/$basearch/os/
        http://mirrors.aliyuncs.com/centos/8/AppStream/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

最后重新生成缓存

yum clean all
yum makecache
### 麒麟 V10 中 `yum install -y yum-utils` 出现错误的解决方案 在麒麟 V10 系统中,如果运行 `yum install -y yum-utils` 命令时遇到错误,可能的原因包括 YUM 软件包管理器未正确配置、缺少必要的依赖项或者系统的软件仓库地址不正确。以下是针对该问题的具体分析和解决办法: #### 1. 检查并更新系统软件库 确保系统的基础软件库是最新的,可以尝试通过以下命令来更新系统中的所有软件包: ```bash sudo yum update -y ``` 此操作有助于修复潜在的兼容性问题以及同步最新的软件列表[^2]。 #### 2. 添加或切换到合适的软件 有时默认的软件可能出现连接失败或其他异常情况。建议更换为国内稳定可靠的镜像站点(如阿里云、清华大学开镜像站)。具体步骤如下: - 编辑 `/etc/yum.repos.d/` 文件夹下的 `.repo` 文件。 - 替换其中的内容为清华的相关配置信息。例如: ```ini [docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/$releasever/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg ``` 完成修改后保存文件,并清理缓存重新加载索引数据: ```bash sudo yum clean all && sudo yum makecache fast ``` #### 3. 手动安装缺失组件 当上述方法仍未能解决问题时,则需考虑是否存在某些特定工具链丢失的情况。比如提到的 `device-mapper-persistent-data`, `lvm2` 这些都是 Docker 及其关联服务正常运作所必需的部分。因此可单独执行它们各自的安装指令: ```bash sudo yum install -y device-mapper-persistent-data lvm2 ``` 另外对于 XKB 工具集开发环境的需求,按照提示调整参数形式再试一次即可成功获取目标资[^3]: ```bash sudo yum install -y xorg-x11-xkb-utils-devel ``` #### 4. 使用 RPM 包离线部署 假如网络条件不允许在线下载所需模块,那么可以从其他已联网机器上导出对应版本号的二进制压缩文档(.rpm),之后传送到本地服务器实施手动装载过程。注意要挑选匹配当前操作系统架构与发行版代号相吻合的目标档案。 --- ### 总结 综上所述,在处理麒麟 V10 上因各种因素引发的 `yum install -y yum-utils` 失败状况时,应优先验证基础设置无误后再逐步排查高级选项直至最终达成预期成果。 ```python print("以上方案适用于大多数常规场景,请依据实际情形灵活选用合适路径加以调试优化") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值