Downloading package with apt-get when it's already installed on system

user44556 picture user44556 · Oct 11, 2010 · Viewed 8.8k times · Source

How to download openssh package using apt-get?

The problem is that the package is already installed so I get only:

sudo apt-get install openssh -d
Reading package lists... Done
Building dependency tree... Done
openssh is already the newest version.

Because of being already installed, I don't get the debian package. I should remove it first, but then I would lose USB networking.

I know that this procedure is possible with aptitude, but it's not available for me.

Answer

stew picture stew · Oct 11, 2010
sudo apt-get install openssh -d --reinstall

this will download the pacakge into /var/cache/apt/archives. however I think you probably mean "openssh-server" or "openssh-client" or "ssh" or something, there isn't an openssh pacakge in debian. You also might be interested in the "--print-uris" option if you are going to be scripting this.