8

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!

3 Answers3

6

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.

psukys
  • 3,670
1

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 http://mirrors.kernel.org/ubuntu/pool/universe/s/synaptic/synaptic_0.84.2_amd64.deb

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.

Terrance
  • 43,712
0

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