我遇到了以下问题,昨天我运行了 apt-get update、upgrade 和 autoremove,现在我尝试运行的有关apt-get
apt-get purge linux-image-extra-3.13.0-74-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-77 linux-headers-3.13.0-77-generic
linux-image-3.13.0-77-generic linux-image-extra-3.13.0-77-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
linux-image-extra-3.13.0-74-generic
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
1 not fully installed or removed.
After this operation, 152 MB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: warning: files list file for package 'nvidia-304' missing; assuming package has no files currently installed
(Reading database ... 846891 files and directories currently installed.)
Removing linux-image-extra-3.13.0-74-generic (3.13.0-74.118) ...
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 30: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: all:: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 31: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: install:: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 38: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: MODULE_NAME: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 39: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: VERSION_HEADER: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 46: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: CORE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 47: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: patsubst: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 47: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: RESMAN_GLUE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 49: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: MODULE_NAME: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 49: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: CORE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 49: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: RESMAN_GLUE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 49: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: -objs: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 56: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_GLUE_NAME: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 57: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: RESMAN_GLUE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 57: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: MODULE_NAME: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 57: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_GLUE_OBJS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 59: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: MODULE_NAME: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 59: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: obj-m: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 66: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: src: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 66: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: EXTRA_CFLAGS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 67: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: DEFINES: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 67: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: INCLUDES: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 67: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: EXTRA_CFLAGS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 74: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: src: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 75: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: obj: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 83: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: shell: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 83: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_MODLIB: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 85: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: ifdef: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 86: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: SYSSRC: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 86: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_SOURCES: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 87: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_SOURCES: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 87: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: KERNEL_HEADERS: not found
/var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: 88: /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm: Syntax error: "else" unexpected
dpkg: error processing package linux-image-extra-3.13.0-74-generic (--remove):
subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
linux-image-extra-3.13.0-74-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我通过将文件 /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm 重命名为 /var/lib/dpkg/info/linux-image-extra-3.13.0-74-generic.postrm_ 来实现此目的。
现在我可以再次运行 apt-get,但我仍然需要查看 nvidia 错误