科学健康资讯 · 内容仅供参考,不替代专业诊疗 联系我们|疾病百科
哈哈哈

ubuntu更换源,ubuntu换源方法(Ubuntu20.04入坑指南--软件源更换)

2023-04-29 哈哈哈 本文链接

关于【ubuntu更换源】,ubuntu换源方法,今天小编给您分享一下,如果对您有所帮助别忘了关注本站哦。

1、ubuntu更换源:Ubuntu20.04入坑指南--软件源更换

刚开始使用的时候,没有觉得哪里有问题,但是有时候通过命令行下载软件,更新软件,发现有的时候好慢好慢,为了解决,上网查找质料,发现可以通过更换软件源来解决这个问题。

我所推荐的软件源如下:

阿里云开源镜像站:

https://developer.aliyun.com/mirror/

清华大学:

https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

具体方法如下:

Ubuntu系统中,软件源文件地址为:/etc/apt/sources.list

1.备份原来的源,将以前的源备份一下,以防以后可以用的。

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

2.打开/etc/apt/sources.list文件,在前面添加如下条目,并保存。

sudo vim /etc/apt/sources.list(可将vim更换为自己熟悉的编辑器)

#添加阿里源deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse#添加清华源deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

3.更新

更新源

sudo apt-get update

如出现依赖问题,解决方式如下:

sudo apt-get -f install

更新软件:

sudo apt-get upgrade


附上网上找的各种源的地址:

1.企业源: 阿里云开源镜像站: http://mirrors.aliyun.com/ 搜狐开源镜像站:http://mirrors.sohu.com/ 网易开源镜像站:http://mirrors.163.com/

2.教育源: 重庆大学: http://mirrors.cqu.edu.cn/ 北京理工大学: http://mirror.bit.edu.cn (IPv4 alt="ubuntu更换源,ubuntu换源方法(Ubuntu20.04入坑指南--软件源更换)" src="http://p3.toutiaoimg.com/large/pgc-image/153645460913508868df802" />

然后在跳出来的框中点击选择”Download from:“选项

再点击other选项会出现一个choose a download server框并选择China,里面有很多国内服务器可选择。

(2)在sources.list文件中手动更改源,即将对应源列表中的代码复制到sources.list文件中,过程如下:

<1> 打开终端,通过cd指令进入sources.list文件所在目录。

$ cd /etc/apt

<2> 将原sources.list文件拷贝做备份,可以进入/etc/apt目录下看到有一个sources.list.bak文件。$ sudo cp sources.list sources.list.bak

<3> 通过gedit指令对sources.list进行编辑(也可以用vim指令),并将sources.list文件中的内容全选删除,再把对应的源列表的内容复制到文件中。

$ sudo gedit sources.list

<4>访问源列表里的网址,并读取软件列表,然后更新保存在本地电脑,换源结束。

$ sudo apt-get update

2. Ubuntu 14.04常用的源列表

(1)阿里云源

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

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

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

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

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

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

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

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

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

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

(2)网易源

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

(3)教育网之浙大源

deb http://mirrors.zju.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb http://mirrors.zju.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb http://mirrors.zju.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://mirrors.zju.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb http://mirrors.zju.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

(4)教育网之中科大源

deb http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

(5)教育网之清华源

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse

3. Ubuntu 16.04常用的源列表

(1)阿里云源

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)网易源

deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

(3)教育网之浙大源

deb http://mirrors.zju.edu.cn/ubuntu xenial main universe restricted multiverse

deb http://mirrors.zju.edu.cn/ubuntu xenial-security main universe restricted multiverse

deb http://mirrors.zju.edu.cn/ubuntu xenial-updates main universe restricted multiverse

deb http://mirrors.zju.edu.cn/ubuntu xenial-proposed main universe restricted multiverse

deb http://mirrors.zju.edu.cn/ubuntu xenial-backports main universe restricted multiverse

deb-src http://mirrors.zju.edu.cn/ubuntu xenial main universe restricted multiverse

deb-src http://mirrors.zju.edu.cn/ubuntu xenial-security main universe restricted multiverse

deb-src http://mirrors.zju.edu.cn/ubuntu xenial-updates main universe restricted multiverse

deb-src http://mirrors.zju.edu.cn/ubuntu xenial-proposed main universe restricted multiverse

deb-src http://mirrors.zju.edu.cn/ubuntu xenial-backports main universe restricted multiverse

(4)教育网之中科大源

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

(5)教育网之清华源

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main multiverse restricted universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main multiverse restricted universe

deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main multiverse restricted universe

本文关键词:ubuntu18.04更换源,ubuntu20.10换源,ubuntu20更换源,ubuntu 20.04更换源,ubuntu 更换源。这就是关于《ubuntu更换源,ubuntu换源方法(Ubuntu20.04入坑指南--软件源更换)》的所有内容,希望对您能有所帮助!

本文内容仅供健康科普参考,不能替代专业医疗诊断和治疗建议。如有身体不适,请及时就医并遵从医师指导。

相关阅读