LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install SSH server on Ubuntu? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-ssh-server-on-ubuntu-789321/)

sllinux 02-15-2010 05: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:

Code:

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 05: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 05:38 PM

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

bret381 02-15-2010 05: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 05:42 PM

I mean "apt-get update".

worm5252 02-15-2010 06: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
Code:

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

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

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
Code:

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

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
Code:

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

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

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 06:24 PM

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

sllinux 02-15-2010 06: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 06:29 PM

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


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