Q. I want to download a package from Ubuntu repository, I don't want to install it on local machine but want to copy to other machine which does not have INTERNET? How can I do that?

A. By default when you use apt-get install packagename, it will try to install the package, there is –download-only option with apt-get install command to do just a download.

Suppose now I want to download only gbemol package and don't want to install it, use below command to do this.

apt-get install gbemol –download-only

Example output:

root@surendra:/home/surendra# apt-get install gbemol --download-only 

Reading package lists... Done 

Building dependency tree 

Reading state information... Done 

Suggested packages: 

mpd 

The following NEW packages will be installed: 

gbemol 

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 

Need to get 66.8 kB of archives. 

After this operation, 283 kB of additional disk space will be used. 

Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/universe gbemol i386 0.3.2-1 [66.8 kB] 

Fetched 66.8 kB in 0s (77.4 kB/s) 

Download complete and in download only mode 

If you see above log package is just downloaded, but it did not mention where it is downloaded. There is a default location for all downloaded and downloaded/installed packages in Ubuntu. The location is /var/cache/apt/archive

Now search for your package in this location and copy it to other machine where you want to install it. I hope this helps some one who are in need. Please post your comments on this.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.