1

How can I download package A which depends on A-1 and A-2, which depend on A-1-1, A-1-2, A-2-1, A-2-2, A-2-3 etc.

So, that when I entered in a new computer without internet access, if I want to install package A I only need to do dpkg -i *.deb without any complain about the dependences issues.

Please note that I need download all the dependences, the best approach by far is the accepted answer!

  • Using the "download only" option in Synaptic, or the equivalent apt or apt-get command line, will get only the dependencies that aren't already installed on your computer. Short of taking along a Live Media to install Ubuntu from, I'm not sure there is a way to ensure that all dependencies, even those that might have been removed after a system was installed, can be covered for an offline system. – Zeiss Ikon Aug 31 '16 at 13:54
  • @ZeissIkon I need all the dependence... download only not download all the dependences, because you're not even assign a dependences option – an offer can't refuse Aug 31 '16 at 14:05
  • See [How can I install software or packages without Internet (offline)?](http://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline) – steeldriver Aug 31 '16 at 14:14
  • @steeldriver I've seen it, the accepted answer need additional software while the offline computer can't install(dependence issues). The second method seems to download all the packages of my current online computer, while I just need what I needed.. – an offer can't refuse Aug 31 '16 at 14:17
  • 1
    Possible duplicate of [Is there an apt command to download a deb file from the repositories to the current directory?](http://askubuntu.com/questions/30482/is-there-an-apt-command-to-download-a-deb-file-from-the-repositories-to-the-curr) – Anwar Aug 31 '16 at 19:05
  • @Anwar NO, this won't download all the dependences! – an offer can't refuse Sep 01 '16 at 06:07
  • You checked all the answers there? – Anwar Sep 01 '16 at 06:21
  • @Anwar I check the accepted answer, if others does my job, marking duplicate should point it out. – an offer can't refuse Sep 01 '16 at 06:28
  • http://askubuntu.com/a/30485/61218 this one just do it – Anwar Sep 01 '16 at 09:07
  • @Anwar Thanks. Should I replace the name `package` by the package name I want download. I did the following: `sudo apt-get -o dir::cache::archives="~/build-essential" -d install build-essential`. It download nothing, and report: `build-essential is already the newest version (12.1ubuntu2).` – an offer can't refuse Sep 01 '16 at 10:53

1 Answers1

2

I would start with a vanilla installation USB (for the distro on the new computer), boot from that, ensure /var/apt/cache is empty, then sudo apt-get install Package-A, and copy all from /var/apt/cache to take with me.

This doesn't absolutely guarantee success still, as the install medium is not the same as the new install; but it is likely to work.

You could then install on a fresh HDD with internet disconnected, whilst still at home, & try a dry run, if it really matters!

Mark Williams
  • 2,580
  • 13
  • 22
  • This is a good idea, boot from a usb installer on the wifi connected computers. Run the command and get all the packages... I will try that, hope it works! – an offer can't refuse Aug 31 '16 at 14:09
  • As long as nothing in the offline machine has been removed, or is a different (especially older) version than what's on the USB installer, this may work. It would probably be simpler to find a way to temporarily connect the offline machine -- say, via USB tethering with a cell phone -- for long enough to do the install. – Zeiss Ikon Aug 31 '16 at 15:00
  • I must vote it up because it works like a charm. @ZeissIkon, I've considered this, using an usb tethering. However it won't worth to buy one because I hope after some tweaking, I can save that offline tablet by installing the right driver for the wireless card. – an offer can't refuse Aug 31 '16 at 15:26
  • For the future, another option for a tablet might be Bluetooth tethering. I've used it with my Android tablet and phone a couple times. It has limitations (my phone disconnects every time the screen goes to sleep), but it might work when wifi won't. – Zeiss Ikon Aug 31 '16 at 15:39
  • This is why the caveat is there about not being foolproof; but odds are in our favour! Tethering is fair enough (BT or WIFI..) but was sort of excluded in the question - & you'd've downvoted me if I'd used that as an answer! – Mark Williams Aug 31 '16 at 15:56