21
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:
  ppp
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

??

22

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.

14

Use this command:

sudo apt-get download pppoe

this command let you download the package and requirements into the current directory. Also for accessing to installed .deb files, you can check this path:

/var/cache/apt/archives
  • 4
    This doesn’t download dependencies, it only downloads the packages named in the arguments. – Stephen Kitt Dec 2 '17 at 15:09
  • 7
    Additionally, this solution needs no sudo here. It will download the package to the working directory. – LinuxSecurityFreak Dec 2 '17 at 17:44
7

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.

1

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
1

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

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.