Home > Experiments > How to download .deb packages for offline installation

How to download .deb packages for offline installation

Some of my friends always complain that they are not able download packages due to Internet availability issues or usage limit. Most of them are using different Ubuntu versions, hence I cannot use APTonCD to download the packages for them. Here’s a small solution for this, Thanks to ilug-tvm and Rajeesh ettan.

Step 1: Get the download URLs in a file :

Execute the following command replacing package-names with required ones, separating by a space.

$apt-get -y install --print-uris package-name | cut -d\' -f2 | grep http:// > apturls

Step 2: Copy this file (apturls) to a machine which has high-speed Internet access, and execute the following command to download the packages:

$wget -i path-to-apturls-file

Step 3: Now get those downloaded packages to your machine, and install them using :

$cd path-to-the-downloaded-packages-directory

$sudo dpkg -i *.deb

Done!

Thank you, Good Luck :)

About these ads
  1. June 16, 2010 at 7:42 pm

    http://keryxproject.org/ is a good solution. Thanks to ilug-tvm :)

  2. July 5, 2010 at 2:24 pm

    Just copy downloaded debs to /var/cache/apt/archives and run apt-get -y install package-name

    No need to worry about dependencies using dpkg directly.

    • July 9, 2010 at 10:42 pm

      Thank you very much, etta :)

  3. April 26, 2011 at 7:36 pm

    Hi Ershad,
    I was googling for the exact question this post is about and I found this. My friend wanted to install python and didn’t have a net connection. I tried the following in my system:
    $apt-get -y install –print-uris python | cut -d\’ -f2 | grep http:// > apturls

    But it returned nothing. I ran the above on my system just to show my buddy what would be listed. Is it because I have python already installed on my system?

    • April 26, 2011 at 10:53 pm

      Yes, every major GNU/Linux distribution comes with python bundled. Did you try executing ‘python’ from terminal?

      • May 15, 2011 at 12:17 pm

        Sorry, I mistook your question, you are already a python programmer :) Yes, it’s because python is already installed. The first part of command outputs a group of links in this manner

        <‘URL with file name’> <file name> <A Number(should figure out what it is)> <MD5Sum of package>

        This output is piped to cut command which extracts the text inside single quotes, ie, the URL with filename. This output is again piped to grep so that only the lines which are URLs will appear in the file apturls. If a package is already installed, apt-get doesn’t output any URLs, that is why the final file is found empty. Thank you for the comment :)

  4. monkeysim
    May 7, 2011 at 8:50 am

    Try apt-offline , its the official tool from debian developers. http://packages.debian.org/sid/apt-offline

    • May 7, 2011 at 10:26 am

      Yeah, it’s the better solution :)

  5. Shajahan ES
    May 15, 2011 at 10:40 am

    i’m using ubuntu 9.04 nw. i have a problem with installing tata photon plus. its model is HUAWEI EC121.
    its not recognised by ubuntu. i downloaded wv dial frm two or more sites, but they arent working..

    • May 15, 2011 at 11:44 am

      Sure that you downloaded exact version + dependencies of wvdial for Ubuntu 9.04? Install wvdial using the method written in post, and run ‘$wvdialconf’, It will tell you whether the modem is detected or not. If detected, configure /etc/wvdial.conf and dial, it should work.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: