一键换源

aya 2020-04-03 18:22:20 浏览次数:

没错我就是来水一贴,随便抢某硝酸饭碗(手动狗头)
以下代码复制粘贴回车即可一键换源

cd /etc/apt/&&
cp sources.list sources.list.bk&&
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free  >  sources.list&&
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free  >>  sources.list&&
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free  >>  sources.list&&
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free  >>  sources.list&&
echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free  >>  sources.list&&
echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free  >>  sources.list&&
echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free  >>  sources.list&&
echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free >>  sources.list&&
apt update&&
echo 换源已完成!&&
cd /home

共 8 条回复

timaker

还是喜欢复制粘贴

aya

@xiaosuan2b 这些天没怎么看回复 第一个echo > 会直接覆盖sources.list原文件,所以不用注释了
不加upgrade是因为只是换个源就全升级一遍有点没必要,如果有需求可以自行apt upgrade
引用代码随意,反正都是给别人用的233

xiaosuan2b
好水啊

可以授权我把完整代码直接引用到我的帖子吗?

xiaosuan2b
好水啊

最好把官方源注释掉,加上upgrade

xiaosuan2b
好水啊

“一键换源”的键去哪了? 违法广告法!

xiaosuan2b
好水啊

“一键还原”的键去哪了? 违法广告法!

xiaosuan2b
好水啊

23333

Bill
站长

牛!