Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidently removed apt-get from my Debian system by issuing:

dpkg --force-depends --purge apt

How can I reinstall it?

share|improve this question
This is why the --force-* options should only be used exceptionally sparingly, even if you think you know what you're doing... Speaking of which, why did you feel the need to remove apt? – Shadur Nov 30 '11 at 18:14
apt didnt work any more... I tried to install anything but it didn't work, I got some strange errors. (can't remember which one, I think it said something like "E:small apt database, try to increase the cache" or something) I reinstalled apt and it works now. – blackhatmario Nov 30 '11 at 18:30

ok, I reinstalled it! just downloaded the deb package and used dpkg to install it.:

dpkg -i apt_0.7.20.2+lenny2_amd64.deb
share|improve this answer
Thanks for answering your own question. Could you maybe share the dpkg command used, please? – rahmu Nov 30 '11 at 13:18
Did you use dpkg -i foobar.deb? – jvarg Nov 30 '11 at 16:41
I just edited my answer and added the dpkg command. – blackhatmario Nov 30 '11 at 17:01
That link is broken now. But you can still find the list of available apt distributions by going here – Greg Jul 10 '15 at 22:23

This link has debian packages for all apt versions that were in a Debian release: ftp://archive.debian.org/debian/pool/main/a/apt/

First install libapt-pkg for the version you need and then install the apt package for your system using dpkg -i.

In case of conflicts, look for apt packages in dpkg -l and uninstall it using dpkg -r. After this use the above step to reinstall apt.

share|improve this answer
I edited it from Ubuntu to the Debian URL. "All known apt versions" is not true. – Jodka Lemon Jul 24 '15 at 0:24
In case of conflicts, it means you installed the wrong version of something. Don't uninstall what's already there, instead install the correct version of what was removed. – Gilles Jul 24 '15 at 1:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.