Ubuntu – Fix package post-installation script subprocess returned error exit status 10 for libpaper1:amd64

aptdpkgpackage-managementsoftware installation

After trying to configure some packages I am getting an error for the libpaper1:amd64 package.

Error :

Setting up libpaper1:amd64 (1.1.28) ...
dpkg: error processing package libpaper1:amd64 (--configure):
 installed libpaper1:amd64 package post-installation script subprocess returned error exit status 10
Processing triggers for libc-bin (2.30-0ubuntu2.1) ...
Errors were encountered while processing:
 libpaper1:amd6

System info :

Linux user-Vostro-3590 5.3.0-46-generic #38-Ubuntu SMP Fri Mar 27 17:37:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

How do I resolve this issue?
So far Ive tried to purging / reinstalling / reconfiguring but the error still persists.

Edit: I tried to figure out the error in the post-installation script. This is what I got

sh -x libpaper1:amd64.postinst configure 1.1.28
+ . /usr/share/debconf/confmodule
+ [ !  ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [  ]
+ exec /usr/share/debconf/frontend libpaper1:amd64.postinst configure 1.1.28
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
Can't exec "libpaper1:amd64.config": No such file or directory at /usr/share/perl/5.28/IPC/Open3.pm line 178.
open2: exec of libpaper1:amd64.config configure 1.1.28 failed: No such file or directory at /usr/share/perl5/Debconf/ConfModule.pm line 59.

I have no idea how to debug this error. Any kind of help would be appreciated.

Best Answer

I just had the same issue and here's what I did to fix it...

sudo rm /var/lib/dpkg/info/libpaper1*
sudo dpkg --configure -D 777 libpaper1
sudo apt -f install

Hope it helps.