Linux Ubuntu 修改 /etc/apt/sources.list (镜像源)文件(非常实用)


Linux Ubuntu 修改 /etc/apt/sources.list (镜像源)文件(非常实用)
https://blog.csdn.net/weixin_47156401/article/details/121093769

        修改 /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 对应版本的镜像; 


   
   
   
  1. deb http: //mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  2. deb-src http: //mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  3. deb http: //mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  4. deb-src http: //mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  5. deb http: //mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  6. deb-src http: //mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  7. deb http: //mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  8. deb-src http: //mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  9. deb http: //mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  10. deb-src http: //mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

 6、将其内容复制到 /etc/apt/sources.list 文件下;

7、点击 ESC 然后输入“:wq”,保存并退出;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM