当我运行一个脚本来停止两个服务时,我的 Ubuntu 16.4 LTS 崩溃了。经过谷歌搜索,我发现我的系统中有很多 Linux 镜像。默认情况下它使用
linux-image-4.4.0-187-generic
我将其改为
linux-image-4.4.0-185-generic
在启动过程中高级选项。
现在,系统正常,但每当我重新启动时,它就会回到之前的图像并产生问题。
我需要创建一个新grub.cfg
文件,但我需要清除除 之外的所有不需要的 Linux 映像4.4.0-185
。当我运行sudo apt --purge autoremove
命令时,它会引发以下错误。
(Reading database ... 746033 files and directories currently installed.)
Preparing to unpack .../python-pil.imagetk_3.1.2-0ubuntu1.4_amd64.deb ...
/var/lib/dpkg/info/python-pil.imagetk:amd64.prerm: 6: /var/lib/dpkg/info/python-pil.imagetk:amd64.prerm: pyclean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-pil.imagetk_3.1.2-0ubuntu1.4_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python-pil.imagetk:amd64.postinst: 6: /var/lib/dpkg/info/python-pil.imagetk:amd64.postinst: pycompile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python-pil_3.1.2-0ubuntu1.4_amd64.deb ...
/var/lib/dpkg/info/python-pil:amd64.prerm: 6: /var/lib/dpkg/info/python-pil:amd64.prerm: pyclean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-pil_3.1.2-0ubuntu1.4_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python-pil:amd64.postinst: 6: /var/lib/dpkg/info/python-pil:amd64.postinst: pycompile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python-imaging_3.1.2-0ubuntu1.4_all.deb ...
/var/lib/dpkg/info/python-imaging.prerm: 6: /var/lib/dpkg/info/python-imaging.prerm: pyclean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-imaging_3.1.2-0ubuntu1.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python-imaging.postinst: 6: /var/lib/dpkg/info/python-imaging.postinst: pycompile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python-pil.imagetk_3.1.2-0ubuntu1.4_amd64.deb
/var/cache/apt/archives/python-pil_3.1.2-0ubuntu1.4_amd64.deb
/var/cache/apt/archives/python-imaging_3.1.2-0ubuntu1.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我一头雾水。当我使用时boot-repair
,它给了我一个日志文件,你可以在这里找到它。
https://paste.ubuntu.com/p/mkvkty2BwH/。
请帮助我,因为我不想浪费我的数据并让系统恢复正常。