dpkg:错误:读取软件包信息文件‘/var/lib/dpkg/updates/0228’:是一个目录

dpkg:错误:读取软件包信息文件‘/var/lib/dpkg/updates/0228’:是一个目录

当我尝试安装某些东西时,收到以下警告:

dpkg: error: reading package info file '/var/lib/dpkg/updates/0228': Is a directory

我在论坛上搜索了一些(例如-->dpkg:错误:读取软件包信息文件 /usr/local/var/lib/dpkg/status) 并尝试了根据与我类似的问题给出的步骤。但没有任何帮助可以解决这个问题。有人能帮我解决这个问题吗?

注意:我使用的是 Ubuntu 16.04.5 LTS

日志片段:

ubuntu@ubuntu:/var/lib/dpkg/updates$ rmdir /0228
rmdir: failed to remove '/0228': No such file or directory
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo dpkg --configure -a
dpkg: error: reading package info file '/var/lib/dpkg/updates/0228': Is a directory
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get -f install
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get --fix-missing install
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get clean
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get update
Ign:1 cdrom://Ubuntu 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731) xenial InRelease
Hit:2 cdrom://Ubuntu 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731) xenial Release
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease               
Hit:6 http://archive.ubuntu.com/ubuntu xenial InRelease                                             
Hit:7 http://dl.google.com/linux/chrome/deb stable Release                                          
Hit:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                                    
Hit:9 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease                            

** (appstreamcli:9579): CRITICAL **: Error while moving old database out of the way.
AppStream cache update failed.
Reading package lists... Done
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get dist-upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get clean
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo apt-get autoremove
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
ubuntu@ubuntu:/var/lib/dpkg/updates$ sudo dpkg --configure -a
dpkg: error: reading package info file '/var/lib/dpkg/updates/0228': Is a directory

答案1

尝试移除有问题的对象

sudo rm -rf /var/lib/dpkg/updates/0228

然后继续升级过程

sudo dpkg --configure -a
sudo apt-get install -f
sudo apt-get dist-upgrade

如果 AppStream 错误仍然存​​在,请按照以下解决方案操作此问答


关于您的命令的一些说明:

  1. 命令rmdir /0228- 是错误的。首先/意味着从根寻址,因此该路径不存在。

相关内容