华为 ARM 架构服务器 CentOS7 yum 源

注意:arm架构的yum源配置暂时未能成功通过阿里云镜像,网易镜像成功创建。

下面就arm架构服务器中centos7配置yum源进行介绍。

1.清除缓存

yum clean all

2.创建备份目录

mkdir /etc/yum.repos.d/bak

3.备份

mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak

4.创建依赖文件

在 /etc/yum.repos.d/目录下创建一下三个文件,如下所示
file

文件1: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-7 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/7/os/$basearch/
#baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/
gpgcheck=0
enabled=1
#gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

#released updates 
[updates]
#name=CentOS-7 - Updates - mirrors.aliyun.com
#failovermethod=priority
#baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/updates/$basearch/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32 

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

#additional packages that extend functionality of existing packages
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/extras/$basearch/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

[centosplus]
#name=CentOS-7 - Plus - mirrors.aliyun.com
#failovermethod=priority
#baseurl=http://mirrors.aliyun.com/centos/7/centosplus/$basearch/
#gpgcheck=1
#enabled=0
#gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

name=CentOS-$releasever - Plus
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32

#contrib - packages by Centos Users
#[contrib]
#name=CentOS-7 - Contrib - mirrors.aliyun.com
#failovermethod=priority
#baseurl=http://mirrors.aliyun.com/centos/7/contrib/$basearch/
#gpgcheck=1
#enabled=0
#gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

文件2:ceph.repo

[ceph]
name=ceph
baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/aarch64/
gpgcheck=0
[ceph-noarch]
name=cephnoarch
baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/noarch/
gpgcheck=0

文件3:epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=0

5.建立缓存

yum makecache

如果在建立缓存的时候报如下错,可通过以下方法解决:

File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e:

问题原因:

原因为升级python后新建了软连接指向了新版本,除非同时升级yum不然无法使用。需要手动更改报错文件指向python2后即可解决。

解决方法:

找出python2.7的路径

 whereis python

file

编辑报错的配置文件,vim /usr/libexec/urlgrabber-ext-down; 在文件开头添加python2.7的路径

file

解决了以上问题后,重新makecache

[root@Demo-1-1-kylin yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
base                                                                                                                                              | 3.6 kB  00:00:00     
epel                                                                                                                                              | 5.4 kB  00:00:00     
extras                                                                                                                                            | 2.9 kB  00:00:00     
updates                                                                                                                                           | 2.9 kB  00:00:00     
(1/13): base/aarch64/group_gz                                                                                                                     | 153 kB  00:00:00     
(2/13): base/aarch64/filelists_db                                                                                                                 | 6.2 MB  00:00:00     
(3/13): base/aarch64/other_db                                                                                                                     | 2.1 MB  00:00:00     
(4/13): epel/aarch64/group_gz                                                                                                                     |  88 kB  00:00:00     
(5/13): epel/aarch64/updateinfo                                                                                                                   | 1.0 MB  00:00:04     
(6/13): epel/aarch64/prestodelta                                                                                                                  | 3.5 kB  00:00:00     
(7/13): epel/aarch64/other_db                                                                                                                     | 3.2 MB  00:00:12     
(8/13): extras/7/aarch64/filelists_db                                                                                                             | 332 kB  00:00:00     
(9/13): extras/7/aarch64/other_db                                                                                                                 | 150 kB  00:00:00     
(10/13): updates/7/aarch64/other_db                                                                                                               | 922 kB  00:00:00     
(11/13): updates/7/aarch64/filelists_db                                                                                                           | 3.6 MB  00:00:00     
(12/13): epel/aarch64/updateinfo_zck                                                                                                              | 1.5 MB  00:00:04     
(13/13): epel/aarch64/filelists_db                                                                                                                |  11 MB  00:00:39     
Metadata Cache Created
[root@VM-16-16-kylin yum.repos.d]# 

004、测试效果

yum install sqlite*

file

6.成功

file

> yum list | grep openstack

ansible-openstack-modules.noarch         0-20140902git79d751a.el7        epel   
centos-release-openstack-queens.noarch   1-2.el7.centos                  extras 
centos-release-openstack-rocky.noarch    1-1.el7.centos                  extras 
centos-release-openstack-stein.noarch    1-1.el7.centos                  extras 
centos-release-openstack-train.noarch    1-1.el7.centos                  extras 

相关文章:
华为 arm架构服务器 centos7 yum源
arm架构服务器 centos7 更换yum源
File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e:
ARM架构服务器centos7.4上yum安装k8s教程

为者常成,行者常至