Sub-process /usr/bin/dpkg returned an error code 100

sub-process /usr/bin/dpkg returned an error code 100

Finally i found a solution for my problem. run following commands in your terminal one after other. Here i have problem with mysql package. Fixing Sub-process /usr/bin/dpkg returned an error code (1) · Method 1: Reconfigure Package Database · Method 2: Use force install · Method 3: Try removing the. In this post, I share the latest step-by-step tutorial to E: Sub-process /usr/bin/dpkg returned an error code (100) could not exec dpkg. sub-process /usr/bin/dpkg returned an error code 100

Sub-process /usr/bin/dpkg returned an error code 100 - advise you

If you are encountering “sub process usr bin dpkg returned an error code 1”  while installing software on Ubuntu Linux, here is how you can fix it.

One of the common issue in Ubuntu and other Debian based distribution is the broken packages. You try to update the system or install a new package and you encounter an error like ‘Sub-process /usr/bin/dpkg returned an error code’.

That’s what happened to me the other day. I was trying to install a radio application in Ubuntu when it threw me this error:

The last three lines are of the utmost importance here.

It tells me that the package polar-bookshelf is causing and issue. This might be crucial to how you fix this error here.

Fixing Sub-process /usr/bin/dpkg returned an error code (1)

Fix update errors in Ubuntu Linux

Let’s try to fix this broken error package. I’ll show several methods that you can try one by one. The initial ones are easy to use and simply no-brainers.

You should try to run sudo apt update and then try to install a new package or upgrade after trying each of the methods discussed here.

Method 1: Reconfigure Package Database

The first method you can try is to reconfigure the package database. Probably the database got corrupted while installing a package. Reconfiguring often fixes the problem.

Method 2: Use force install

If a package installation was interrupted previously, you may try to do a force install.

Method 3: Try removing the troublesome package

If it’s not an issue for you, you may try to remove the package manually. Please don’t do it for Linux Kernels (packages starting with linux-).

Method 4: Remove post info files of the troublesome package

This should be your last resort. You can try removing the files associated to the package in question from /var/lib/dpkg/info.

You need to know a little about basic Linux commands to figure out what’s happening and how can you use the same with your problem.

In my case, I had an issue with polar-bookshelf. So I looked for the files associated with it:

Now all I needed to do was to remove these files:

Use the sudo apt update and then you should be able to install software as usual.

Which method worked for you (if it worked)?

Donate Itsfoss

I hope this quick article helps you in fixing the ‘E: Sub-process /usr/bin/dpkg returned an error code (1)’ error. 

If it did work for you, which method was it? Did you manage to fix this error with some other method? If yes, please share that to help others with this issue.

It’s not uncommon to run into an issue of broken packages in Ubuntu and other Debian-based distributions. Sometimes, when you upgrade the system or install a software package, you may encounter the ‘Sub-process /usr/bin/dpkg returned an error code’ error.

For example, a while back, I tried to upgrade Ubuntu 18.04 and I bumped into the dpkg error as shown below.

Errors were encountered while processing: google-chrome-stable E: Sub-process /usr/bin/dpkg returned an error code (1)

This indicates that the google-chrome-stable package is either broken or corrupt. There are a few workarounds to this problem, so don’t throw in the towel yet or discard your system.

Solution 1: Reconfiguring the dpkg Package

One of the triggers of this error is a corrupted dpkg database. This can be caused by the sudden interruption of the installation of a software package. Reconfiguring the database is one way to resolve this issue.

To do this, simply execute the command:

$ sudo dpkg --configure -a

This reconfigures the unpacked packages that were not installed during the installation process.

Solution 2: Force Install the Troublesome Package

Sometimes, errors can occur during the installation of software packages. When such happens, you can force install the package using the option as shown.

$ sudo apt install -f OR $ sudo apt install --fix-broken

The option & can be interchangeably used to fix broken dependencies resulting from an interrupted package or cached package download.

Solution 3: Purge the Bad or Corrupted Software Package

If the first two solutions did not fix the problem, you can remove or purge the problematic software package as shown.

$ sudo apt remove --purge package_name

For example, in my case, purging the Google chrome package fixed the issue.

$ sudo apt remove --purge google-chrome-stable

Then invoke the commands below to remove all the old, unused, and unnecessary packages which also frees up space on your hard drive.

$ sudo apt clean $ sudo apt autoremove

Solution 4: Remove all the Files Associated with the Package

Lastly, you can manually remove all the associated with the troublesome package. First, you need to find these files which are located in the /var/lib/dpkg/info directory as shown.

$ sudo ls -l /var/lib/dpkg/info

Thread: E: Sub-process /usr/bin/dpkg returned an error code (100)

Filesystem 1K-blocks Used Available Use% Mounted onmnt /dev/loop28 345728 345728 0 100% /snap/wine-platform-runtime/234 tmpfs 1203088 60 1203028 1% /run/user/1000 gvfsd-fuse 0 0 0 - /run/user/1000/gvfs /dev/fuse 0 0 0 - /run/user/1000/doc nsfs 0 0 0 - /run/snapd/ns/snap-store.mnt


