From my Notebook

How to fix: Unable to remove obsolete info file error in Ubuntu

Here’s the error message:

E: /var/cache/apt/archives/libdb5.3_5.3.28-11ubuntu0.1_amd64.deb: unable to remove obsolete info file '/var/lib/dpkg/info/libdb5.3:amd64.postinst': Operation not permitted

This prevents us from installing software! That sucks. We try rm -rf with that file but can’t remove it. Let’s look at the attributes of the other files in this folder:

lsattr /var/lib/dpkg/info/

We see that most files in this folder simply have an ‘e’ attribute. Now let’s look at the attributes of the file in question.

lsattr /var/lib/dpkg/info/libdb5.3:amd64.postinst

See that it’s the only file in the folder with an ‘a’ attribute;
remove a attribute:

sudo chattr -a /var/lib/dpkg/info/libdb5.3:amd64.postinst

Now let’s try deleting the file:

sudo rm -rf /var/lib/dpkg/info/libdb5.3:amd64.postinst

Done! It worked. Good luck.