本文主要是介绍Linux Ubuntu 修改 /etc/apt/sources.list (镜像源)文件(非常实用),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
修改 /etc/apt/sources.list 文件,也即修改镜像源,能够加快在 Ubuntu 中下载和更新相关软件数据;否则默认情况下使用的是外网,下载起来比较慢!!!
基本步骤:
1、复制一份 /etc/apt/sources.list 文件,以作备用,其中 sources-bak.list 是备份文件名;
sudo cp /etc/apt/sources.list /etc/apt/sources-bak.list
2、打开 /etc/apt/sources.list 文件;
sudo vi /etc/apt/sources.list
3、点击 D 删除里面的所有内容;
4、打开镜像源 阿里云镜像源链接 ;
5、找到 Ubuntu 对应版本的镜像;
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
6、将其内容复制到 /etc/apt/sources.list 文件下;
7、点击 ESC 然后输入“:wq”,保存并退出;
8、更新镜像源;
sudo apt update
sudo apt upgrade
这篇关于Linux Ubuntu 修改 /etc/apt/sources.list (镜像源)文件(非常实用)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!