问题场景是在:我想给鲲鹏云服务器安装上宝塔面板(注意:鲲鹏服务器是arm64的结构,也就是内核是aarch64的结构,和平常用的不一样),然后使用yum update和yum makecache的时候,出现下面的错误

One of the configured repositories failed (CentOS-7 - Base - 163.com),
 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. Disable the repository, 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 base

     4. 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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.163.com/centos/7/os/aarch64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"

很明显DNS不到163的源。这时候我网上找到几个办法,罗列下来(百分之九十没有用,可以看看不用试了)

①修改DNS

vim /etc/resolv.conf
然后加入
nameserver 8.8.8.8
再重新
yum update
一样出现404

②修改源,换成阿里云(!!!没错,和163源一样的问题,然后你再去修改DNS也一样,我服了)

上面两个方法是大部分网友给的,我试了没用。

 

解决办法来了:

首先我去华为云的控制中心把服务器换成centOS8.0版本后(这里换版本主要是之前换源换来换去怕把源文件弄不完整了,所以才去重装系统,你也可以不还,但如果后面的操作没用,你再换成8版本)

然后更换华为云自己的源(这个源是针对aarch64的)

操作步骤:

1、备份配置文件:

mv /etc/yum.repos.d/ /etc/yum.repos.d-bak

2、将新配置写入repo文件:

mkdir /etc/yum.repos.d

然后

echo -e "[kunpeng]\nname=CentOS-kunpeng - Base - mirrors.huaweicloud.com\nbaseurl=https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/\ngpgcheck=0\nenabled=1" >/etc/yum.repos.d/CentOS-Base-kunpeng.repo

3、更新yum源配置:

yum clean all          # 清除系统所有的yum缓存
yum makecache         # 生成yum缓存
yum update

然后就可以了!!!然后再去安装宝塔面板已经ok!🙆

此问题针对华为云鲲鹏服务器(架构是arm64的服务器也可以试试这个解决办法)

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