赞
踩
直接执行下面的命令即可配置源,然后如果是其他版本的只需要执行替换语句即可完成替换
cat <<EOF > /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse EOF
在执行了Ubuntu20的源配置之后,再执行下面这个语句即可改成Ubuntu18的源
sed -i 's/focal/bionic/g' /etc/apt/sources.list
sed -i 's/focal/xenial/g' /etc/apt/sources.list
sed -i 's/focal/trusty/g' /etc/apt/sources.list
源配置参数设置完成之后,执行下面的语句即可对源信息进行更新:
sudo apt update
然后你的源就配置完成了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。