怎么修改Ubuntu的源列表(source list)详解

 更新时间:2020年8月25日 07:52  点击:2133

简介

Ubuntu缺省的配置的源并不是国内的服务器,下载更新软件都比较慢,本文介绍如何设置源列表,选择比较快的源以节省下载时间。

配置步骤

1. 备份源列表

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

2. 选择合适的源,替换原文件的内容,保存编辑好的文件

以阿里云更新服务器为例(从实际测试上结果分析,个人认为阿里云比网易和搜狐的服务器要快):

deb http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse

根据具体使用的Ubuntu的版本不同,将上述文本中XXXXX替换为下面对应版本的字符串:

Utopic(14.10):     utopic
Trusty(14.04):     trusty
Precise(12.04):  precise
Lucid(10.04):      lucid

3. 刷新列表

sudo apt-get update

更新完毕后,再次安装源时,将从新服务器上下载源包。

备注:

Ubuntu 16.04 TLS版本镜像源:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

总结

到此这篇关于怎么修改Ubuntu的源列表(source list)的文章就介绍到这了,更多相关修改Ubuntu源列表(source list)内容请搜索猪先飞以前的文章或继续浏览下面的相关文章希望大家以后多多支持猪先飞!

[!--infotagslink--]

相关文章

  • 详谈Ubuntu PowerShell(小白入门必看教程)

    下面小编就为大家带来一篇详谈Ubuntu PowerShell(小白入门必看教程)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...2020-06-30
  • Ubuntu Server 18.04.5 LTS服务器版安装配置图解教程

    Ubuntu分为桌面版(desktop)和服务器版(Server),下面为大家介绍服务器版本Ubuntu Server 18.04.5 LTS的详细安装过程,需要的朋友可以参考下...2021-02-01
  • ubuntu系统中安装mysql5.6(通过二进制)

    今天工作中需要对一台ubantu的系统安装mysql,因为以前一直使用的是centos,虽然它也是类unix但是和redhat或centos命令上还是有点差别。所以通过网上查阅资料,终于安装成功了,现在将步骤分享给大家,有需要的朋友们可以参考借鉴。...2016-10-20
  • 详解Ubuntu Server下启动/停止/重启MySQL数据库的三种方式

    本篇文章主要介绍了buntu Server下启动停止重启MySQL数据库的三种方式,具有一定的参考价值,有兴趣的可以了解一下。 ...2017-01-15
  • 详解ASP.NET Core部署项目到Ubuntu Server

    这篇文章主要介绍了详解ASP.NET Core部署项目到Ubuntu Server ,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-09-22
  • Ubuntu上配置Ruby on Rails框架及RubyMine IDE开发环境

    Ruby on Rails是Ruby世界中当仁不让的Web框架代表,甚至可以说Rails推动了Ruby的流行,这里我们就来看一下如何在Ubuntu上配置Ruby on Rails框架及RubyMine IDE开发环境...2020-06-30
  • Ubuntu配置Pytorch on Graph (PoG)环境过程图解

    这篇文章主要介绍了Ubuntu配置Pytorch on Graph (PoG)环境过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下...2020-11-19
  • 详解Ubuntu18.04配置VSCode+CMake的C++开发环境

    这篇文章主要介绍了详解Ubuntu18.04配置VSCode+CMake的C++开发环境,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-03-12
  • Ubuntu下MySQL及工具安装配置详解

    这篇文章主要为大家详细介绍了Ubuntu下MySQL及工具安装配置方法,感兴趣的小伙伴们可以参考一下...2016-06-24
  • ubuntu mysql 5.6版本的删除/安装/编码配置文件配置

    这篇文章主要介绍了ubuntu mysql 5.6版本的删除,安装,编码配置文件配置,需要的朋友可以参考下...2017-06-21
  • 怎么修改Ubuntu的源列表(source list)详解

    这篇文章主要给大家介绍了关于如何修改Ubuntu的源列表(source list)的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-08-25
  • ubuntu上配置Nginx+PHP5 FastCGI服务器配置

    ubuntu上配置Nginx+PHP5 FastCGI服务器配置方法, 需要的朋友可以参考下。...2016-01-27
  • Ubuntu下nginx编译安装参数配置

    这篇文章主要介绍了Ubuntu下nginx编译安装参数配置,本文总结了一些依赖库的安装以及编码配置参数,需要的朋友可以参考下...2016-01-27
  • Ubuntu自启动Mysql的三种方式

    1、、软件环境:Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64) MySQL 5.6.27 x64 2、方法一最简单的方法是执行命令:复制代码 代码如下: # update-rc.d mysql defaults Adding system startup for /etc/ini...2015-11-08
  • Ubuntu16.04安装clion全过程及步骤详解

    这篇文章主要介绍了Ubuntu16.04安装clion全过程及步骤详解,clion是一款JetBrains 推出的全新的 C/C++ 跨平台集成开发环境,在Ubuntu系统下使用方便,下面给大家分享操作步骤,需要的朋友可以参考下...2020-08-18
  • 基于PowerShell在Ubuntu系统的使用详解

    下面小编就为大家分享一篇基于PowerShell在Ubuntu系统的使用详解,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-06-30
  • ubuntu16.04.1下 mysql安装和卸载图文教程

    这篇文章主要介绍了ubuntu16.04.1下 mysql安装和卸载图文教程,非常不错,具有参考借鉴价值,需要的朋友可以参考下...2016-12-02
  • 在ubuntu下构建go语言开发环境的方法

    这篇文章主要介绍了在ubuntu下构建go语言开发环境的方法,需要的朋友可以参考下...2020-05-01
  • 在Ubuntu中安装Postgresql数据库的步骤详解

    PostgreSQL 是一款强大的,开源的,对象关系型数据库系统。它支持所有的主流操作系统,包括 Linux、Unix(AIX、BSD、HP-UX,SGI IRIX、Mac OS、Solaris、Tru64) 以及 Windows 操作系统。本文给大家介绍了在Ubuntu中安装Postgresql数据库的步骤,需要的朋友可以参考下。...2020-07-11
  • ubuntu 下编译C++代码出现的问题解决

    这篇文章主要介绍了ubuntu 下编译C++代码出现的问题解决的相关资料,需要的朋友可以参考下...2020-04-25