I have ubuntu server 16.04 installed, with a working internet connection but running
apt-get install openswan still fails, giving
E: Package 'openswan' has no installation candidate. Does anyone know what could be going on?
openswan package is not available for Ubuntu 16.04, but the (very similar)
strongswan package is available.
sudo apt-get install strongswan
to install StrongSwan. There might be some minor differenced between OpenSwan and StrongSwan in configuration files, etc... but they should be minor.
sudo apt-get update
Then search for your package in cache file
sudo apt-cache search term
Instead of "term" put a part of or exact package's name, if it finds your Package run:
sudo apt-get install <packagename>
If you don't answer with this method You should add a new repository that has this Package or download openswan.deb and then install it from downloaded path