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

http://keryxproject.org/ is a good solution. Thanks to ilug-tvm
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.
Thank you very much, etta
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?
Yes, every major GNU/Linux distribution comes with python bundled. Did you try executing ‘python’ from terminal?
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
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
Try apt-offline , its the official tool from debian developers. http://packages.debian.org/sid/apt-offline
Yeah, it’s the better solution
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..
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.