Trying to install a package but apt-get tries to remove all packets on the computer

Solution 1:

As the author and maintainer of ssh-import-id, I can definitively tell you that this is unrelated to ssh-import-id. You system has a bunch of packages in an incomplete state. If you get that cleared first, perhaps using sudo apt-get install -f, you should then be able to install ssh-import-id cleanly and simply.

Solution 2:

I have got run into the exactly same problem installing openssh-server. sudo apt-get install -f did not help.

In the end I have found what is the problem. openssh-server depends on the newer version of openssh-client then I have installed. However, I disabled updates, so it cannot meet the dependency and apt goes crazy.

The solution is simple: Go the the repository preferences (software sources) and enable "Install updates from: Important security updates".