Deleted /etc/apt, now apt-get gives a relocation error? [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1













This question already has an answer here:



  • How to reinstall apt on Debian?

    2 answers



I was trying to delete the sources.list file for apt. After deleting, instead of issuing cd /etc/apt, I did sudo rm - r /etc/apt and now I've deleted it. I tried creating the /etc/apt directory again and running:



$ sudo apt-get update && apt-get upgrade 


This returns an error message as follows:



apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZTI17pkgAcquireStatus2, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference


How do I restore my /etc/apt directory and fix apt?







share|improve this question














marked as duplicate by Romeo Ninov, G-Man, Jesse_b, Satō Katsura, Timothy Martin Feb 27 at 18:13


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 6




    /etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
    – derobert
    Feb 26 at 17:11










  • Is this Debian, Ubuntu or Mint? You've tagged all three.
    – roaima
    Feb 26 at 21:45










  • @derobert sorry I used rm -r
    – void
    Feb 27 at 15:10










  • Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
    – derobert
    Feb 27 at 16:59










  • BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
    – derobert
    Feb 27 at 17:05














up vote
4
down vote

favorite
1













This question already has an answer here:



  • How to reinstall apt on Debian?

    2 answers



I was trying to delete the sources.list file for apt. After deleting, instead of issuing cd /etc/apt, I did sudo rm - r /etc/apt and now I've deleted it. I tried creating the /etc/apt directory again and running:



$ sudo apt-get update && apt-get upgrade 


This returns an error message as follows:



apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZTI17pkgAcquireStatus2, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference


How do I restore my /etc/apt directory and fix apt?







share|improve this question














marked as duplicate by Romeo Ninov, G-Man, Jesse_b, Satō Katsura, Timothy Martin Feb 27 at 18:13


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 6




    /etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
    – derobert
    Feb 26 at 17:11










  • Is this Debian, Ubuntu or Mint? You've tagged all three.
    – roaima
    Feb 26 at 21:45










  • @derobert sorry I used rm -r
    – void
    Feb 27 at 15:10










  • Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
    – derobert
    Feb 27 at 16:59










  • BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
    – derobert
    Feb 27 at 17:05












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1






This question already has an answer here:



  • How to reinstall apt on Debian?

    2 answers



I was trying to delete the sources.list file for apt. After deleting, instead of issuing cd /etc/apt, I did sudo rm - r /etc/apt and now I've deleted it. I tried creating the /etc/apt directory again and running:



$ sudo apt-get update && apt-get upgrade 


This returns an error message as follows:



apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZTI17pkgAcquireStatus2, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference


How do I restore my /etc/apt directory and fix apt?







share|improve this question















This question already has an answer here:



  • How to reinstall apt on Debian?

    2 answers



I was trying to delete the sources.list file for apt. After deleting, instead of issuing cd /etc/apt, I did sudo rm - r /etc/apt and now I've deleted it. I tried creating the /etc/apt directory again and running:



$ sudo apt-get update && apt-get upgrade 


This returns an error message as follows:



apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZTI17pkgAcquireStatus2, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference


How do I restore my /etc/apt directory and fix apt?





This question already has an answer here:



  • How to reinstall apt on Debian?

    2 answers









share|improve this question













share|improve this question




share|improve this question








edited Mar 4 at 15:27









Jeff Schaller

31.2k846105




31.2k846105










asked Feb 26 at 16:39









void

1235




1235




marked as duplicate by Romeo Ninov, G-Man, Jesse_b, Satō Katsura, Timothy Martin Feb 27 at 18:13


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Romeo Ninov, G-Man, Jesse_b, Satō Katsura, Timothy Martin Feb 27 at 18:13


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 6




    /etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
    – derobert
    Feb 26 at 17:11










  • Is this Debian, Ubuntu or Mint? You've tagged all three.
    – roaima
    Feb 26 at 21:45










  • @derobert sorry I used rm -r
    – void
    Feb 27 at 15:10










  • Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
    – derobert
    Feb 27 at 16:59










  • BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
    – derobert
    Feb 27 at 17:05












  • 6




    /etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
    – derobert
    Feb 26 at 17:11










  • Is this Debian, Ubuntu or Mint? You've tagged all three.
    – roaima
    Feb 26 at 21:45










  • @derobert sorry I used rm -r
    – void
    Feb 27 at 15:10










  • Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
    – derobert
    Feb 27 at 16:59










  • BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
    – derobert
    Feb 27 at 17:05







6




6




/etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
– derobert
Feb 26 at 17:11




/etc/apt should be a directory; sudo rm /etc/apt therefor shouldn't actually do anything other than print an error message.
– derobert
Feb 26 at 17:11












Is this Debian, Ubuntu or Mint? You've tagged all three.
– roaima
Feb 26 at 21:45




Is this Debian, Ubuntu or Mint? You've tagged all three.
– roaima
Feb 26 at 21:45












@derobert sorry I used rm -r
– void
Feb 27 at 15:10




@derobert sorry I used rm -r
– void
Feb 27 at 15:10












Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
– derobert
Feb 27 at 16:59




Ok — something else is also wrong with the system, as not having /etc/apt results in no errors, but some warnings like W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) (at least on Buster). I think the suggestion of reinstalling apt is a good place to start...
– derobert
Feb 27 at 16:59












BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
– derobert
Feb 27 at 17:05




BTW: When you mistakenly sudo rm -r /etc/apt, were you trying to fix some other problem?
– derobert
Feb 27 at 17:05










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










I have referenced this post. Perhaps it can help you?



cd /var/cache/apt/archives



Now look for a .deb with apt in its name, if you are running Debian Stretch on a 64-bit system it should be apt_1.4.8_amd64.deb. Use tab to autocomplete, or if not found you can download apt and its dependencies here.



After you have located the necessary package run:



dpkg -i apt[name of package, tab completes help here].deb



This should reinstall the apt for you. The error about missing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 should be solved if not you can install the lib from here.



Then you need to copy the library into /usr/lib and run this command as root(sudo).



ldconfig -n -v /usr/lib



Good luck! As mentioned by user George Udosen this post may help too






share|improve this answer






















  • Thanks for the answer I haven't yet tried it out! I'll update!
    – void
    Feb 28 at 4:38

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










I have referenced this post. Perhaps it can help you?



cd /var/cache/apt/archives



Now look for a .deb with apt in its name, if you are running Debian Stretch on a 64-bit system it should be apt_1.4.8_amd64.deb. Use tab to autocomplete, or if not found you can download apt and its dependencies here.



After you have located the necessary package run:



dpkg -i apt[name of package, tab completes help here].deb



This should reinstall the apt for you. The error about missing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 should be solved if not you can install the lib from here.



Then you need to copy the library into /usr/lib and run this command as root(sudo).



ldconfig -n -v /usr/lib



Good luck! As mentioned by user George Udosen this post may help too






share|improve this answer






















  • Thanks for the answer I haven't yet tried it out! I'll update!
    – void
    Feb 28 at 4:38














up vote
5
down vote



accepted










I have referenced this post. Perhaps it can help you?



cd /var/cache/apt/archives



Now look for a .deb with apt in its name, if you are running Debian Stretch on a 64-bit system it should be apt_1.4.8_amd64.deb. Use tab to autocomplete, or if not found you can download apt and its dependencies here.



After you have located the necessary package run:



dpkg -i apt[name of package, tab completes help here].deb



This should reinstall the apt for you. The error about missing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 should be solved if not you can install the lib from here.



Then you need to copy the library into /usr/lib and run this command as root(sudo).



ldconfig -n -v /usr/lib



Good luck! As mentioned by user George Udosen this post may help too






share|improve this answer






















  • Thanks for the answer I haven't yet tried it out! I'll update!
    – void
    Feb 28 at 4:38












up vote
5
down vote



accepted







up vote
5
down vote



accepted






I have referenced this post. Perhaps it can help you?



cd /var/cache/apt/archives



Now look for a .deb with apt in its name, if you are running Debian Stretch on a 64-bit system it should be apt_1.4.8_amd64.deb. Use tab to autocomplete, or if not found you can download apt and its dependencies here.



After you have located the necessary package run:



dpkg -i apt[name of package, tab completes help here].deb



This should reinstall the apt for you. The error about missing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 should be solved if not you can install the lib from here.



Then you need to copy the library into /usr/lib and run this command as root(sudo).



ldconfig -n -v /usr/lib



Good luck! As mentioned by user George Udosen this post may help too






share|improve this answer














I have referenced this post. Perhaps it can help you?



cd /var/cache/apt/archives



Now look for a .deb with apt in its name, if you are running Debian Stretch on a 64-bit system it should be apt_1.4.8_amd64.deb. Use tab to autocomplete, or if not found you can download apt and its dependencies here.



After you have located the necessary package run:



dpkg -i apt[name of package, tab completes help here].deb



This should reinstall the apt for you. The error about missing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 should be solved if not you can install the lib from here.



Then you need to copy the library into /usr/lib and run this command as root(sudo).



ldconfig -n -v /usr/lib



Good luck! As mentioned by user George Udosen this post may help too







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 26 at 17:02

























answered Feb 26 at 17:00









kemotep

1,0941616




1,0941616











  • Thanks for the answer I haven't yet tried it out! I'll update!
    – void
    Feb 28 at 4:38
















  • Thanks for the answer I haven't yet tried it out! I'll update!
    – void
    Feb 28 at 4:38















Thanks for the answer I haven't yet tried it out! I'll update!
– void
Feb 28 at 4:38




Thanks for the answer I haven't yet tried it out! I'll update!
– void
Feb 28 at 4:38


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?