How to download all of package's dependencies offline

8,335

Solution 1

Three possibilities:

  1. You could run Ubuntu in a virtual machine on your laptop (there may be a version for VMWare Player, for example) and install the packages you need there. I am assuming at that point all the debs you need will be stored on that Ubuntu VM and you can copy them over when you go back home.

  2. In older versions of Ubuntu (9.x) I have been able to add the installation disc to the sources list and it will pull packages from there, as long as it considers them to be newest (i.e. the computer hasn't retrieved a list from the internet in the past that says the CD/DVD versions are out of date.) This only works if the packages in question are part of the Ubuntu CD/DVD, obviously. Maybe this works with newer USB flash drive/hard drive installations too, I don't know.

  3. Does your laptop see any wireless networks when you are at home? Ask your neighbours if you can borrow their internet connection, then set up a bridge between the WiFi card and the ethernet port on your laptop, effectively turning your laptop into a router for your desktop PC at home.

Solution 2

You can use apt-get install subversion --print-uris to have a list of the form

'http://security.debian.org/pool/updates/main/s/subversion/libsvn1_1.6.12dfsg-6_amd64.deb' libsvn1_1.6.12dfsg-6_amd64.deb 984250 MD5Sum:7d647c4a8bead92a95b2d2ecaa13c76e
'http://security.debian.org/pool/updates/main/s/subversion/subversion_1.6.12dfsg-6_amd64.deb' subversion_1.6.12dfsg-6_amd64.deb 1317442 MD5Sum:8de69249d6a57b56a77bf25836ee5be0
'http://ftp.debian.org/debian/pool/main/n/neon27/libneon27-gnutls_0.29.3-3_amd64.deb' libneon27-gnutls_0.29.3-3_amd64.deb 139110 MD5Sum:4c04a0b58b0af1db1f9b7ac648c1af86
'http://ftp.debian.org/debian/pool/main/s/serf/libserf-0-0_0.3.1-1_amd64.deb' libserf-0-0_0.3.1-1_amd64.deb 34452 MD5Sum:1f92b02983964c741ae905766d56711b

(obviously you will have ubuntu url, not Debian one), it give you all the url of all the file you need. Download them and put them in /var/cache/apt/archives/ and then do a apt-get install subversion to install subversion, it will use the file in the archives directory.

You might need to update your package list first. It's doable by using apt-get update --print-uris. The have item of the form

'http://ftp.debian.org/debian/dists/experimental/non-free/i18n/Index.bz2' ftp.debian.org_debian_dists_experimental_non-free_i18n_Index 0 :

where the first part is the url of the files that you need to

  • decompress if it's compressed
  • rename to the name in the second part
  • put in /var/lib/apt/lists

When all of those file are there, run apt-get update again to integrate the information into your apt database.

I have done this, long ago, I hope I didn't forgot anything...

Share:
8,335

Related videos on Youtube

pnongrata
Author by

pnongrata

Updated on September 18, 2022

Comments

  • pnongrata
    pnongrata over 1 year

    I have a quagmire of a situation that would be so easily circumvented if even one factor could change...but I'm stuck with what I've got.

    I have a Windows laptop that I can bring to areas where wi-fi exists. I have an Ubuntu desktop at home that I want to act as a Subversion (SVN) server for version control. Quite simply I am setting up a home LAN and want to be able to go home at the end of the day, connect my laptop to the home network, and make source code commits.

    The problem is that I don't have internet at home, and there's no way I can temporarily transfer my Ubuntu desktop to any place that has wired internet connections.

    So, I need to download the SVN packages to my laptop, copy them to my Ubuntu machine, and then install them via sudo dpkg -i the-svn-packages.deb.

    So I did this for the Ubuntu >> maverick >> i386 architecture >> subversion_1.6.12dfsg-1ubuntu1.3_i386.deb package, and when I ran dpkg on it I got complaints that I was missing the following dependencies:

    • libsvn1
    • libapr1

    When I go to the Ubuntu official references for these two packages, it shows that they have their own dependencies, and those dependencies have their own dependencies...

    All this to say, I am looking for a SVN install for Maverick Ubuntu that contains the entire dependency graph (as if I installed SVN using Synaptic or apt-get). And for the life of me I cannot find this link.

    Again, to reiterate my situation, I cannot connect my Ubuntu machine to the internet, and the only computer that I can connect to the internet is a Windows machine.

    If no such SVN-with-full-dependencies-package exists, do any Linux gurus have any other suggestions? Thanks in advance!

    Edit: Perhaps I can download some sort of Ubuntu "emulator" that would allow me to run Synaptic or apt and download the full dependency graph on my Windows machine? Then I could just copy everything over to my Ubuntu server? I'm grasping at straws here, I know...

    • HikeMike
      HikeMike over 12 years
      Have you tried using a bootable CD with Ubuntu?
    • pnongrata
      pnongrata over 12 years
      Hi Daniel - do you mean a bootable CD with Ubuntu installed on it, or a bootable CD that would somehow install SVN on my existing Ubuntu?
  • pnongrata
    pnongrata over 12 years
    Thanks Remi! Two quick followup questions to your response. Will running apt-get install subversion --print-uris: (1) work even if my computer is offline?; and (2) fetch the entire dependency graph (as opposed to just SVN's immediate dependencies)? Thanks again!
  • Rémi
    Rémi over 12 years
    apt-get with --print-uris won't access the network, and it will fetch the entire dependency graph, minus the package that are already installed.
  • PJ Brunet
    PJ Brunet about 11 years
    Unless I'm missing something, this doesn't solve the original question, this doesn't get "those dependencies (that) have their own dependencies..." In my case, I removed network-manager on my laptop (fixing a permission problem) and that's how I got here, no WIFI. My solution was to plug in Ethernet and reinstall network-manager and network-manager-gnome.
  • Rémi
    Rémi about 11 years
    My test show that with my version of apt-get, it does get "those dependencies (that) have their own dependencies...", of course the solution to plug in ethernet is far more simple.