由于“恶意发生了解决”错误,无法安装软件包

我按照这些说明在我的笔记本电脑上安装git。
当我做:

$ sudo apt-get install git-core

这就是我的terinal所展示的:

 Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libasprintf0c2:i386 libcroco3:i386 libgettextpo0:i386 libgomp1:i386 libunistring0:i386 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: git git-man liberror-perl Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb The following NEW packages will be installed: git git-core git-man liberror-perl 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 6,825 kB of archives. After this operation, 15.3 MB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated! liberror-perl git-man git git-core Install these packages without verification [y/N]? 

  E: Some packages could not be authenticated lucas@lucas-Inspiron-N5050:~$ sudo apt-get install git-core Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libasprintf0c2:i386 libcroco3:i386 libgettextpo0:i386 libgomp1:i386 libunistring0:i386 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: git git-man liberror-perl Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb The following NEW packages will be installed: git git-core git-man liberror-perl 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 6,825 kB of archives. After this operation, 15.3 MB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated! liberror-perl git-man git git-core Install these packages without verification [y/N]? y Err httpq://py.archive.ubuntu.com/ubuntu/quantal/main liberror-perl all 0.17-1 Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git-man all 1:1.7.10.4-1ubuntu1 Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git amd64 1:1.7.10.4-1ubuntu1 Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Err httpq://py.archive.ubuntu.com/ubuntu/ quantal/main git-core all 1:1.7.10.4-1ubuntu1 Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberrorperl_0.17-1_all.deb Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/g/gi/git-man_1.7.10.4-1ubuntu1_all.deb Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Failed to fetch httpq://py.archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.10.4-1ubuntu1_amd64.deb Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) Failed to fetch http://py.archive.ubuntu.com/ubuntu/pool/main/g/git/git-core_1.7.10.4-1ubuntu1_all.deb Something wicked happened resolving 'py.archive.ubuntu.com:http' (-5 - No address associated with hostname) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 

我怎么能在Ubuntu 12.10上安装git 我甚至无法从Ubuntu软件中心这样做。

提前致谢!

关闭所有与安装软件有关的程序/窗口,例如Synaptic,软件中心和终端。

现在你应该删除锁定的文件:

您可以删除锁定文件

 sudo rm /var/lib/apt/lists/lock 

您可能还需要删除缓存目录中的锁定文件

 sudo rm /var/cache/apt/archives/lock 

通过: 这个答案

现在你应该打开一个终端并运行:

  sudo apt-get update --fix-missing 

现在你可以再次安装你想要的一切。
祝你今天愉快

你有/etc/networks/interfaces设置的静态IP吗? 升级到Ubuntu 12.04后,我遇到了类似的问题。 问题是DNS服务器不再设置在/etc/resolv.conf ,无论你放在那里它都会在重启时被覆盖。 解决方案是在/etc/networks/interfaces添加:

 dns-nameservers `` dns-domain `` 

快速修复是在resolv.conf中添加名称服务器 ,但重启后它会消失。

/etc/network/interfaces添加了以下内容:

 auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.205 netmask 255.255.255.0 gateway 192.168.1.1 

在调试时,在/etc/resolv.conf名称服务器不在那里。 所以我添加了以下几行:

 nameserver 8.8.8.8 nameserver 192.168.1.1 

然后做了sudo apt-get update 。 它刚刚起作用。

nano /ect/resolv.conf

删除所有

加上这个

“nameserver 8.8.8.8”

保存并离开。

再次尝试“apt-get update”,应该可以正常工作。