ubuntu16.04更换阿里云源(国内官方源)教程

ubuntu16.04更换阿里云源(国内官方源)教程


替换系统下/etc/apt/sources.list文件即可

cd /etc/apt/

sudo vim sources.list

####注释   vim编辑器先按ESC进入命令模式,然后依次输入    ggVG    全选内容,
####注释   按    d    清除选中内容,按    i    进入插入模式,粘贴即可,SHIFT+INS为粘贴键。
####注释   然后再按ESC,依次输入 :wq  保存退出

别忘记执行sudo apt-get update

欢迎大家到github一起交流

https://github.com/JackYang500/ubuntu-aliyun-sources

阿里云官方源
以下是sources.list内容

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
# deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial multiverse
# deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb http://mirrors.aliyun.com/ubuntu xenial-security multiverse
# deb-src http://mirrors.aliyun.com/ubuntu xenial-security multiverse

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要在Ubuntu16.04更换阿里云,你可以按照以下步骤进行操作: 1. 打开终端,使用以下命令备份当前的列表文件: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 2. 使用以下命令编辑列表文件: ``` sudo nano /etc/apt/sources.list ``` 3. 在文件中,你需要注释掉原来的并添加阿里云。你可以使用以下命令来替换默认: ``` deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse ``` 4. 保存并关闭文件,然后运行以下命令更新: ``` sudo apt update ``` 现在,你的Ubuntu16.04系统已经成功更换阿里云了。如果你想了解更多细节或者其他方法,你可以参考[这个链接](https://github.com/JackYang500/ubuntu-aliyun-sources)。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [ubuntu16.04更换阿里云国内官方教程](https://blog.csdn.net/weixin_43960643/article/details/88400055)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Ubuntu14.04和Ubuntu16.04更换阿里的方法](https://download.csdn.net/download/weixin_38574410/12844087)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值