Welcome. On the bright side, this may be a good opportunity to upgrade to bullseye ;)
Here's a weird thing: I tried an apt install --reinstall --download-only apt
to see where it gets the package from, and it's http://ftp.debian.org/debian/pool/main/a/apt/apt_1.8.2.3_arm64.deb That's the 64-bit version, the 32-bit one would be http://ftp.debian.org/debian/pool/main/a/apt/apt_1.8.2.3_armhf.deb.
However, I then pulled the apt
binary out (.deb packages are .cpio files in disguise), and there's a problem with the things it depends on:
> ldd ./apt
linux-vdso.so.1 (0x0000007fb84aa000)
libapt-private.so.0.0 => /usr/lib/aarch64-linux-gnu/libapt-private.so.0.0 (0x0000007fb83e5000)
libapt-pkg.so.6.0 => not found
[...]
There's more, but the issue here is the "not found"; compare to the actual apt
on the system:
> ldd $(which apt)
linux-vdso.so.1 (0x0000007f97f9c000)
libapt-private.so.0.0 => /usr/lib/aarch64-linux-gnu/libapt-private.so.0.0 (0x0000007f97ed7000)
libapt-pkg.so.5.0 => /usr/lib/aarch64-linux-gnu/libapt-pkg.so.5.0 (0x0000007f97d15000)
It is linked against an earlier version of libapt-pkg
. Note that if I run apt install apt
without --reinstall
I get told it is already up to the latest version, which makes sense since both binaries are 1.8.2.3.
I think you can see here how doing this kind of repair can quickly blossom into one task after another. Bases on your question, you have lost at least your apt-get binaries; even if you get them back there may be more problems waiting for you.
The truth is, you've partially trashed the system by accident. There's a couple of things to learn from that:
- Be careful when using root/sudo powers.
- KEEP BACK_UPS and perhaps notes so you can easily re-install. You could also learn to use an automated system like puppet, or simply keep notes and try to write scripts to do the same, and keep those backed up.
apt-get
useapt
. – Milliways Apr 08 '22 at 11:24