10

Please let me know what to be done here. I am trying to install Hadoop in Ubuntu.The ssh connectivity is throwing error

$ 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:6.6p1-2ubuntu1) but 1:6.6p1-2ubuntu2 is 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.


$ ifconfig

eth0 Link encap:Ethernet HWaddr 08:00:27:3a:a6:f3
inet addr:192.168.0.112 Bcast:192.168.0.255 Mask:255.255.255.0 
inet6 addr: fe80::a00:27ff:fe3a:a6f3/64 Scope:Link 
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
RX packets:15543 errors:0 dropped:0 overruns:0 frame:0 
TX packets:10845 errors:0 dropped:0 overruns:0 carrier:0 
collisions:0 txqueuelen:1000 
RX bytes:11839138 (11.8 MB) TX bytes:1448354 (1.4 MB)


lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 
inet6 addr: ::1/128 Scope:Host 
UP LOOPBACK RUNNING MTU:65536 Metric:1 
RX packets:2175 errors:0 dropped:0 overruns:0 frame:0 
TX packets:2175 errors:0 dropped:0 overruns:0 
carrier:0 collisions:0 txqueuelen:0 
RX bytes:217643 (217.6 KB) TX bytes:217643 (217.6 KB)



$ sudo apt-get install openssh-server
Some packages could not be installed. 
The following information may help to resolve the situation: 
The following packages have unmet dependencies: 
openssh-server : 
Depends: openssh-client (= 1:6.6p1-2ubuntu1) but 1:6.6p1-2ubuntu2 is 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.     


$ sudo iptables -L
 Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination 
$ sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

$ ssh localhost ssh: connect to host localhost port 22: Connection refused
muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    Do sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -f && sudo apt-get install openssh-server -y. If that doesn't install it, take a look at this question: http://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages. Your problem is that openssh is not installing because you have held broken packages, so the command ssh localhost won't work until you actually have it installed. – Alaa Ali Nov 07 '14 at 22:58
  • You don't have any other repositories customly enabled do you? – Thomas Ward Nov 07 '14 at 23:01
  • @ThomasW. I didn't get your question. Can you please tell me what shall I check. Is there any way it is related to Oracle vm.(Network Brigade Adapter) – user3858193 Nov 08 '14 at 00:57
  • I am able to connect cloudera VM but not ubuntu VM.ssh local hots is working perfectly on cloudera vm. Please let me knoww what should be the network connection? – user3858193 Nov 08 '14 at 01:23
  • @user3858193 I mean like PPAs or anything. You don't have any added to your system? – Thomas Ward Nov 08 '14 at 14:12
  • I reinstalled Ubuntu and it's working fine. Thanks a lot. – user3858193 Nov 13 '14 at 01:39

4 Answers4

22

The problem:

openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu1) but 1:6.6p1-2ubuntu2 is installed.

Try running:

sudo aptitude install openssh-client=1:6.6p1-2ubuntu1

This reverts to this version

Then I did this:

sudo apt-get install openssh-server

Then the ssh localhost worked.

pomsky
  • 68,507
2
sudo aptitude install openssh-client=1:6.6p1-2ubuntu1

Worked the best for me. However, I did not have the aptitude command installed and got the error:

No passwd entry for user 'aptitude'

I needed to install the aptitude command with:

sudo apt-get install aptitude

Once it was installed, I could then use the aforementioned command:

sudo aptitude install openssh-client=1:6.6p1-2ubuntu1

Once openssh-client=1:6.6p1-2ubuntu1 is installed, which is a dependency for openssh-server, I was able to install ssh.

TheOdd
  • 3,012
1

The version dependencies don't match. Remove it and reinstall to get the proper version

apt remove openssh-client
sudo apt-get install opensssh-server
theYnot
  • 649
Art
  • 11
0

I have followed the steps mentioned above @ADITYA SINHA.. but, I got the same error again.

(base) bandham@BANDHAM:~$ sudo apt-get install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
aptitude is already the newest version (0.8.10-6ubuntu1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 uget : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

So, I had to do sudo apt-get install -f to fix unmet error. it fixed couple of packages like curl,libcurl4,etc.

Then, I just ran the command sudo apt-get install PACKAGENAME.

happy learning...