我最近安装了 12.04,一切似乎都很顺利,直到今天尝试运行时出现一系列错误apt-get upgrade
:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
visual-regexp
The following packages will be upgraded:
dkms firefox firefox-globalmenu firefox-gnome-support
firefox-locale-en gnome-games-data gnome-sudoku gnomine
google-chrome-stable libglu1-mesa libglu1-mesa:i386 libmysqlclient18:i386
mahjongg mysql-common tk8.5 vino
16 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
11 not fully installed or removed.
Need to get 0 B/67.4 MB of archives.
After this operation, 2,890 kB of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ...
dpkg: warning: files list file for package `tk8.5' missing, assuming package has no files currently installed.
(Reading database ... 235237 files and directories currently installed.)
Removing visual-regexp ...
dpkg (subprocess): unable to execute installed post-removal script (/var/lib/dpkg/info/visual-regexp.postrm): Permission denied
dpkg: error processing visual-regexp (--remove):
subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
visual-regexp
E: Sub-process /usr/bin/dpkg returned an error code (1)
一切似乎都是从这个臭名昭著的错误开始的:
dpkg: warning: files list file for package `tk8.5' missing,
assuming package has no files currently installed.
这可能是由于我的安装引起的visual-regexp
- 我现在无法删除它。
我尝试了几种修复方法,包括:
sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get --fix-missing upgrade
和其他人试图效仿这个答案,但无济于事。
另外,我不太清楚 可能存在什么问题permission
,因为我显然以 apt-get 的形式运行sudo
:
$ ll /var/lib/dpkg/info/visual-regexp.postrm
-rwxr-xr-x 1 root root 160 Jun 24 2011 /var/lib/dpkg/info/visual-regexp.postrm
另外,请注意这11 not fully installed or removed.
是由于以前的失败造成的apt-get upgrade
:有什么办法可以恢复吗?
提前谢谢你,马可。
答案1
OP 发帖:
因此,我突然意识到,权限被拒绝的事情可能与禁止执行选项/etc/fstab
(我正在安装/var
在与不同的磁盘上/
)。
事实证明我使用了以下安装选项:
UUID=b5ae50cf-58e6-46f8-8313-6c1492dcc8ad /var ext4 defaults,users 0 0
并且,虽然defaults
暗示exec
,users
但反而暗示noexec
-因为后者是最后一个,它将覆盖前一个。
改为defaults
仅有的现在一切都变得轻松多了,有了 apt-get。把它留在这里,希望它能帮助到其他人。