运行apt-get更新时,发生“无法获取”错误。我该如何解决?

乔瓦贝尔斯

与上述说明相反,我尚未找到解决问题的答案。

我已经阅读了将近十二个“易于获取”更新问题,其中大部分来自askubuntu.com,其中包含“无法提取”错误,并尝试了在那里解决的方法。不幸的是,没有一个有效。我最近刚在笔记本电脑上安装了Ubuntu 12.04,并与Windows 7一起双重启动。

sudo apt-get update

在终端上,不断发生以下情况:

Err http://ph.archive.ubuntu.com precise InRelease
Err http://ph.archive.ubuntu.com precise-updates InRelease                     
Err http://ph.archive.ubuntu.com precise-backports InRelease                   
Err http://ph.archive.ubuntu.com precise Release.gpg                           
  Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
Err http://ph.archive.ubuntu.com precise-updates Release.gpg            
  Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
Err http://ph.archive.ubuntu.com precise-backports Release.gpg          
  Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
Err http://extras.ubuntu.com precise InRelease                          
Err http://extras.ubuntu.com precise Release.gpg                        
  Unable to connect to extras.ubuntu.com:http:
Err http://security.ubuntu.com precise-security InRelease
Err http://security.ubuntu.com precise-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
Reading package lists... Done
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise/InRelease  
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease  
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease  
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease  
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/InRelease  
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg      Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg  Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg  Unable to connect to ph.archive.ubuntu.com:http: [IP: 91.189.92.177 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg  Unable to connect to extras.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

注意事项

我安装Ubuntu 12.04之后立即发生了这种情况。对于Linux / Ubuntu领域,我是一个新手,对于这些东西,我是个菜鸟。

Update Manager(和Software Center)设置中的Sources列表很短。它仅包含2行带有“ Canonical”的行,2行带有“ Independent”的行和其他2行。我认为列表很短,因为它是新安装的Ubuntu。

与互联网的连接似乎很好,我的朋友的笔记本电脑与我的大约同时安装了Ubuntu 12.04,他的更新似乎没有问题。我们共享相同的连接,所以我认为互联网连接问题不可能是该错误的原因。

尝试的解决方案

这里开始,我进行了探索,/etc/resolvconf/resolv.conf.d并添加/etc/resolvconf/resolv.conf.d/head了以下内容:

nameserver 8.8.8.8
nameserver 8.8.4.4

仍然发生错误。

这里这里,我反复更改了要在更新管理器和“软件”源设置中使用的镜像服务器。同样,错误仍然发生。

我还尝试编辑源列表,取消选中带有“独立”字样的行(如建议)。根据这里,我尝试删除derb-src源列表中行。仍然无济于事。

最后,该站点建议运行以下命令:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
or, for a permanent solution,
echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null

可悲的是,没有任何东西对我有用。在我去过的所有论坛中,与之相关的答案nameserver 8.8.8.8似乎最经常出现。还请注意,我真的不了解解决方案,它们的含义或完成方式。我只是简单地跟随他们。

这是以下内容的输出cat /etc/apt/sources.list

# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/main/binary-i386/

# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ precise main restricted

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

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-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://archive.ubuntu.com/ubuntu precise universe
deb-src http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb-src http://archive.ubuntu.com/ubuntu precise-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://archive.ubuntu.com/ubuntu precise multiverse
deb-src http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-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://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse

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

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

以下是针对cat /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search nip.upd.edu.ph

有人指出,答案就在这里,但不幸的是,它也没有用。我尝试选择其他服务器,但是“选择服务器”从不可用。搜索最佳服务器会产生“没有合适的服务器”的结果。我认为镜像服务器很好,而且互联网连接似乎没有问题。

使用ping -c3 archive.ubuntu.comping -c3 8.8.8.8都产生了0% packet loss8.8.8.8的ping有时会产生,33% packet loss但大部分为0%。

打字nslookup google.com收益

Server:     127.0.0.1
Address:    127.0.0.1#53

输出ps aux | grep dns

nobody    1761  0.0  0.0  33012  1284 ?        S    17:04   0:00 /usr/sbin/dnsmasq
 --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var
/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-
file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec
joa       2197  0.0  0.0  13576   928 pts/0    S+   17:10   0:00 grep --color=auto dns
乔瓦贝尔斯

sudo apt-get update终于工作了!我只是意识到问题不在系统上,而是系统如何连接和从Internet检索数据。我刚刚配置我的网络设置,改变了代理检测到Manual并填充在HTTPHTTPSFTP,和Socks Host空白的代理,我使用。当我再次更新时,此错误输出首先发生:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/)

好吧,不是完全一样,而是相似(我是从此处复制过来的)。但是当我再次尝试更新时,它终于起作用了(我在上面发布了错误输出的原因,而不是我看到的确切输出),现在我可以选择其他镜像服务器。如果网络代理配置确实是造成麻烦的原因,那么,对于这种基本错误,我有点傻。

无论如何,谢谢大家的帮助!:)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

我该如何解决无法正常运行的javascript计算?

我的冷却器装饰器无法正常运行,该如何解决?

我的IF语句无法正常运行,该如何解决?

当我运行代码时,只会更新一个工作表,例如Apple。其他3个工作表未更新。我该如何解决?

出现错误“不存在Java运行时”,我该如何解决?

在执行sudo apt-get install update时如何解决“无法找到软件包更新”

PPA添加失败后,“ apt-get”被破坏。我该如何解决?

无法运行任何apt-get命令

如何解决“无法获取某些档案,可能运行apt-get update或尝试--fix-missing”错误?

运行apt-get更新时签名无效

运行apt-get更新时出错

运行“ sudo apt-fast更新”时出现“ GPG错误”

为什么JavaCC无法在我的Mac上运行,该如何解决?

运行apt-get autoclean时dpkg错误

运行xampp时说端口被另一个程序使用,我该如何解决错误?

当我运行sudo apt-get update时出错

Ubuntu 16.04无法运行“ sudo apt upgrade”

无法在apt-get更新时获取错误

运行sudo apt-get upgrade时dpkg错误

运行apt-get更新的签名验证错误

运行apt-get更新时,我收到校验和错误

无法运行apt-get -f install

运行apt更新时出现Skype更新错误

apt如何升级正在运行的程序?

运行 apt-get 进出 Anaconda

运行 sudo apt update 时无法获取错误

在 for 循环中运行 scanf 时出现逻辑错误,我该如何解决?

为什么在我运行脚本时出现错误。我该如何解决?

这是什么运行时错误,我该如何解决?