![linux-image-4.13.0-37-generic 既不能安装也不能删除](https://linux22.com/image/1204497/linux-image-4.13.0-37-generic%20%E6%97%A2%E4%B8%8D%E8%83%BD%E5%AE%89%E8%A3%85%E4%B9%9F%E4%B8%8D%E8%83%BD%E5%88%A0%E9%99%A4.png)
我使用的是 Ubuntu 16.04.03。我按照 Ubuntu 提示安装更新。一周前,由于某种未知原因,“linux-image-4.13.0-37-generic”安装失败。
此后,我无法从“Ubuntu 软件中心”或使用“dpkg -i PACKAGE-NAME”从终端安装任何软件包。我收到以下语法错误。 /var/lib/dpkg/tmp.ci/preinst: 语法错误:“(”意外
我尝试了类似的命令
sudo apt-get autoremove
sudo apt-get -f install
sudo update-grub
sudo apt-get --force-yes remove linux-image-4.13.0-37-generic (this of course didn't work because the image is not installed yet.)
sudo apt-get clean; sudo apt-get autoclean
以下是完整错误
desktop:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
linux-image-4.13.0-37-generic
Suggested packages:
fdutils linux-tools
The following packages will be upgraded:
linux-image-4.13.0-37-generic
1 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
8 not fully installed or removed.
Need to get 0 B/20.9 MB of archives.
After this operation, 72.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
/usr/sbin/dpkg-preconfigure: 6: /usr/sbin/dpkg-preconfigure: BEGIN: not found
/usr/sbin/dpkg-preconfigure: 1: eval: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 9: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 10: /usr/sbin/dpkg-preconfigure: Syntax error: "(" unexpected
(Reading database ... 244264 files and directories currently installed.)
Preparing to unpack .../linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: 20: /var/lib/dpkg/tmp.ci/preinst: Syntax error: "(" unexpected
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 2
/var/lib/dpkg/tmp.ci/postrm: 21: /var/lib/dpkg/tmp.ci/postrm: use: not found
/var/lib/dpkg/tmp.ci/postrm: 23: /var/lib/dpkg/tmp.ci/postrm: =1: not found
/var/lib/dpkg/tmp.ci/postrm: 23: /var/lib/dpkg/tmp.ci/postrm: $: not found
/var/lib/dpkg/tmp.ci/postrm: 26: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 27: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 28: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 29: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 30: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 31: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 32: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 33: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 34: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 35: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 36: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 37: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 38: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 39: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 40: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 41: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 42: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 43: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 44: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 45: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 46: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 47: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 48: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 49: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 50: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 51: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 52: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 53: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 55: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 56: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 57: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 58: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 59: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 60: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 61: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 62: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 63: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 64: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 68: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 71: /var/lib/dpkg/tmp.ci/postrm: Syntax error: "(" unexpected
dpkg: error while cleaning up:
subprocess new post-removal script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
由于我被多次重定向到 initramfs> 提示符,并且执行后fsck -y /dev/sda3
只能发现磁盘上 0.2% 的错误,因此几周前我重新安装了 Ubuntu 操作系统。现在我偶尔会收到 initramfs 提示符。
我需要重新安装 Ubuntu 吗?我最近更换了硬盘。
更新
muru 询问的 namei -lx /usr/bin/perl 的输出
f: /usr/bin/perl
Drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
-rwxr-xr-x root root perl
谢谢。