![为什么我会收到错误“子进程 /usr/bin/dpkg 返回错误代码 (1)”(与 openstack-dashboard 相关)?](https://linux22.com/image/1091423/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%BC%9A%E6%94%B6%E5%88%B0%E9%94%99%E8%AF%AF%E2%80%9C%E5%AD%90%E8%BF%9B%E7%A8%8B%20%2Fusr%2Fbin%2Fdpkg%20%E8%BF%94%E5%9B%9E%E9%94%99%E8%AF%AF%E4%BB%A3%E7%A0%81%20(1)%E2%80%9D%EF%BC%88%E4%B8%8E%20openstack-dashboard%20%E7%9B%B8%E5%85%B3%EF%BC%89%EF%BC%9F.png)
每当我尝试使用sudo apt-get update
时sudo apt-get upgrade
,我总是会收到一个与相关的错误openstack-dashboard
。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
openstack-dashboard-ubuntu-theme
The following packages will be upgraded:
heroku
1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/14.0 MB of archives.
After this operation, 190 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 413428 files and directories currently installed.)
Removing openstack-dashboard-ubuntu-theme (2:9.1.2-0ubuntu3) ...
Collecting and compressing static assets...
Traceback (most recent call last):
File "manage.py", line 18, in <module>
from django.core.management import execute_from_command_line # noqa
ImportError: No module named django.core.management
dpkg: error processing package openstack-dashboard-ubuntu-theme (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
openstack-dashboard-ubuntu-theme
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
每次升级或安装新软件包时,您都会收到此错误,因为openstack-dashboard-ubuntu-theme
系统中的软件包已损坏。 解决方案:
sudo rm /var/lib/dpkg/info/openstack-dashboard-ubuntu-theme.*
检查您的问题是否解决,如果没有,则执行这些命令。
sudo apt remove --purge openstack-dashboard-ubuntu-theme
sudo apt -f install
sudo apt update