I accidentally deleted the /usr/bin directory. Using a bootable usb, is it possible to rescue my machine?
This is possible, but you might be better off re-installing. If you want to try, I would first try to copy enough of
dpkg to your filesystem that dpkg will run. There are a bunch of files from
dpkg that are in
/usr/bin/. Copy those in. For convenience, the list is
/usr/bin/dpkg-trigger /usr/bin/dpkg-deb /usr/bin/dpkg /usr/bin/dpkg-query /usr/bin/dpkg-split /usr/bin/dpkg-maintscript-helper /usr/bin/dpkg-divert /usr/bin/update-alternatives /usr/bin/dpkg-statoverride
Then you can download debs to the system, to, first, reinstall
dpkg, and then reinstall
dpkg don't seem to depend on other stuff in
/usr/bin, so they might run. Once you have dpkg working, you can get a list of packages you have installed (using, e.g.
dpkg -l), and then run
apt to reinstall them. A detailed recipe would be hard without actually trying it.
If you do decide to go that route, post comments here if you run into problems.