解決樹莓派“Sub-process /usr/bin/dpkg returned an error code (1)”故障
在樹莓派上安裝python-imaging軟體時出現了以下錯誤:
Errors were encountered while processing: python-imaging E: Sub-process /usr/bin/dpkg returned an error code (1)
最後經過比較長時間的摸索,終於解決了這個問題,解決過程如下:
一、故障程式碼
我將詳細的故障程式碼放在這兒:
<strong>pi@raspberrypi:/var/lib/dpkg $ sudo apt-get install python-imaging --reinstall</strong> Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 12 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. E: Internal Error, No file name for python-imaging:armhf <strong>pi@raspberrypi:/var/lib/dpkg $ sudo apt-get install python-imaging </strong>Reading package lists... Done Building dependency tree Reading state information... Done python-imaging is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Traceback (most recent call last): File "/usr/bin/apt-listchanges", line 28, in <module> import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Setting up python-imaging (2.6.1-2+deb8u3) ...
二、解決辦法
cd /var/lib/dpkg sudo mv info info.bak #做備份 sudo mkdir info sudo apt-get install python-imaging --reinstall #重新安裝cmake包 sudo rm -rf info sudo mv info.bak info #還原info 然後再sudo apt-get install python-imaging就不會出現上面的錯誤了
三、故障解決
故障終於解決,樹莓派系統也可以正常升級了。
pi@raspberrypi:/var/lib/dpkg $ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages have been kept back:
gstreamer1.0-plugins-bad libgl1-mesa-dri libgstreamer-plugins-bad1.0-0 lxpanel lxpanel-data
plymouth python-gpiozero python-openssl python3-gpiozero raspberrypi-ui-mods sonic-pi
xserver-xorg-input-all
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
原創文章,轉載請註明:轉載自科技愛好者部落格
本文連結地址:ofollow,noindex" target="_blank">解決樹莓派“Sub-process /usr/bin/dpkg returned an error code (1)”故障(http://blog.lxx1.com/3262)
如果部落格對您有幫助,請給我打賞