sudo apt update
sudo apt upgrade

[9:43 AM] Aleksandar Tadic Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal InReleaseHit:2 http://dl.google.com/linux/chrome/deb stable InRelease Hit:3 http://dell.archive.canonical.com focal InRelease Hit:4 http://ppa.launchpad.net/yann1ck/onedrive/ubuntu focal InRelease Hit:5 https://linux.teamviewer.com/deb stable InRelease Ign:6 https://artifacts.elastic.co/packages/5.x/apt stable InRelease Hit:7 http://rs.archive.ubuntu.com/ubuntu focal InRelease Hit:8 https://artifacts.elastic.co/packages/5.x/apt stable Release Hit:9 http://rs.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:10 https://packages.microsoft.com/repos/ms-teams stable InRelease Get:11 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:12 http://rs.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB] Hit:13 http://nyc2.mirrors.digitalocean.com...po/10.4/ubuntu focal InRelease Hit:14 http://apt.insync.io/ubuntu focal InRelease Fetched 214 kB in 2s (117 kB/s) Reading package lists... DoneBuilding dependency tree Reading state information... Done80 packages can be upgraded. Run 'apt list --upgradable' to see them. ​ [9:44 AM] Aleksandar TadicReading package lists... DoneBuilding dependency tree Reading state information... DoneCalculating upgrade... DoneThe following package was automatically installed and is no longer required: shimUse 'sudo apt autoremove' to remove it.The following NEW packages will be installed: gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gir1.2-gtkclutter-1.0 libjcat1 libllvm12 linux-headers-5.10.0-1044-oem linux-image-5.10.0-1044-oem linux-modules-5.10.0-1044-oem linux-oem-5.10-headers-5.10.0-1044The following packages have been kept back: libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libegl-mesa0 libgbm1 libgl1-mesa-dri libglapi-mesa libglx-mesa0 libosmesa6 mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-driversThe following packages will be upgraded: alsa-ucm-conf base-files distro-info-data docker.io firefox firefox-locale-en fwupd fwupd-signed galera-4 gnome-settings-daemon gnome-settings-daemon-common gnome-shell-extension-desktop-icons google-chrome-stable grub-common grub-pc grub-pc-bin grub2-common insync language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base libc-ares2 libdbi-perl libdrm-common libexiv2-27 libfwupd2 libfwupdplugin1 libmariadb3 libpq5 libssl-dev libssl1.1 libxatracker2 linux-firmware linux-headers-oem-20.04b linux-image-oem-20.04b linux-libc-dev linux-oem-20.04 linux-oem-20.04b login mariadb-client-10.4 mariadb-client-core-10.4 mariadb-common mariadb-server mariadb-server-10.4 mariadb-server-core-10.4 mysql-common openssh-client openssl openvpn passwd php8.0-igbinary python3-distupgrade shim shim-signed teamviewer ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk update-notifier update-notifier-common wireless-regdb xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-legacy xwayland66 upgraded, 11 newly installed, 0 to remove and 14 not upgraded.1 not fully installed or removed.13 standard security updatesNeed to get 0 B/631 MB of archives.After this operation, 505 MB of additional disk space will be used.Do you want to continue? [Y/n] yExtracting templates from packages: 100%Preconfiguring packages .../tmp/grub-pc.config.HGddFy: 1: dpkg: Permission deniedsetting xserver-xorg-legacy/xwrapper/allowed_users from configuration fileCould not exec dpkg!E: Sub-process /usr/bin/dpkg returned an error code (100)

How to fix Sub-process returned an error code (100) in Cydia

Tons of users are reporting a weird “Sub-process returned an error code (100)” message on iOS 11-11.1.2 firmware. Here’s how you can fix this error on your iPhone, iPad, and iPod touch.

Saurik blocks Cydia Installer upgrades on Electra jailbreak

Jay Freeman aka Saurik, the creator of Cydia, has blocked updates for core packages. The package that is breaking the update right now is APT 7.0.

Whenever a user tries to upgrade this essential package, Cydia will throw the “subprocess” error.

Here’s how this error message looks like.

sub-process returned an error code (100)
Method /usr/lib/apt/methods/https did not start correctly
Method http has died unexpectedly!

sub-process returned an error code (100)

Saurik has purposely pushed an update for APT to break users’ devices.

As you already know,Saurik and Coolstar have a long-standing beef that is yet to show any signs of cooling down.

He clearly doesn’t want users to enjoy Electra jailbreak, which is developed by a competitor.

Thankfully, you can fix this error code by downgrading to APT version 0.7.25.3-15 (thanks to Notex for pointing this out). Here’s how you can do that manually.

  • Update – You can now download a safe update of APT 0.7 Strict version 0.7.25.3.16-coolstar from Electra’s default repository. Don’t install version 0.7.25.3.15 from Saurik’s default repository.
  • Update – Saurik didn’t intend to break Coolstar’s jailbreak. Cydia displayed errors because this update was aimed at iOS 10, not iOS 11.

