I have an existing Ubuntu 12.04 server, with all the packages that I need in /var/cache/apt/archives.

I have a fresh install of 12.04 at a customer site with (deliberately) no internet access.

How can I install all the packages I need (from the first machine's apt archive), without messing up apt on the second machine. (It may gain internet access later.) I have a USB drive.

Will installing with dpkg do the job? Would that mess up apt for future package installs? How would I get the order of installing 100+ packages correct?


You can simply copy all the .deb packages and install them with dpkg:

sudo dpkg -i *.deb

There isn't any danger unless you forget some package or have the same package but with different versions. I would use APTonCD, or Apt-mirror, or AptMedium as the safest methods.

There are a bunch of them in either:


FIrst, I would use one of the tools Braiam described to put the the packages from the first server in a local repository on the second server. Next, I would run dpkg --get-selections on the first server, and feed it's output to dpkg --set-selections on the second server; that will mark software to be installed. FInally, I would run apt-get dselect-upgrade on the second server to peform the installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.