安装 Ubuntu 12.04 后,我尝试安装 Kile 来编辑.tex
文件。但在尝试安装 Kile 和更新时出现了以下消息:
W:Failed to fetch
gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_precise-security_restricted_binary-i386_Packages
Hash Sum mismatch , E:Some index files failed to download. They have been ignored, or old ones used instead
现在我根本无法安装任何软件。我该怎么办?
編輯:
我已按照你说的做了。但现在我正尝试安装 Okular,但显示以下内容 :-(
答案1
这应该可以修复它:http://ubuntuforums.org/showpost.php?p=11593258&postcount=2。
摘自上述文章:
使用以下方法删除文件
sudo rm -R /var/lib/apt/lists/partial/*
然后运行
sudo apt-get update && sudo apt-get upgrade
如果不起作用,请尝试以下操作:
sudo rm -rf `find /var/lib/apt/lists/ | grep -v gpg`
编辑:好的,试试这个:
sudo fuser -vvv /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
sudo dpkg --clear-avail
sudo dpkg --configure -a
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get dist-upgrade
(从https://answers.launchpad.net/ubuntu/+source/update-manager/+question/194077)