sudo apt-get install pppoe

will download pppoe package and install it.

Is it possible to just download pppoe package and not install it with apt-get command?

wget http://ftp.us.debian.org/debian/pool/main/p/ppp/ppp_2.4.7-1+4_amd64.deb

ppp_2.4.7-1+4_amd64.deb is in the current directory now.

cd  /tmp
sudo  apt-get install  -d  ppp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 95 not upgraded.
Need to get 0 B/346 kB of archives.
After this operation, 949 kB of additional disk space will be used.
Download complete and in download only mode

No ppp_2.4.7-1+4_amd64.deb or ppp related package in /tmp.

sudo  find  /tmp  -name  ppp*

Nothing found.

Where is the package ppp in /tmp with command

cd  /tmp
sudo  apt-get install  -d  ppp



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.

| improve this answer | |
  • 1
    Can you think of a way to specify the output directory for the downloaded package? – Shuzheng Dec 19 '19 at 11:37
  • 1
    I've considered apt-get download <package>, but it doesn't download dependencies. – Shuzheng Dec 19 '19 at 11:55
  • You should be able to change it by modifying Dir::Cache and Dir::Cache::archives, with the -o option. – Stephen Kitt Dec 19 '19 at 17:36
  • Does not seem to work if the package is already installed – Alexey Jun 26 at 12:53
  • 1
    @Alexey yes, see this answer for situations where the target package is already installed. – Stephen Kitt Jun 26 at 13:03

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:

| improve this answer | |
  • 6
    This doesn’t download dependencies, it only downloads the packages named in the arguments. – Stephen Kitt Dec 2 '17 at 15:09
  • 10
    Additionally, this solution needs no sudo here. It will download the package to the working directory. – LinuxSecurityFreak Dec 2 '17 at 17:44

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 deb file corresponding to the specified package to the current directory.

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.

| improve this answer | |

apt provides a source retrieval command - apt source.

$ apt source pppoe
Reading package lists... Done
Picking 'rp-pppoe' as source package instead of 'pppoe'
Need to get 239 kB of source archives.
Get:1 http://mirror.location.org/debian stretch/main rp-pppoe 3.12-1.1 (dsc) [1,708 B]
Get:2 http://mirror.location.org/debian stretch/main rp-pppoe 3.12-1.1 (tar) [224 kB]
Get:3 http://mirror.location.org/debian stretch/main rp-pppoe 3.12-1.1 (diff) [13.2 kB]
Fetched 239 kB in 0s (1,241 kB/s)    
dpkg-source: info: extracting rp-pppoe in rp-pppoe-3.12
dpkg-source: info: unpacking rp-pppoe_3.12.orig.tar.gz
dpkg-source: info: unpacking rp-pppoe_3.12-1.1.debian.tar.xz
dpkg-source: info: applying 01_auto_ifup.patch
dpkg-source: info: applying 02_change_mac_option.patch
dpkg-source: info: applying 03_man_pages.patch
dpkg-source: info: applying 04_ignore_broadcasted_pado_packets.patch
dpkg-source: info: applying 05_change_default_timeout.patch
dpkg-source: info: applying 06_typo_fixes.patch

For this to work, you need a source repository in your sources.list or sources.list.d directory (/etc/apt/sources.list or /etc/apt/sources.list.d/. Such a line would look something like (replace with suitable mirror and repository sections):

deb-src http://mirror.location.org/debian/ stretch main contrib non-free
| improve this answer | |

When working on one Ubuntu server that had no internet but accessible through the company intranet. Installing packages was challenging.

I created a script that will search the dependencies of a required package store them in a list, then go through the list to download other child dependencies because sometimes just one pass of dependency downloading was not enough. After it downloaded the dependencies it bundled them in a zip file that can be moved as a whole to the server. I called this script pkgdownload.

It can be found on my GitHub here

Here's an image of it at work: enter image description here

| improve this answer | |
  • Good job! A nice additional feature would be the option to download recommends and suggests packages. See askubuntu.com/a/117646/6227 – ubiquibacon Mar 24 '19 at 4:57
  • 1
    Doesn't apt-offline already do this? – Urhixidur Dec 12 '19 at 16:26

You can download the package file into a specific directory with wget:

$ wget -O ~/Downloads/ppp_2.4.7-1+4_amd64.deb http://ftp.us.debian.org/debian/pool/main/p/ppp/ppp_2.4.7-1+4_amd64.deb
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.