linux更新源管理

Posted 戴怪兽

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux更新源管理相关的知识,希望对你有一定的参考价值。

1.备份源

主要防止在更新了新的源之后出现错误情况,备份一下现有的源

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

2.编辑sources.list文件

用vim编辑器编辑

sudo vi sources.list

先将原来文件内容全部删除,vim命令是dG

3.添加源

亲测阿里云的源非常好用

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
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 #Added by software-properties
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 restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

4.更新

sudo apt update

以上是关于linux更新源管理的主要内容,如果未能解决你的问题,请参考以下文章

solus linux 更新源

linux发行版的软件包安装管理程序

CentOS怎么修改yum更新源

Linux yum源完全配置

linux-安装及管理程序 yum源

服务/软件管理:50---Linux更换镜像源