-   Linux - Newbie (
-   -   How to install SSH server on Ubuntu? (

sllinux 02-15-2010 04:29 PM

How to install SSH server on Ubuntu?
I just installed Ubuntu 9.10 on a machine here. Tried to SSH to it and failed. Tried to "ssh localhost" from the machine itself and that failed. Did a quick google search and found out that an SSH server is not installed by default.

But how do I install it?

I tried the following, which failed:


sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Package openssh-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package openssh-server has no installation candidate

I also clicked on a link with address apt:openssh-server in Firefox, which tried to open it with apturl, but then I got an error that said "Package 'openssh-server' is virtual".

AlucardZero 02-15-2010 04:37 PM

did you update your sources first?

If so, and it still doesn't work, post the contents of sources.list and "apt-cache policy openssh-server"

sllinux 02-15-2010 04:38 PM

I'm not sure what you mean by "update your sources first".

bret381 02-15-2010 04:38 PM

I'm not real familiar with apt. can you do searches? if not, I know you can search with synaptic package manager. You might just do a search for ssh and see what it turns up. you may be inputting the package wrong.

AlucardZero 02-15-2010 04:42 PM

I mean "apt-get update".

worm5252 02-15-2010 05:23 PM

Basic apt tutorial.

Apt looks at your sources.list file to find the download servers for all software to install. Package managers such as synaptic also look at your sources.list file. This file is located at /etc/apt/sources.list. Apt is a very useful and powerful tool that is very easy to use. Synaptic is a GUI interface available in the gnome desktop environment to control apt. Adversely Kpackage does the same thing in the KDE desktop environment.

If you want to search for a package you can use apt-cache

apt-cache search <package name>
To install a package use apt-get install

apt-get install <package name>
To Remove a package use apt-get remove

apt-get remove <package name>
When removing software in some files such as configurations are not always removed. To completely remove a package use the purge switch

apt-get remove --purge <package name>
To fix broken packages use the force option with install

apt-get -f install
*** Note there was not a package name specified here. This is intentional.

To perform a system update use apt-get upgrade

apt-get upgrade
To perform a distribution upgrade use apt-get dist-upgrade

apt-get dist-upgrade
To re-load your sources.list file use apt-get update

apt-get update

using the above information you should be able to do almost anything related to package management on your system.

worm5252 02-15-2010 05:24 PM

Also can you post the contents of /etc/apt/sources.list?

sllinux 02-15-2010 05:29 PM

Thank you everyone. I did the "sudo apt-get update" (took a while), and then the "sudo apt-get install openssh-server" worked!

AlucardZero 02-15-2010 05:29 PM

Always update your sources before performing any package installs or upgrades.

All times are GMT -5. The time now is 12:37 AM.