0

When i try to install something, i m getting below warning:

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

I searched some in the forum(for example-->dpkg: error: reading package info file /usr/local/var/lib/dpkg/status) and tried the steps which are given based on the issues that are similar to me. But nothing helped to solve this issue. Can anyone help me on this problem?

Note: Im using Ubuntu 16.04.5 LTS

Log Snippets:

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
0

Try to remove problematic objects

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

and then continue the upgrade process

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

If AppStream error persists, then follow solutions in this Q&A.


Some notes on your commands:

  1. The command rmdir /0228 - is wrong. First / means addressing from root, so this path is not existent.
| improve this answer | |
  • Tried to remove with sudo rm -rf /var/lib/dpkg/updates/0228 but got this warning rm: cannot remove '/var/lib/dpkg/updates/0228': Structure needs cleaning – Zafer ÇALIŞKAN Jan 3 '19 at 19:51
  • Then it is other problem - you have inconsistency in the filesystem. Follow this answer. – N0rbert Jan 3 '19 at 19:53
  • I cheked the link you gave and tried the steps which are related with GRUB menu. I think my Ubuntu version does not contain the Advanced Options tab. But there is an option to open command line by just pressing 'c'. There, the command sudo and also fsck is not defined so that I m unable to make filesystem check. My GRUB version is : GNU GRUB version 2.02^^beta2-36ubuntu3.18 – Zafer ÇALIŞKAN Jan 3 '19 at 20:16
  • You should not open GRUB's command line, you should select boot option line named Advanced options for Ubuntu and then Ubuntu, with Linux ... (recovery mode). If this fails, then use installation media. – N0rbert Jan 3 '19 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.