升级到 12.04 后出现 apt-get 问题

升级到 12.04 后出现 apt-get 问题

我最近将集群从 11.10 升级到了 12.04。升级后,我在集群节点上运行 apt-get 时遇到了问题。我可以在节点之间进行 ssh 连接(客户端到客户端;客户端到主机;客户端到外部等)。但是,sudo apt-get update 会产生以下错误:

Ign http://us.archive.ubuntu.com precise InRelease                             
Ign http://security.ubuntu.com precise-security InRelease                      
Ign http://www.openfoam.org maverick InRelease                                 
Ign http://us.archive.ubuntu.com precise-updates InRelease                                                    
Err http://security.ubuntu.com precise-security Release.gpg                                                   
  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)
Err http://www.openfoam.org maverick Release.gpg                                                              
  Something wicked happened resolving 'www.openfoam.org:http' (-5 - No address associated with hostname)
Ign http://us.archive.ubuntu.com precise-backports InRelease                                                  
Ign http://www.openfoam.org maverick Release                                                                  
Ign http://security.ubuntu.com precise-security Release                      
Err http://us.archive.ubuntu.com precise Release.gpg                                                          
  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Ign http://security.ubuntu.com precise-security/main Sources/DiffIndex                                        
Err http://us.archive.ubuntu.com precise-updates Release.gpg                                                  
  Something wicked happened resolving 'us.archive.ubuntu.com:http' (-5 - No address associated with hostname)
Ign http://security.ubuntu.com precise-security/restricted Sources/DiffIndex                                  
15% [Connecting to us.archive.ubuntu.com] [Connecting to security.ubuntu.com] [Connecting to www.openfoam.org]

在头节点上,我有/etc/network/iterfaces

auto eth0
iface eth0 inet static
address 192.168.0.1/24

在客户端节点上,我有/etc/network/iterfaces

auto eth0
iface eth0 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1

请指教。

在“工作”客户端节点上,我得到:

mpiuser@crayN4-5150jo:~$ nslookup security.ubuntu.com
Server:     127.0.0.1
Address:    127.0.0.1#53

Non-authoritative answer:
Name:   security.ubuntu.com
Address: 91.189.92.184
Name:   security.ubuntu.com
Address: 91.189.92.190

Ping 结果

mpiuser@crayN4-5150jo:~$ ping -c 3 security.ubuntu.com
PING security.ubuntu.com (91.189.92.190) 56(84) bytes of data.
64 bytes from 91.189.92.190: icmp_req=1 ttl=49 time=94.6 ms
64 bytes from 91.189.92.190: icmp_req=2 ttl=49 time=105 ms
64 bytes from 91.189.92.190: icmp_req=3 ttl=49 time=103 ms

--- security.ubuntu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 15674ms
rtt min/avg/max/mdev = 94.643/101.462/105.847/4.887 ms

在非工作的客户端节点上:

mpiuser@crayN2-5150jo:~$ nslookup security.ubuntu.com
;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; Got SERVFAIL reply from 127.0.0.1, trying next server
Server:     ::1
Address:    ::1#53

** server can't find security.ubuntu.com: SERVFAIL

mpiuser@crayN2-5150jo:~$ ping -c 3 security.ubuntu.com
ping: unknown host security.ubuntu.com

答案1

问题已解决。我在 中添加了以下行/etc/network/interfaces

dns-nameservers 8.8.8.8 8.8.4.4

相关内容