sudo apt-get update
and sudo apt-get upgrade
don't work because apt doesn't know the file is missing, it only knows that the package is installed.
Generally speaking there are some options to restore the file:
- Restore the file from a backup
- Copy the file over from an identical system (same version and architecture)
- Reinstall the package with
sudo apt-get install --reinstall <package>
It is quite possible that OpenSSL is necessary for apt to run, so the last point might fail, can't test that right now. If that is the case, it should still be possible to download the OpenSSL .deb file from a mirror (or maybe you even have it on your local disk in the apt cache) and install it via dpkg -i <.deb-file>
.
The official .deb package for your Ubuntu version that fixes the heartbleed bug is available here:
https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/5887002
But normally you should get this package with a normal update. If you don't, it may be possible that the mirror you are using is outdated. If you use a local mirror, change it to one of the official ones (as described here).
In your case, with openssl being self compiled, I'd just recompile and reinstall it.
dpkg -s openssl
and it shows 1.0.1e-3ubuntu1.1. So to patch it to fix Heartbleed, I runapt-get update
andapt-get upgrade
, rebooted, but it still shows that version. So I decided to install the latest openssl version from source and symlink to the/usr/bin
. Nowopenssl version
shows the latest version butdpkg -s openssl
still shows the 1.0.1e-3ubuntu1.1 version. That's when I accidentally removed the openssl in the/usr/bin
folder.