所以我前几天试图升级Ubuntu 11.10 64位系统时遇到了一个错误:
dpkg: ../../src/archives.c:978: tarobject: 断言 `r == stab.st_size' 失败。
于是我按照这个Ubuntu论坛的帖子和这个帖子的方法进行操作。
我从info文件夹和status文件中移除了ubuntu-docs
。
现在每当我尝试安装/删除/升级任何软件包时都会收到一个错误提示:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate
trans.unauthenticated = self._simulate_helper(trans)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1092, in _simulate_helper
return depends, self._cache.required_download, \
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 235, in required_download
pm.get_archives(fetcher, self._list, self._records)
SystemError: E:I wasn't able to locate a file for the ubuntu-docs package. This might mean you need to manually fix this package.
当我尝试通过命令行安装
ubuntu-docs
时,我得到了以下输出: BlockquoteReading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
ubuntu-docs
1 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
1 not fully installed or removed.
Need to get 1,408 kB of archives.
After this operation, 22.5 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric/main ubuntu-docs all 11.10.4 [1,408 kB]
Fetched 1,408 kB in 5s (265 kB/s)
(Reading database ...
dpkg: warning: files list file for package `ubuntu-docs' missing, assuming package has no files currently installed.
(Reading database ... 323646 files and directories currently installed.)
Preparing to replace ubuntu-docs 11.10.4 (using .../ubuntu-docs_11.10.4_all.deb) ...
Unpacking replacement ubuntu-docs ...
dpkg: ../../src/archives.c:978: tarobject: Assertion `r == stab.st_size' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly
...看起来和我开始遇到问题时差不多,所以我查看了信息--没有ubuntu-docs
包,但是状态中有一个条目,所以我将其删除并再次尝试,但是只要我运行sudo dpkg --configure -a
,ubuntu-docs
的条目就会重新出现。
有什么想法吗?
编辑 (不作为评论以保存格式):
这个帖子说我需要在从状态中删除相应的行后运行sudo apt-get update
。所以我先运行sudo apt-get clean
,然后再运行sudo apt-get update
。但是我收到了一条消息:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
在运行了
sudo dpkg --configure -a
之后,状态文件中包含以下内容:Package: ubuntu-docs
Status: install reinstreq half-installed
Priority: optional
Section: doc
Version: 11.10.4
不确定是否有帮助。