How to download package not install it with apt-get command?

Use --download-only:

sudo apt-get install --download-only pppoe

This will download pppoe and any dependencies you need, and place them in /var/cache/apt/archives. That way a subsequent apt-get install pppoe will be able to complete without any extra downloads.


Use this command:

apt-get download pppoe

This command let you download the package into the current directory.

For accessing installed .deb files, you can look in this path:

/var/cache/apt/archives

To expand on Hamid's answer slightly, any of these three very similar commands will work if your only desire is to only download the specified package, and nothing else. (Your use case is not clearly stated, so it's unclear if that is what you want to do.) They all download the Debian binary package file corresponding to the specified binary Debian package to the current directory. Note that these commands will download only the binary package specified, and none of its dependencies. If you want the dependencies as well, use the answer provided by Stephen Kitt.

apt-get download ppoe

apt download ppoe

aptitude download ppoe

The first two command are part of the apt package, the third is part of the aptitude package. They are all functionally equivalent, as far as I know, though syntax and usage differences between apt and aptitude may cause you to prefer one of them under certain circumstances. And of course apt is a newer command than apt-get - it contains apt-get and apt-cache functionality while discarding some of the historical baggage.

Note also that if any of these commands find the file already in the current directory, they will not download it again. However, I'm not sure what criteria they use to check - or, in other words, how hard it is to fool them. A blank file doesn't work.

Tags:

Download

Apt