UBUNTU怎么更换源

发布时间:2022-11-24 10:21:41 作者:iii
来源:亿速云 阅读:114

这篇“UBUNTU怎么更换源”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“UBUNTU怎么更换源”文章吧。

首先备份源列表(for sure):

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

而后用gedit或其他编辑器打开/etc/apt/sources.list:

nano /etc/apt/sources.list

注意:一定要选对版本
模板:12.04source

deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
##测试版源
deb http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
# 源码
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
##测试版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ precise partner
deb http://extras.ubuntu.com/ubuntu/ precise main

模板:14.04source

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
# 源码
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ trusty partner
deb http://extras.ubuntu.com/ubuntu/ trusty main

可将 http://cn.archive.ubuntu.com/ubuntu/ 替换为下列任意服务器

Ubuntu 官方(欧洲,国内较慢,无同步延迟)

http://archive.ubuntu.com/ubuntu/

Ubuntu 官方中国(目前是阿里云)

http://cn.archive.ubuntu.com/ubuntu/

教育网
以下服务器有教育网接入,推荐教育网用户使用 IPv6:
中科大 LUG(合肥,电信/联通/移动/教育网自动分流,同时也是 Deepin 官方)

https://mirrors.ustc.edu.cn/ubuntu/ (v4/v6) http://mirrors4.ustc.edu.cn/ubuntu/ (v4) http://mirrors6.ustc.edu.cn/ubuntu/ (v6)

中科院 OpenCAS

http://mirrors.opencas.cn/ubuntu/

清华 TUNA(教育网核心节点百兆接入,已计划提高到千兆)

http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ (v4/v6) http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ (v4) http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ (v6)

大陆地区以外
香港中文大学更新服务器,由香港中文大学资讯科技服务处维护

http://ftp.cuhk.edu.hk/pub/Linux/ubuntu

香港 01link 更新服务器,由香港联达网络服务有限公司维护

http://ubuntu.01link.hk

香港 uhost 更新服务器,由香港互联科技有限公司维护

http://ubuntu.uhost.hk

台湾的官方源。速度有时甚至快于内地的,包含 ian 等其他镜像

http://tw.archive.ubuntu.com/ubuntu

然后,刷新列表:

sudo apt-get update

注意:一定要执行刷新


如果出现

W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

则执行

gpg --keyserver keyserver.ubuntu.com --recv 3E5C1192
gpg --export --armor  3E5C1192 | sudo apt-key add -

然后再刷新列表

以上就是关于“UBUNTU怎么更换源”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注亿速云行业资讯频道。

推荐阅读:
  1. Python如何更换pip源
  2. Ubuntu 18.04如何更换apt-get源

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ubuntu

上一篇:php拿不到name如何解决

下一篇:​phpMyAdmin下管理MySQL数据库报错怎么解决

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》