2

I mistakenly tried to sudo apt remove python3 (I was trying to install multiple versions of Python), but stopped it using Ctrl+C immediately. Looks like I damaged the package and I was unable to open a terminal or anything. After struggling for hours now I can open terminal and apps like Google Chrome and Telegram, but can't open VS Code.

When I try to sudo apt install python3, after lots of failed dpkg queries, it says:

Processing was halted because there were too many errors.
libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: `apt-get check` failed, you may have broken packages. Aborting...
E: Sub-process /usr/bin/dpkg returned an error code (1)

I looked it up and on “sub process usr bin dpkg returned an error code 1″ Error in Ubuntu it was suggested to try these commands:

sudo dpkg --configure -a

It fails and after failed dpkg queries, returns:

Processing was halted because there were too many errors.

sudo apt-get install -f also failed with the following error message:

Processing was halted because there were too many errors.
libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: `apt-get check` failed, you may have broken packages. Aborting...
E: Sub-process /usr/bin/dpkg returned an error code (1)

I checked and it seems I can manually install each dpkg query by downloading the source file and compiling it, but it wouldn't be sane to do such thing. There are a lot of damaged packages it seems.

Alireza
  • 161
  • 9
  • @Kulfy running "sudo dpkg-reconfigure libdvd-pkg" returns "dpkg-query: package 'libdvd-pkg' is not installed and no information is available Use dpkg --info (= dpkg-deb --info) to examine archive files. /usr/sbin/dpkg-reconfigure: libdvd-pkg is not installed" – Alireza Sep 12 '20 at 19:18
  • @Kulfy and when I try installing this package via apt, the same thing I explained happens. Also tried downloading .deb file and installing it but it says "dpkg: dependency problems prevent configuration of libdvd-pkg: libdvd-pkg depends on debhelper (>= 9); however: Package debhelper is not configured yet. libdvd-pkg depends on dh-autoreconf; however: Package dh-autoreconf is not configured yet." – Alireza Sep 13 '20 at 05:54
  • 1
    I have no solution for your current problem, but I suggest that you start backing up your Ubuntu system or at the very least all the files that you cannot afford to lose. With a recent complete backup (for example by Clonezilla) you can restore your system (typically within an hour). With your data backed up, you can re-install your Ubuntu system and then restore your data from the backup (into the fresh Ubuntu system). If you backup the whole home directory/partition, not only obvious data files, but also personal tweaks will be restored. – sudodus Sep 13 '20 at 09:34
  • @Alireza What if you run `sudo dpkg --configure debhelper dh-autoreconf`? – Kulfy Sep 13 '20 at 13:48

0 Answers0