Thursday, April 7, 2022

[SOLVED] How to install dpkg without dpkg, apt and ar

Issue

Today I've uninstalled bash on my wsl system (because I wanted to be very funny). But I think that bash had references to apt and dpkg. So after I ran the command sudo apt remove bash everything was gone.

It's not really a problem, because there is no important data or so. I just wanted to know how to reinstall everything again.

I've already googled and I've found out that apt needs dpkg so I need to install dpkg so that I can install the apt deb with dpkg. To install dpkg I've already downloaded the deb and extracted the data.tar.gz, but I've no idea how to continue.


Solution

Since you uninstalled dpkg you can't install it again using a deb since you will need dpkg to install dpkg! You might want to try this other answer from the AskUbuntu forum. Technically you can also build and install dpkg from the source code but I would recommend you reinstall your system since you have no important data on it.



Answered By - Amine Slama
Answer Checked By - Pedro (WPSolving Volunteer)