ubuntu 16.04 更换国内源(下载源)(镜像源)(换源)

167 篇文章 11 订阅

为何需要换源?

APT(Advanced Package Tool)是Debian、Ubuntu等Linux系统中的软件包管理工具,它可以用来从软件源中安装、升级、卸载软件包等。在使用APT安装软件包时,由于软件源服务器的不同地理位置、带宽等因素,可能会影响下载速度和可用性。因此,用户可以通过更换软件源来获得更快、更稳定的下载体验。

另外,有些软件包可能在官方的软件源中没有提供,但是在其他第三方的软件源中可能有提供。如果用户需要安装这些软件包,就需要更换软件源以便获取所需的软件包。

总的来说,更换软件源可以帮助用户获得更好的软件下载和使用体验。但是,用户在更换软件源时需要注意选择可靠的软件源,以避免下载安装不安全的软件包。

如何换源?

ubuntu16.04和18.04更换国内源

先备份原始源文件source.list,

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

然后用gedit打开文件:

gedit /etc/apt/sources.list

将下面内容替换进去:

(注意:下面镜像源只适用于ubuntu16.04,其他ubuntu版本要换指定版本的源,参考文章:ubuntu不同版本的源(换源)(镜像源)(lsb_release -c命令,显示当前系统的发行版代号(Codename))

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

保存退出

  • 2
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu16.04换源是为了更快地下载软件,提高软件包更新的速度。以下是Ubuntu16.04换源的方法: 1.打开终端:按Ctrl+Alt+T组合键,或者在屏幕左边的Launcher条中搜索终端。 2.备份列表:在终端中输入以下命令: sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 该命令将列表备份到当前目录下的sources.list.backup文件中。 3.添加新的:在终端中输入以下命令: sudo gedit /etc/apt/sources.list 该命令将打开一个名为sources.list的文件,在该文件中可以添加新的,例如: deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 上述的是阿里云的,也可以使用其他国内的。 4.保存并退出:关闭sources.list文件并保存更改。 5.更新软件包列表:在终端中输入以下命令: sudo apt-get update 该命令将更新软件包列表。 6.升级软件包:在终端中输入以下命令: sudo apt-get upgrade 该命令将升级软件包。 以上是Ubuntu16.04换源的方法,通过更换源可以加速软件包更新和软件下载,进一步提高操作系统的响应速度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值