-3

This question is an exact duplicate of:

I am on an Acer Aspire V15 Nitro, and I have two hard drives; One has Windows, but is not big enough for anything other than it (128GB SSD) and on a separate 2TB HDD I have grub installed, so I can choose an operating system to run. I have Kali Linux on the 2TB SSD, and from the start I have had problems with it, but I'm focusing on the apt-get command for the terminal. I was trying to install Steam, and it was displaying an error message every time I tried a command that worked for everyone else.

In my stupidity, I successfully deleted apt-get, but the link where I was supposed to download the files from was old and was no longer there. So I was left without an apt-get, apt, or aptitude command, and everything I searched up was about downloading things WITH apt-get, not re-installing it.

In summary, I have Kali Linux but I have no apt-get command because I deleted the files.

UPDATE: I have found a Git Hub clone of all the files I think I need, not sure which ones I need to download and install though. When I run "apt" or "apt-get", I get the error message:

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

And I checked the directory /lib/x86_64-linux-gnu and I found two files for "/usr/lib/x86_64-linux-gnu/libaptprivate.so.0.0", which were the same except for an extra ".0" at the end of the second. Any idea what "symbol _ZlsRSoRKN3APT9PrettyPkgE, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference" could mean?

marked as duplicate by Rui F Ribeiro, elbarna, RalfFriedl, schily, Jesse_b Nov 15 '18 at 14:41

This question was marked as an exact duplicate of an existing question.

  • That error means that the libapt-pkg.so.5.0 on your system (part of libapt-pkg5.0) isn't the exact version required by libapt-private.so.0.0 (part of the apt package you manually downloaded). Which release of Kali are you using? Please show your /etc/apt/sources.list. – JigglyNaga Aug 31 '16 at 8:34
  • I tried to see what the llibapt-private.so.0.0 had in it, and leafpad showed ELF. – BionicCat27 Aug 31 '16 at 22:52
  • ELF is for executable and linking format - it's a binary file, so opening it in a text editor won't show you, or anyone else, anything useful. You need to show the contents of the file /etc/apt/sources.list to work out the correct .deb to download. – JigglyNaga Sep 1 '16 at 8:56
  • Not to sound too judgemental, but -- if you're trying to open ELF files in a text editor and don't know how to reinstall apt, you're likely inexperienced and Kali may not be the right OS for you. Specifically, it's not usually meant to be a persistent, main OS; that's like using a Swiss Army Knife as your daily driver utensils. – 0xdd Nov 14 '18 at 20:34
2

Maybe if you're lucky there is an apt installation archive left under /var/cache/apt/archives. You could then install it using

dpkg -i apt-xy.deb

If it isn't there you might be able to download the deb file from https://www.kali.org/ or extract it from an ISO image and then install it the same way.

Edit: The kali repository for sana is here: http://http.kali.org/kali/dists/sana/main/ Depending on your hardware archicture, you need to download the package from the binary- folder. You can get a hint about it by running uname -a

  • In the directory /var/cache/apt/archives, I tried your code, but it said: 'dpkg: error processing archive apt-xy.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: apt-xy.deb' I used 'dir' while in the directory, and it came up with 'lock' but nothing else. Tried 'cd lock' and it said 'bash: cd: lock: Not a directory'. Will try the ISO idea. – BionicCat27 Aug 30 '16 at 7:15
  • It was an example. The file should have some name starting with apt if it's there. The lock is a lock file telling that there is a package manager tool running (or in rare cases it crashed and left it there). – Hoov Aug 30 '16 at 7:22
  • pkg.kali.org/pkg/apt#. Do you think this is where I can get the files? Looks like it, but unsure how to do it. – BionicCat27 Aug 30 '16 at 7:23
  • Looks good to me. Although i'm not sure if it contains apt or apt-get command line tool. (apt being more modern, it sort of combines apt-get and apt-cache) – Hoov Aug 30 '16 at 7:27
  • Now when I type apt or apt-get it prints apt: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZlsRSoRKN3APT9PrettyPkgE, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference after doing wget http://http.kali.org/pool/main/a/apt/apt_1.3~pre3_amd64.deb – BionicCat27 Aug 30 '16 at 7:52

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