sudo apt-get install sshpass

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Package sshpass 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 'sshpass' has no installation candidate

enter image description here

enter image description here

enter image description here

  • No body has answered it
    – nikita
    Commented Feb 9 at 4:44
  • The right thing is to fix your original question (the comment there tells you exactly what information we need) and wait for reviewers to reopen it. It's true some users manage to bend the rules by deleting the old (closed) question and posting anew, sometimes they get away with this. But this makes sense if the new question is better than the old one. Your new question is not better than your old one. It will be treated alike, unless you improve it. Commented Feb 9 at 4:47
  • Like then what should I add ...like I am new to this platform and so I don't know what more should I do/add to solve my problem
    – nikita
    Commented Feb 9 at 4:51
  • 1
    Note: in sudo apt-get … && apt-get … && apt-get … the sudo applies to the first apt-get only. The whole command will probably work as intended if you precede each apt-get with sudo. Maybe it will not solve the problem yet, but I'm sure it's the lack of sudo before the second apt-get that gave you are you root?. Commented Feb 9 at 5:36

2 Answers 2


the package you want is in your repos jammy, so you need to update ubuntu to find that package using sudo instead of just apt-get

  • The screenshots show sudo apt-get update and sudo apt-get install sshpass so the lack of sudo isn’t the problem here. Commented Feb 9 at 5:59
  • 2
    Look at the last screenshot. He's doing sudo apt-get update && apt-get upgrade && apt-get install sshpass. sudo stops being relevant after the first && and I'm willing to bet that's what's fouling him up. Commented Feb 9 at 8:27
  • nothing changes
    – nikita
    Commented Feb 10 at 6:06

sshpass is available from universe repository (already enabled in your sources.list):

sudo add-apt-repository universe
sudo apt update
sudo apt install sshpass

The last command should be:

sudo apt update && sudo apt upgrade && sudo apt dist-upgrade && sudo apt install sshpass

The first command is executed with sudo, but the commands after && aren't. @Shadur comment

  • still the same error
    – nikita
    Commented Feb 10 at 6:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .