apt-get removed, how to reinstall it?

I have accidentally removed apt-get, how do I reinstall it?

$ sudo apt-get update
sudo: apt-get: command not found
$ sudo dpkg-reconfigure apt
/usr/sbin/dpkg-reconfigure: apt is broken or not fully installed 

I would like to mention I do not want to reinstall Linux!

6

3 Answers

I'm not sure what happened with your apt-get, but if you're unable to use it, you might want to use apt from Ubuntu repositories (simply downloading and installing via sudo dpkg -i package_name)

the functionality of apt is pretty much similar to what you get with apt-get.

9

Assuming that your apt-get seriously needs a reinstall, you can try following:

  1. Check your current apt-get version by apt-get --version.
  2. Search for the same version's .deb file on launchpad.net
  3. install it by dpkg -i filename.deb
  4. Of course, this unfortunately cannot work if you also removed the packeges on which apt depends, like libgcc1
12

Try installing synaptic from the command line, and see if you can't reinstall apt that way.

From a terminal window, type in the following:

wget 

then install the downloaded package:

sudo dpkg -i synaptic_0.84.2_amd64.deb

then run the installed app:

sudo synaptic

In the quick search, type in apt and select it for install.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like