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.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018