E: Sub-process /usr/bin/dpkg returned an error code (1) 解决办法

在 Ubuntu 执行 sudo apt-get install 时,出现了如下的报错:

Setting up ssh (1:7.6p1-4ubuntu0.3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for ca-certificates (20180409) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for systemd (237-3ubuntu10.33) ...
Processing triggers for initramfs-tools (0.130ubuntu3.9) ...
Processing triggers for dbus (1.12.2-1ubuntu1.1) ...
Errors were encountered while processing:
 rsyslog
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

通过执行下面的命令可以解决该问题:


$ sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/

$ sudo mkdir /var/lib/dpkg/info/

$ sudo apt-get update

$ sudo apt-get -f install

$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/

$ sudo rm -rf /var/lib/dpkg/info

$ sudo mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/

 

 

输入上述命令之后,在执行 sudo apt-get update 和 sudo apt-get upgrade 就不会有问题了。

 

 

 

你可能感兴趣的:(U-Boot)