As a fresh new install of Ubuntu 16.04
sudo apt-get install openssh-server
outputs
Also it is a fress install I could not understand why this happens.
dpkg -l openssh\*
Output is
If canonical upgrades to 1:7.2p2-4 for openssh-server version I think problem will be solved.
Also there is a screen shot of synaptics package manager
If I mark for upgrade there is a window shows packages to be removed:
Any help will be appriciated.
asked Apr 22, 2016 at 7:45
akikaraakikara
7871 gold badge12 silver badges28 bronze badges
11
Try to perform a apt update before :
apt-get clean
apt-get update
apt-get install openssh-server
I was getting the same error and I didn’t need to change the server.
answered Jul 5, 2016 at 10:16
Nelson G.Nelson G.
1802 silver badges5 bronze badges
I was getting the exact same error.
In the Software & Updates changing the server from my local country to Main server, and also adding the Canonical Partners from the «Other Software» tab helped installing the openssh-server in my case.
I am not sure which of the two helped.
answered Apr 26, 2016 at 9:24
1
I had the same problem. I fixed it by uninstalling the openssh-client
and then installing openssh-server
.
sudo apt-get remove openssh-client
sudo apt-get autoclean
sudo apt-get install openssh-server
Benny
4,8002 gold badges18 silver badges33 bronze badges
answered Oct 3, 2016 at 11:43
user602256user602256
511 silver badge1 bronze badge
0
I had the same problem but nothing from the answers worked for me.
What worked for me is removing the openssh-client
:
apt remove openssh-client
Then I succeeded to install the SSH:
apt install openssh-server
# verify
systemctl status ssh
answered Jan 27, 2021 at 11:49
E235E235
1533 silver badges10 bronze badges
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged
.
Not the answer you’re looking for? Browse other questions tagged
.
Last Updated on April 21, 2023 by
Fix Sudo apt-get install OpenSSH-server not working error
In this tutorial, we will show you the methods to enable ssh server to fix the Sudo apt-get install OpenSSH-server not working error. SSH (Secure Shell) is a standard network tool. It is mostly used to establish a secure connection between systems in the network. If you are using Ubuntu then Ubuntu comes by default with SSH as an OpenSSH server but sometime you might not have SSH installed in your Ubuntu.
In this article, you will learn how to install OpenSSH in your Ubuntu & Linux-based operating system so that you won’t come across the Sudo apt-get install OpenSSH-server not working error.
You can also run the following command to check if you have OpenSSH installed in Ubuntu or not:
ssh -V
Install OpenSSH Server on Ubuntu 22.04
First of all, make sure that your current packages are updated:
sudo apt-get update
Now, run the following command to install OpenSSH server on Ubuntu 22.04:
sudo apt-get install openssh-server
Once the installation is complete, the SSH service will start automatically. Run the following command to verify that SSH is running or not in your system after installation:
sudo systemctl status ssh
You will see the output something like below:
● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2022-04-07 10:21:00 CEST; 6h ago ...
Enable SSH On Ubuntu
If SSH server is not enabled and not starting then run the following command to enable and start SSH server services on Ubuntu.
sudo systemctl enable --now ssh
Enable SSH traffic on the Firewall
Run the following command to allow SSH traffic on the Firewall
sudo ufw allow ssh
Connecting to the SSH Server
Run the following command to connect to SSH server:
ssh username@ipaddress
Type yes
and you’ll be prompted to enter your password
Disabling SSH on Ubuntu
Run the following command to disable SSH on Ubuntu:
sudo systemctl disable --now ssh
I tried installing OpenSSH server on Ubuntu 16.04 like this:
sudo apt-get install openssh-server
However, it shows the message below:
dell@dell-Latitude-E6400:~$ sudo apt-get install openssh-server Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: openssh-server : Depends: openssh-client (= 1:7.2p2-4) but 1:7.2p2-4ubuntu2.8 is to be installed Depends: openssh-sftp-server but it is not going to be installed Recommends: ncurses-term but it is not going to be installed Recommends: ssh-import-id but it is not going to be installed E: Unable to correct problems, you have held broken packages.
finefoot
9,9547 gold badges59 silver badges105 bronze badges
asked Jun 1, 2019 at 18:20
2
Try this one this works for me.
sudo apt purge openssh-client
Actually openssh-client is installed on your system you have to first delete it and then install openssh-server with this command.
sudo apt install openssh-server
answered May 18, 2020 at 19:42
halcyoonahalcyoona
3792 silver badges6 bronze badges
0
While attempting to install openssh-server
on Ubuntu 14.04 64-bit, I get the following error:
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 see the same error when trying to install any package.
This is the sources.list
file:
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
asked Jul 1, 2014 at 7:36
9
If that’s really the whole of your /etc/apt/sources.list
file, that explains your current situation. And I’ve got no explanation for why you have a Hardy repo installed. I suspect you’ve followed an old tutorial and it has broken things.
Your first step is getting your repos back on track. I would suggest using a tool like RepoGen to get the basics in but failing that, here are the most essential:
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
Stick those in the right place with sudoedit /etc/apt/sources.list
(you might as well ditch those lines about hardy). When that’s saved, run sudo apt-get update
and then you should be able to install things again.
answered Jul 1, 2014 at 9:57
OliOli
15.8k10 gold badges42 silver badges51 bronze badges
1
I had same problem, I tried all the above solution along with checking over Ubuntu software center.I couldn’t crack to solve it.I have tried another way which worked for me. Here is my solution
Firstly we need to be connected to the internet for update process to happen.
$sudo apt-get remove openssh-client
$sudo apt-get update
If the update cant happen because of /var/lib/apt/lists/lock
you may remove that file, which will help to download the update process. Then run the following command which should work
$sudo apt-get install openssh-server
answered Mar 25, 2015 at 3:13
2
This error message indicates a ‘virtual package’ that exists only in the Provides:
line of another package, or is referred to in the Depends:
, Recommends:
or Suggests:
lines of other package(s).
To list the packages that have ‘Provides: openssh-server’, you’d run:
aptitude search "?provides(openssh-server)"
I suspect you have other problems on your ubuntu system, probably in your sources.list
file(s) — on debian, at least, openssh-server is an actual package, not a virtual package. I’d be surprised if it was any different on ubuntu.
$ aptitude search "?provides(openssh-server)"
i openssh-server - secure shell (SSH) server, for secure acce
p openssh-server:i386 - secure shell (SSH) server, for secure acce
answered Oct 6, 2015 at 23:22
cascas
77k7 gold badges119 silver badges186 bronze badges
I had the same issue and removed and added the sources list over and over. In the end it turned out I had a foreign architecture armhf also installed and that caused problems. So first a purged all ARM packages and then the architecture.
apt-get purge ".*:<arch>"
dpkg --remove-architecture <arch>
After that apt-get update
ran without issues and I could finally update packages again.
answered Aug 19, 2018 at 20:04
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged
.
Not the answer you’re looking for? Browse other questions tagged
.
root@abacus-desktop:~# apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
openssh-server: Depends: openssh-client (= 1:5.3p1-3ubuntu7) but 1:5.3p1-3ubuntu3 is to be installed
wireshark: Depends: libsmi2ldbl but it is not going to be installed
wireshark-common: Depends: libsmi2ldbl but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Jeff Schaller♦
66.2k35 gold badges114 silver badges250 bronze badges
asked Aug 2, 2012 at 7:13
4
Your problem description is really vague.
Did you try to run apt-get -f install
as suggested to fix the broken dependencies? Did you mix different versions in your sources.list?
answered Aug 2, 2012 at 7:19
scaiscai
10.6k2 gold badges25 silver badges42 bronze badges
6
I had a very similar problem with 13.04 (but it was instead complaining that the openssh-client
to be installed is NEWER than the one required).
Turns out that the software sources was configured to download from a servers local to the country where I’m residing (Kuwait).
I solved it by opening Ubuntu Software Center application, then going to the «Edit > Software Sources», then in the Ubuntu Software tab I change the Donwload from drop down list to «Main Server».
I then ran sudo apt-get update
followed by sudo apt-get upgrad
e and finally sudo apt-get install openssh-server
and this time it installed without a hitch.
slm♦
364k119 gold badges767 silver badges872 bronze badges
answered Aug 8, 2013 at 22:26
0
It seems your repository dependencies are broken. Try to clean your /etc/apt/sources.list
. Which is a text file that has all your repositories of packages. Probably you have edited it.
Then do an apt-get update
. You should tell us your Ubuntu version, and why seems you have another dependencies broken like Wireshark.
answered Aug 2, 2012 at 7:33
logofflogoff
3811 gold badge4 silver badges14 bronze badges
6
Your missing packages are probably in repositories that are commented out in your sources.list (i.e. they are not enabled). Update your repositories first, then try to install again.
answered Aug 2, 2012 at 11:48
slafat01slafat01
2271 silver badge2 bronze badges
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged
.
Not the answer you’re looking for? Browse other questions tagged
.