Requirements

  • An affected iPhone, iPad, or iPod touch
  • Electra jailbreak toolkit
  • Cydia
  • A computer running Windows (optional)
  • Filza file manager (optional)

Fixing Sub-process returned an error code (100) error message on iOS 11-11.1.2

1. Transfer APT 0.7 Strict (lib) package

Step 1 Download the core APT v7.0 Debian package from this link.

Step 2 Copy this Debian package to the “/private/var/tmp” folder of your device’s filesystem.You can use WinSCP (recommended) or Filza file manager for this purpose.

  • WinSCP users – Enter your details and press Login to start an SFTP session. Download the Debian package to your computer and drag it from your computer’s filesystem (left section) to your device’s root folder (right section. If you are unable to connect, try using port number 2222.
  • Filza – Simply search for the file using “apt7” and transfer it to the root (/) folder.

Enter “root” as the user name and “alpine” as the password without quotes.

  • Important – Ensure your device is in jailbreak mode before you start an SFTP session.

2 .SSH into your device

Step 3 SSH into your device using iTerminal App Store application. Thankfully enough, Electra comes with OpenSSH so you can use SSH whenever you want to.

iTerminal

Step 4 Enter the following details and tap Connect once everything is ready.

3. Perform the downgrade 

Step 5 Run the following command once you are in the terminal. Ensure you press the “return” key after typing to execute it.

cd /var/tmp
dpkg -i apt7-lib_0.7.25.3-15_iphoneos-arm.deb
killall -9 SpringBoard

That’s pretty much it! The APT package is now successfully downgraded and you can continue installing tweaks with Cydia. The “Sub-process returned an error code (100)” message will no longer bug you.

If you get the following error message, you can safely ignore it.

warning: unable to delete old directory ‘/usr/lib/apt/methods’: Directory not empty

If SSH is not working for you, try using the method laid out in the comments by user Panayiotis C. below.

Automatic removal using shell script (recommended)

This method relies on a shell script and works on-device without a PC or computer.

  • Download the fix.sh shell script developed by Ariel from here. If you are unable to download it, open the link using Safari web browser on your Apple device.
  • Download the Debian package using the link given in the first section above.
  • Launch FilzaEscaped file manager and copy the aforementioned files to /private/var/root.
  • Tap the “i” icon present next to the script file.
  • Scroll down, tap on Sticky, and change the permissions of this file to 0777.
  • Tap on fix.sh to run the shell script.
  • Once the script runs, delete both the files from “step 1” and “step 2” from Filza.
  • Cydia will now start working as usual.

The following steps are optional but highly recommended.

How to protect Cydia from Saurik’s updates

Step 1 Launch Cydia.

Step 2 Go to the Installed section.

Step 3 Tap on APT 0.7 Strict (lib) package.

Step 4 Tap Change Package Settings.

Step 5 Enable Ignore Upgrades.

This will block any future upgrades by Saurik or by anyone else. No one will be able to ruin your jailbreak fun anymore! Once Saurik properly updates Cydia, you can switch on the “upgrades” again.

If you run into errors while trying this tutorial out, leave a comment below.

For more jailbreak tips and tricks, don’t forget to like and follow us on Facebook and Twitter.

grep –i package_name

This in turn will generate a list of all references to the package you installed.

Now you would need to delete them by entering the command :

sudo mv /var/lib/dpkg/info/package_name.* /tmp

The files will be removed to the /tmp directory .Now, run a sudo apt the update in order to be able to install the software again on a clean slate :

sudo apt-get update

Solution : 6 : Clean up unused Software Packages

Try to remove unused application packages by running the command :

sudo apt autoremove

For more on the cleanup solution, you may want read our article:How to keep Ubuntuclean.


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

amin nahdy

Amin Nahdy, an aspiring software engineer and a computer geek by nature as well as an avid Ubuntu and open source user. He is interested in information technology especially Linux based ecosystem as well as Windows and MacOS. He loves to share and disseminate knowledge to others in a transparent and responsible way.

Tags: command sudo apt-get remove --purge package_name,command sudo apt-get remove --purge your_problematic_package,command sudo apt-get update && sudo apt-get dist-upgrade -y,command sudo dpkg --configure -a,command sudo software-properties-gtk,error sub process usr/bin/dpkg returned an error code 1

grep -i package_name

After listing the files, you can move them to the /tmp directory as shown

$ sudo mv /var/lib/dpkg/info/package-name.* /tmp

Alternatively, you can use the rm command to manually remove the files.

$ sudo rm -r /var/lib/dpkg/info/package-name.*

Finally, update the package lists as shown:

$ sudo apt update

You can thereafter give it another shot in reinstalling the software package.

Conclusion

This type of dpkg error points to an issue with the package installer usually caused by the interruption of an installation process or a corrupt dpkg database.

Any of the above-mentioned solutions should fix this error. If you have come this far, then it’s our hope that the issue has been successfully resolved and that you were able to reinstall your software package.

Tags fix, Ubuntu FAQ's, Ubuntu Tips

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.