将Ubuntu Server 16.04软件源替换为国内阿里云源

电脑杂谈  发布时间:2020-07-08 17:19:45  来源:网络整理

ubuntu 阿里云的源_ubuntu 阿里云 源_ubuntu更新阿里云源

Ubuntu Server 16.04更新系统软件包一文中提到了更大的伟哥. 如果您在中国使用Ubuntu Linux系统,则可以考虑将Ubuntu软件的源改为国内ubuntu更新阿里云源,这样可以更快地下载和安装软件.

ubuntu 阿里云的源_ubuntu更新阿里云源_ubuntu 阿里云 源

Ubuntu的软件来源是什么?

ubuntu更新阿里云源_ubuntu 阿里云 源_ubuntu 阿里云的源

当我们使用Debian或Ubuntu的apt-get工具安装所需的软件时,实际上是从服务器获取需要安装的软件并将其安装在本地计算机上. 所谓软件源是我们从中获取软件的源. 它在/etc/apt/sources.list文件中定义.

ubuntu 阿里云 源_ubuntu 阿里云的源_ubuntu更新阿里云源

默认sources.list文件的内容如下:

ubuntu 阿里云 源_ubuntu 阿里云的源_ubuntu更新阿里云源

  1. #
  2.  
  3. # deb cdrom:[Ubuntu-Server 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.8)]/ xenial main restricted
  4.  
  5. #deb cdrom:[Ubuntu-Server 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.8)]/ xenial main restricted
  6.  
  7. # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
  8. # newer versions of the distribution.
  9. deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
  10. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
  11.  
  12. ## Major bug fix updates produced after the final release of the
  13. ## distribution.
  14. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
  15. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
  16.  
  17. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  18. ## team. Also, please note that software in universe WILL NOT receive any
  19. ## review or updates from the Ubuntu security team.
  20. deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
  21. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
  22. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
  23. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
  24.  
  25. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  26. ## team, and may not be under a free licence. Please satisfy yourself as to
  27. ## your rights to use the software. Also, please note that software in
  28. ## multiverse WILL NOT receive any review or updates from the Ubuntu
  29. ## security team.
  30. deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
  31. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
  32. deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
  33. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
  34.  
  35. ## N.B. software from this repository may not have been tested as
  36. ## extensively as that contained in the main release, although it includes
  37. ## newer versions of some applications which may provide useful features.
  38. ## Also, please note that software in backports WILL NOT receive any review
  39. ## or updates from the Ubuntu security team.
  40. deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
  41. # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
  42.  
  43. ## Uncomment the following two lines to add software from Canonical's
  44. ## 'partner' repository.
  45. ## This software is not part of Ubuntu, but is offered by Canonical and the
  46. ## respective vendors as a service to Ubuntu users.
  47. # deb http://archive.canonical.com/ubuntu xenial partner
  48. # deb-src http://archive.canonical.com/ubuntu xenial partner
  49.  
  50. deb http://security.ubuntu.com/ubuntu xenial-security main restricted
  51. # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
  52. deb http://security.ubuntu.com/ubuntu xenial-security universe
  53. # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
  54. deb http://security.ubuntu.com/ubuntu xenial-security multiverse
  55. # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

如您所见,官方默认来源是美国的us.archive.ubuntu.com和security.ubuntu.com. 那么ubuntu更新阿里云源,我们如何转向更快的国内来源?非常简单,复制并备份/etc/apt/sources.list文件,然后将原始内容修改为本地来源的URL. 以下步骤以阿里云的来源为例:

1. 复制并备份原始配置文件

sudo cp /etc/apt/sources.list sources.list.bak

2. 使用您喜欢的文本编辑器(例如vi / vim / nano),打开sources.list文件,然后将原始内容替换为以下内容:


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-273153-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...