Ubuntu 修改 apt 源为阿里云源

软件源 Software Source

软件源是指用于存储各种 Linux 应用程序的存储库,包括自由或非自由软件。这个存储库可以是网站、光盘,或者是本地磁盘上的一个目录。你可以将软件源理解成是 Ubuntu 提供的一个 Linux 应用程序集市,几乎所有的应用程序都可以在这个集市上找到。

集市

安装好 Ubuntu 系统之后,默认的源会指向 http://cn.archive.ubuntu.com,但是这个源地址在某些地区会出现无法连接或者是连接速度慢的情况,这时候我们可以更换一个更快的源来实现软件安装的需求,国内有名的源包括:

本文以阿里云为例,说明如何修改 ubuntu 软件源。

使用说明

图形界面(新手推荐)

  1. 点击屏幕左下角的程序清单,选择 Software & Updates 图标

Software & Updates
2. 在 “Download from” 列表框中选择 “Other…”
3. 在弹出的对话框中,找到 “mirrors.aliyun.com”
4. 点击 Choose Server 按钮生效。

Choose a Download Server

手动修改配置文件

此处可直接跳转至阿里云的镜像页面 https://developer.aliyun.com/mirror/,在该页面中点击 ubuntu 链接进入配置页面。

  1. 将现有的 sources.list 文件改名备份

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
  2. 用你最熟悉的编辑器打开 sources.list 文件,比如:

    sudo gedit /etc/apt/sources.list
    
  3. 删除文件中的所有内容

  4. 然后将阿里云的源粘贴进去

Ubuntu 18.04 配置如下

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

# deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

其他版本的源配置建议参考阿里云给出的配置文本。

  1. 最后更新 apt 本地缓存

    sudo apt update
    

相关链接

欢迎关注我的公众号:飞翔的小黄鸭
也许会发现不一样的风景


△ \triangle Ubuntu 软件包管理利器 - 新立得 (Synaptic)
▽ \bigtriangledown Ubuntu 18.04 安装 fcitx 中文输入法

  • 7
    点赞
  • 53
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值