Ubuntu 17.04更换源

更换Ubuntu 有两种方法,一种是直接在命令行更换,还有一种是在Ubuntu 界面中更换。

第一种命令行更换:


输入:sudo /etc/apt/sources.list /etc/apt/sources.list.bak   //备份原来的源

替换为阿里云的源:

sudo vi /etc/apt/sources.list                //打开编辑sources.list

在sources.list文件中先清空里面的内容,将下面的阿里云的源复制粘贴进去:

# deb cdrom:[Ubuntu 17.04 _Zesty Zapus_ - Release amd64 (20170412)]/ zesty main restricted

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

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

## 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/ zesty universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ zesty universe
deb http://mirrors.aliyun.com/ubuntu/ zesty-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ zesty-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/ zesty multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ zesty multiverse
deb http://mirrors.aliyun.com/ubuntu/ zesty-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ zesty-updates multiverse

## 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/ zesty-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ zesty-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 zesty partner
# deb-src http://archive.canonical.com/ubuntu zesty partner


最后再更新源,使之生效:

sudo apt-get update

第二种方法直接在界面打开:

Ubuntu 17.04更换源_第1张图片

再进入software&updates:


Ubuntu 17.04更换源_第2张图片

Ubuntu 17.04更换源_第3张图片

选择自己所需要的源,

Ubuntu 17.04更换源_第4张图片

过程完成,说明更新完成。

你可能感兴趣的:(Linux)