当我尝试使用更新时
sudo apt-get update
我收到错误
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages Hash Sum mismatch
如果我尝试安装任何应用程序,我会收到以下错误:
The following packages have unmet dependencies:
icedtea-7-jre-jamvm : Depends: openjdk-7-jre-headless (= 7u55-2.4.7-1ubuntu1~0.12.04.2) but 7u65-2.5.1-4ubuntu1~0.12.04.2 is to be installed
openjdk-7-jre : Depends: openjdk-7-jre-headless (= 7u55-2.4.7-1ubuntu1~0.12.04.2) but 7u65-2.5.1-4ubuntu1~0.12.04.2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我已经提到了一些针对类似问题的解决方案,例如,
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update
和
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
由于无法更新或安装,因此无法继续执行某些解决方案。
此问题可能是什么原因造成的?如何解决?
答案1
备份你的 source.list:
cp /etc/apt/sources.list ~/sourcesBK.list
下载“示例存储库”:
wget https://help.ubuntu.com/12.04/sample/sources.list
并重新放置你的:
sudo cp sources.list /etc/apt/sources.list
并尝试进行更新:
sudo apt-get update && sudo apt-get upgrade