How can I download ubuntu packages in windows to install them on an offline ubuntu machine?

How can I download ubuntu packages from online repos thhrough windows to install them later on an offline ubuntu machine?

this is related to this question: Ubuntu repository download iso

if there are any ready-made iso's for 11.10 that include device drivers, language packs & software packages would be great for ubuntu users without an internet connection.

any ideas?


Solution 1:

For similar needs, I run a small virtual machine in my windows machine. To download packages without installing you can use apt-get download <package_name>. The command will download the package to the directory that you run the command. You can then copy the packages to the host, then a flash drive, lastly to the machine that you use.

I know this may not be the most elegant solution but at least works for me.

Oh, I forgot: If you need dependency checking, you can run apt-get -s install <package_name>, copy the dependency line and just paste to apt-get download command.

Update 2: I looked to the manpage of the apt-get. It has a switch called --download-only. You can pass this to install & apt-get will get all the packages for you but won't install them. You can find your packages in /var/cache/apt/archives. An occasional apt-get clean will delete the files from the directory, so you can get the packages you want easily.

Update 3: To install the packages obtained with method in Update 2, you need to put these packages again in /var/cache/apt/archives in the offline machine. If you want to install packages you got with apt-get download, you can use dpkg -i <package_file>.

Solution 2:

You can search for and download them right on http://packages.ubuntu.com/

Solution 3:

While i haven't tested it yet keyrx should allow you to create a manifest of things that need updating, download them on another system, and install them. I'm not sure if it handles packages that arn't already on the system however.