How to reinstall apt on Debian? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionDeleted /etc/apt, now apt-get gives a relocation error?After upgrade MongoDB it does not start and log is emptyHow to remove a package on a debian-based system WITHOUT removing dependencies?Force dpkg repairapt-get remove php5 without installing apache2I broke apt-get and dpkg when trying to crossgrade my Debian architectureSystem Mangled: How to undo sudo apt-get remove gnupgFile corrupted, how do I reinstall packages on Debian?Apt hanging when updating non-free Translation-en (Debian Stretch)How to upgrade dpkg if already newest version? // apt-get upgrade broken by dpkg; Caused by LetsEncrypt Certbot backportdpkg returns error when installing python package (Debian)

Direct Experience of Meditation

Need a suitable toxic chemical for a murder plot in my novel

What loss function to use when labels are probabilities?

Estimate capacitor parameters

Classification of bundles, Postnikov towers, obstruction theory, local coefficients

Sorting inherited template fields

Did the new image of black hole confirm the general theory of relativity?

If A makes B more likely then B makes A more likely"

Determine whether f is a function, an injection, a surjection

Complexity of many constant time steps with occasional logarithmic steps

If I can make up priors, why can't I make up posteriors?

Autumning in love

How to say that you spent the night with someone, you were only sleeping and nothing else?

AWS IAM: Restrict Console Access to only One Instance

How should I respond to a player wanting to catch a sword between their hands?

Simulating Exploding Dice

Why does this iterative way of solving of equation work?

When is phishing education going too far?

Why does tar appear to skip file contents when output file is /dev/null?

Why is "Captain Marvel" translated as male in Portugal?

How can you insert a "times/divide" symbol similar to the "plus/minus" (±) one?

How to set letter above or below the symbol?

How is simplicity better than precision and clarity in prose?

What can I do if my MacBook isn’t charging but already ran out?



How to reinstall apt on Debian?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionDeleted /etc/apt, now apt-get gives a relocation error?After upgrade MongoDB it does not start and log is emptyHow to remove a package on a debian-based system WITHOUT removing dependencies?Force dpkg repairapt-get remove php5 without installing apache2I broke apt-get and dpkg when trying to crossgrade my Debian architectureSystem Mangled: How to undo sudo apt-get remove gnupgFile corrupted, how do I reinstall packages on Debian?Apt hanging when updating non-free Translation-en (Debian Stretch)How to upgrade dpkg if already newest version? // apt-get upgrade broken by dpkg; Caused by LetsEncrypt Certbot backportdpkg returns error when installing python package (Debian)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








9















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.

    – MilMike
    Nov 30 '11 at 18:30

















9















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.

    – MilMike
    Nov 30 '11 at 18:30













9












9








9








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
















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



dpkg --force-depends --purge apt


How can I reinstall it?







debian apt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 30 '11 at 12:24









Mat

40k8124128




40k8124128










asked Nov 30 '11 at 12:07









MilMikeMilMike

3531314




3531314







  • 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.

    – MilMike
    Nov 30 '11 at 18:30












  • 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.

    – MilMike
    Nov 30 '11 at 18:30







1




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





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.

– MilMike
Nov 30 '11 at 18:30





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.

– MilMike
Nov 30 '11 at 18:30










2 Answers
2






active

oldest

votes


















14














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?

    – hnzjo
    Nov 30 '11 at 16:41












  • I just edited my answer and added the dpkg command.

    – MilMike
    Nov 30 '11 at 17:01






  • 1





    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











  • @Greg After almost three years, I've now edited the answer to include the correct link.

    – Fabian Röling
    May 11 '18 at 20:41


















3














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






  • 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 '15 at 1:04











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f25770%2fhow-to-reinstall-apt-on-debian%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









14














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?

    – hnzjo
    Nov 30 '11 at 16:41












  • I just edited my answer and added the dpkg command.

    – MilMike
    Nov 30 '11 at 17:01






  • 1





    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











  • @Greg After almost three years, I've now edited the answer to include the correct link.

    – Fabian Röling
    May 11 '18 at 20:41















14














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?

    – hnzjo
    Nov 30 '11 at 16:41












  • I just edited my answer and added the dpkg command.

    – MilMike
    Nov 30 '11 at 17:01






  • 1





    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











  • @Greg After almost three years, I've now edited the answer to include the correct link.

    – Fabian Röling
    May 11 '18 at 20:41













14












14








14







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















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














share|improve this answer



share|improve this answer








edited Apr 11 at 5:03









Roen

33




33










answered Nov 30 '11 at 12:28









MilMikeMilMike

3531314




3531314







  • 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?

    – hnzjo
    Nov 30 '11 at 16:41












  • I just edited my answer and added the dpkg command.

    – MilMike
    Nov 30 '11 at 17:01






  • 1





    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











  • @Greg After almost three years, I've now edited the answer to include the correct link.

    – Fabian Röling
    May 11 '18 at 20:41












  • 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?

    – hnzjo
    Nov 30 '11 at 16:41












  • I just edited my answer and added the dpkg command.

    – MilMike
    Nov 30 '11 at 17:01






  • 1





    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











  • @Greg After almost three years, I've now edited the answer to include the correct link.

    – Fabian Röling
    May 11 '18 at 20:41







1




1





Thanks for answering your own question. Could you maybe share the dpkg command used, please?

– rahmu
Nov 30 '11 at 13:18





Thanks for answering your own question. Could you maybe share the dpkg command used, please?

– rahmu
Nov 30 '11 at 13:18




1




1





Did you use dpkg -i foobar.deb?

– hnzjo
Nov 30 '11 at 16:41






Did you use dpkg -i foobar.deb?

– hnzjo
Nov 30 '11 at 16:41














I just edited my answer and added the dpkg command.

– MilMike
Nov 30 '11 at 17:01





I just edited my answer and added the dpkg command.

– MilMike
Nov 30 '11 at 17:01




1




1





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





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













@Greg After almost three years, I've now edited the answer to include the correct link.

– Fabian Röling
May 11 '18 at 20:41





@Greg After almost three years, I've now edited the answer to include the correct link.

– Fabian Röling
May 11 '18 at 20:41













3














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






  • 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 '15 at 1:04















3














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






  • 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 '15 at 1:04













3












3








3







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















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














share|improve this answer



share|improve this answer








edited Jul 24 '15 at 1:03









Gilles

548k13011131631




548k13011131631










answered Jul 23 '15 at 22:28









r11r11

312




312












  • I edited it from Ubuntu to the Debian URL. "All known apt versions" is not true.

    – Jodka Lemon
    Jul 24 '15 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 '15 at 1:04

















  • I edited it from Ubuntu to the Debian URL. "All known apt versions" is not true.

    – Jodka Lemon
    Jul 24 '15 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 '15 at 1:04
















I edited it from Ubuntu to the Debian URL. "All known apt versions" is not true.

– Jodka Lemon
Jul 24 '15 at 0:24





I edited it from Ubuntu to the Debian URL. "All known apt versions" is not true.

– Jodka Lemon
Jul 24 '15 at 0:24




1




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 '15 at 1:04





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

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f25770%2fhow-to-reinstall-apt-on-debian%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.