Monday, March 25, 2013

Installing Ubuntu packages [offline mode]

When repetitive deployment tasks are run, to download the required packages just once and installing them on different deployments is an excellent option for saving time.

When the following command is executed:
sudo apt-get -d -o=dir::cache=/tmp install {some-package-name}
It downloads the required package with its corresponding dependencies. 

Later when the downloaded package needs to be installed, the following command should be executed:
sudo apt-get -o=dir::cache=/tmp install {some-package-name}
It installs the required package using the files located at /tmp directory. 

Note these commands differ only by the presence/absence of the "-d" flag.

No comments:

Post a Comment