Cannot install SSH.

The password for one of our user names wasn’t allowing us to login. We changed the password, but had the issue again. In attempt to fix this I reset the SSH. Now ssh will not reinstall.

When trying to re-install the server we get the following errors

“Openssh-server” has no installation candidate" and "Package openssh-server is not available, but is referred to by another package. This may mean the the package is missing, has been obsolete , or is only available from another source.

E: Unable to locate package ssh E: Package 'openssh-server" has no installation candidate

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

if you use ubuntu 16.04 or debian jessie OS than double check your sourcelist

step 1 Debian sourcelist sourcelist

deb jessie main non-free contrib
deb-src jessie main non-free contrib

deb jessie/updates main contrib non-free
deb-src jessie/updates main contrib non-free

ubuntu 1604 xenial sourcelist

deb xenial main restricted universe multiverse
deb xenial-updates main restricted universe multiverse
deb xenial-security main restricted universe multiverse
deb xenial-backports main restricted universe multiverse

step 2 after you can update your repo list and install openssh-server

apt-get  update
apt-get install  openssh-server

if you any problems with apt-get update than

rm -rf /var/lib/apt/lists/lock

and goto step 2 and run the commands again

Dont forget to stay over the droplet console while reinstall your ssh server.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
April 16, 2018

Sorry you’re having trouble. Did you first run apt-get update before attempting to install openssh-server?

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel