2023年-亲测可用Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist Centos8最近版本的问题
Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
Centos8最近版本的问题(只有8有问题)【2022-04-18亲测可用】
大家都知道Centos8于2021年年底停止了服务,大家再在使用yum源安装时候,出现下面错误“错误:Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist”
========
解决办法:
1、进入yum的repos目录
cd /etc/yum.repos.d/
2、修改所有的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-*
3、更新yum源为阿里镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
4、yum安装测试是否可以yum安装
随便找个命令测试就行
eg:
yum -y install git
==============
接下来就是配置git 获取ssh
git config --global user.name myname git config --global user.email myname@qq.com
ssh-keygen -t rsa -C tansuoname@qq.com
(邮箱要一致)
获取key
cd ~/.ssh cat id_rsa.pub
==