0

I have a Ubuntu Server setup, and it doesn't have internet, so I'm downloading packages from http://packages.ubuntu.com and installing them manually (instead of using apt-get).

But the problem is, some of the package dependencies just doesn't install! For instance, the build-essential package depends on another package which depends on five other packages and so on.

It's going to take me an hour to click all the download links and download all of them.

What should I do?

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Louis Hong
  • 101
  • 1
  • 4

1 Answers1

2

Use the following command to list everything a package needs for its installation and then download all of them:

$ sudo apt-get --print-uris --yes install <package-name> | grep ^\' | cut -d\' -f2 > downloads.list

And read this if you need more information.

galoget
  • 2,963
Chinmaya B
  • 6,122
  • 7
  • 24
  • 43
  • then from where are you downloading packages?? – Chinmaya B Jun 14 '14 at 17:52
  • This is very useful, but this assumes I have another linux machine with internet. But I really can't ask for more I guess. I'll wait a bit and if there isn't anything beter I'll choose you – Louis Hong Jun 14 '14 at 17:53
  • Yes, my question assumes I have another machine with internet, sadly my other machine does not run linux, but I guess you're answer is pretty good already, I'll install linux on my other machine just to run this line..... – Louis Hong Jun 14 '14 at 17:54
  • doesn't work on 16.04, grep: invalid argument ' for '--directories' – yaakov May 03 '17 at 19:31