一、 概述
安装完Ubuntu系统,系统默认选择了Ubuntu的repositoy源,有3个,security、archive、extra。但是这3个源无法用于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
三、分析
应该是所指向的源需要有正确的pubkey,所以简单的说就是这个源不可用。
四、 解决方案
更换源
4.1 备份源的配置文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
4.2 编辑源的配置文件
vim /etc/apt/sources.list
把所有内容都删除,只保留最上面的注释就行了(因为怕有格式的问题而不可用,所以就想保留格式。)
#
#deb cdrom `````````
#deb cdrom
4.3 把如下的内容复制进文件
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
4.4 保存并推出即可。
4.5 更新一下
sudo apt-get update.
4.6 大功告成
五、 总结
就是源不可用,还可以把源设置成自己的光盘也行。
六、 如下博客帮了我大忙,转发一下。
Ubuntu 14.04 LTS更新源
-
首先备份源列表:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
- 而后用gedit或其他编辑器打开:
sudo gedit /etc/apt/sources.list
- 从下面列表中选择合适的源,替换掉文件中所有的内容,保存编辑好的文件:
注意:一定要选对版本
- 然后,刷新列表:
sudo apt-get update
Ubuntu 官方更新服务器(欧洲,此为官方源,国内较慢,但无同步延迟问题,电信、移动/铁通、联通等公网用户可以使用):
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
Ubuntu官方提供的其他软件(第三方闭源软件等):
deb http://archive.canonical.com/ubuntu/ trusty partner
deb http://extras.ubuntu.com/ubuntu/ trusty main
骨头兄亲自搭建并维护的 Ubuntu 源(该源位于浙江杭州百兆共享宽带的电信机房),包含 Deepin 等镜像:
deb http://ubuntu.srt.cn/ubuntu/ trusty main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ trusty-backports main restricted universe multiverse
网易163更新服务器(广东广州电信/联通千兆双线接入),包含其他开源镜像:
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
搜狐更新服务器(山东联通千兆接入,官方中国大陆地区镜像跳转至此) ,包含其他开源镜像:
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
LupaWorld 更新服务器(浙江杭州电信/联通双线服务器),包含其他开源镜像:
deb http://mirror.lupaworld.com/ubuntu trusty main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu trusty-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu trusty-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu trusty-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu trusty-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu trusty main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu trusty-proposed main restricted universe multiverse
常州贝特康姆软件技术有限公司 更新服务器(江苏常州电信服务器),包含其他开源镜像。
( CN99域名 系 “常州市亚科技术有限公司” 所注册,但此公司与常州贝特康姆的法人代表和营业地址相同。所以本镜像实际即原 CN99。但现在 CN99镜像的域名已改为跳转至网易镜像):
deb http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiverse
deb http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-security main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-updates main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-backports main restricted universe multiverse
deb-src http://centos.bitcomm.cn/ubuntu trusty-proposed main restricted universe multiverse