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

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

备份/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可以参考以下步骤: 1. **查看系统版本和CPU架构**:使用以下命令查看系统版本和CPU架构。 ```bash cat /etc/kylin-release uname -p ``` 例如查看系统版本输出可能为 `Kylin Linux Advanced Server release V10 (Tercel)`,查看CPU架构输出可能为 `aarch64` 等 [^2]。 2. **备份原有yum配置文件**:银河麒麟v10yum配置文件在 `/etc/yum.repos.d/local.repo`,建议先备份再修改,或者新建一个文件。进入 `/etc/yum.repos.d/` 文件夹,输入 `ls` 可以看到有两个文件。使用以下命令备份原有配置文件。 ```bash cd /etc/yum.repos.d/ cp local.repo local.repo.bak ``` 3. **创建新的阿里yum配置文件**:可以新建一个配置文件,比如 `aliyun.repo`,并编辑其内容以配置阿里yum。以配置CentOS 8阿里yum为例,不同的CPU架构和系统版本对应的内容可能不同,以下是一个示例。 ```bash vi aliyun.repo ``` 在打开的文件中添加以下内容(根据实际系统版本和CPU架构调整): ```plaintext [baseos] name=CentOS-8 - Base - mirrors.aliyun.com baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-centosofficial [appstream] name=CentOS-8 - AppStream - mirrors.aliyun.com baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-centosofficial ``` 4. **清理和更新yum缓存**:配置好新的yum后,需要清理原有的yum缓存并生成新的缓存。 ```bash yum clean all yum makecache ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值