Erlo

Linux下加速软件源访问(中科大)

2022-04-05 15:00:01 发布   266 浏览  
页面报错/反馈
收藏 点赞

警告:操作前请先做好备份。
可参考下面的备份方法:
在你想要备份到的目录里打开终端,执行下面的命令。

备份
tar -jpcvf apt.`date +%Y-%m-%d`.tar.bz2 /etc/apt/sources.list /etc/apt/sources.list.d/ /etc/apt/sources.list.save
还原
sudo tar -jxv -f apt.2022-04-05.tar.bz2  -C /

一般软件源

这里推荐中科大的镜像源,点击下面链接,选择当前使用发行版,按教程操作即可。
Ubuntu 源使用帮助
相比清华源,中科大的教程更加人性化。

如果系统是Ubuntu,可以执行以下命令:

sudo sed -i 's/cn.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

ppa源

(参考文章ubuntu里的ppa源下载速度太慢了,应该怎么解决?
依旧是USTC,参照其反向代理列表USTC Open Source Software Mirror
每个ppa都会在/etc/apt/sources.list.d/目录下创建一个list文件。
只需把里面的ppa.launchpad.net改为launchpad.proxy.ustclug.orghttp改为https即可。

也可以将以下命令直接复制到终端里执行:

sed -i 's/http://ppa.launchpad.net/launchpad.proxy.ustclug.org/g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list
sed -ri 's#(.*http)(://launchpad.proxy.ustclug.org.*)#1s2#g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

本文来自博客园,作者:Leeds_Garden,转载请注明原文链接:https://www.cnblogs.com/leedsgarden/p/16101475.html

登录查看全部

参与评论

评论留言

还没有评论留言,赶紧来抢楼吧~~

手机查看

返回顶部

给这篇文章打个标签吧~

棒极了 糟糕透顶 好文章 PHP JAVA JS 小程序 Python SEO MySql 确认