找回密码
 注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 636|回复: 0

ubuntu20.04 更换国内163源、阿里源、清华源、中科大源

[复制链接]
发表于 2022-1-18 12:15:23 | 显示全部楼层 |阅读模式
本帖最后由 super 于 2022-1-18 12:20 编辑

第一步:备份源文件:
  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
复制代码
第二步:编辑/etc/apt/sources.list文件

在文件最前面添加以下条目(操作前请做好相应备份):
  1. vi /etc/apt/sources.list
复制代码
按esc, 键入dG,删除已有文字。(dG:猜测为delete Global)

第三步:复制清华源
esc -- : -- wq
第四步:apt update && apt upgrade

  1. <p>网易163源</p><p>
  2. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

  3. deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
  4. deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
  5. deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
  6. deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
  7. # deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
  8. # deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
  9. # deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
  10. # deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
  11. # 预发布软件源,不建议启用
  12. # deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
  13. # deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
复制代码

第三步:执行更新命令:
  1. <p>sudo apt-get update</p><p>sudo apt-get upgrade</p>
复制代码

常用国内源:

阿里云源

  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

  11. 清华源

  12. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

  13. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

  14. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

  15. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

  16. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

  17. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

  18. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

  19. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

  20. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

  21. # 预发布软件源,不建议启用

  22. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

  23. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

  24. 中科大源

  25. deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse

  26. deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse

  27. deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

  28. deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

  29. deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

  30. deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

  31. deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse

  32. deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse

  33. deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

  34. deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

  35. 网易163源

  36. deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse

  37. deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse

  38. deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse

  39. deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse

  40. deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse

  41. deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse

  42. deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse

  43. deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse

  44. deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse

  45. deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
复制代码



done!


您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|中国飞逸网

GMT+8, 2024-11-24 19:09

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表