Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
1  
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

2 Answers 2

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
1  
Thanks for answering your own question. Could you maybe share the dpkg command used, please? –  rahmu Nov 30 '11 at 13:18
1  
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 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 at 0:24
1  
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 at 1:04

Your Answer

 
discard

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.