Ubuntu源问题(换源软件源更新源)

一:

执行命令

sudo apt-get update

错误描述如下:


W: Failed to fetch http://mirrors.sohu.com/ubuntu/dists/precise/universe/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise_universe_i18n_Index

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

解决方法:

将/var/lib/apt/lists/partial/下的所有文件删除,但是这可以解决大部分问题,个别源不能解决,如"/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages",无耐进入/var/lib/apt/lists/将对应的文件删除

二:

无法找到对应的KEY

W: GPG error: http://mirrors.sohu.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: http://mirrors.sohu.com precise-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: http://mirrors.sohu.com precise-proposed Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: http://archive.canonical.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
W: GPG error: http://security.ubuntu.com precise-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

解决方法:

使用如下命令:

gpg --keyserver subkeys.pgp.net --recv-keys 40976EAF437D05B5
gpg -a --export 40976EAF437D05B5 | sudo apt-key add -
三、更新解决
1.sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup    备份更新源设置

2.sudo gedit /etc/apt/sources.list
编辑你的源列表,将原来的内容全部删除,添加下面列表中最适合你的源(注意不要全部添加),选择一个最合适你的即可,复制到你的列表中,然后保存列表。

3.sudo apt-get update 更新源列表信息
可以在运行“sudo apt-get update ”时查看一下错误信息,把不能连接的源删除再重新运行“sudo apt-get update ”。

4.sudo apt-get upgrade  升级

# 以下来自http://wiki.ubuntu.org.cn/index.php?title=Template:9.10source&variant=zh-cn
# 台湾的官方源速度也相当不错,有时甚至快于内地的:
deb http://tw.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse

# 中国台湾 台湾大学更新服务器(推荐网通用户使用,电信PING平均响应速度41MS。强烈推荐此源,比较完整,较少出现同步问题):
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-security main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-proposed main multiverse restricted universe
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ karmic-proposed main restricted universe multiverse

# 网易163更新服务器:
deb http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse

# sohu 更新服务器:
deb http://mirrors.sohu.com/ubuntu/ karmic main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ karmic-backports main restricted universe multiverse

# 骨头兄亲自搭建并维护这个Ubuntu源(该源位于浙江杭州百兆共享宽带的电信机房):
deb http://ubuntu.srt.cn/ubuntu/ karmic main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn karmic main restricted universe multiverse

# Archive.ubuntu.com更新服务器(欧洲,此为官方源,电信网通用户使用):
deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse

# Mirrors.shlug.org更新服务器(电信服务器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group):
deb http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse

# Mirror.lupaworld.com更新服务器(浙江省杭州市双线服务器):
deb http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
四、ubuntu14.04以上版本应该可以图形界面修改源

图形界面修改源,将默认的源修改成一个比较快的源。

1.图形界面就可以修改,打开Ubuntu软件中心,如下图,点击顶部面板的“编辑”然后就可看到“软件源”选项了。

2.点击之后填出软件源编辑窗口,选择“其他站点”。

3.可以选择最佳服务器,也可以直接在左边选择一个你觉得快的源,163.com其实挺好。

4.选择服务器,弹出授权,输入你的系统密码就可以了。

5.在终端修改和替换源的方法(第三部分)

  • 打开终端,输入命令:sudo gedit /etc/apt/sources.list

  • 在终端必须小心点,在这之前最后备份一下,输入密码之后会填出窗口:你需要在网上搜索一下关于适合你的Ubuntu版本的源,直接添加都后也可以。

  • 然后更新:sudo apt-get update


你可能感兴趣的:(Ubuntu源问题(换源软件源更新源))