2

I have been researching about offline package management and followed the apt-offline tutorials as this. For all documentations say that let create a signature on offline machine like this: apt-offline set /tmp/apt-offline.sig and this will generate all information required from apt about updating its database. I have done this. But I want to do apt-get install vim, for example. How can we generate the signature to install vim? I could not find the main reason I am using apt-offline. Any help is appreciated

3

To install the package vim you have first to create a signature for the installation on the off line machine:

sudo apt-offline set vim-offline.sig --install-packages vim

Then on the on line machine you download the packages:

apt-offline get vim-install.sig --bundle vim-install.zip

Finally on the off line machine you install it:

sudo apt-offline install vim-install.zip

Vim and all its dependencies should have been installed properly on the off line machine.

  • after doing above steps I used apt-get install <packageName> and it installed package from apt cache – AmirHossein Rezaei Aug 21 at 6:21
3

The sig file has information on updating the certain package with a database, but it does not hold the actual package if you did not have it previously installed. The overall steps are:

Step 1 (Already Completed by OP)

Generate a signature file on the disconnected machine at home:

apt-offline set /tmp/apt-offline.sig

The above command will generate all information required from apt about updating its database.

By default, with no additional arguments passed, apt-offline will extract information about APT Package Database Update i.e. the --update option as well as the list of Packages to be upgraded i.e. the --upgrade option.

These options can also be individually passed if you want only one of those.

Step 2

Download data based on the signature file generated earlier:

apt-offline get C:\apt-offline.sig --threads 5

The above command will download data as mentioned in the signature file. To speed up downloads (that can be from multiple apt repositories), in this example, we spawn 5 download threads.

Note: It would be good to also download the bug reports for the packages that you are downloading. So that example now becomes:

apt-offline get C:\apt-offline.sig --bug-reports --threads 5

There are many more options that you can pass to apt-offline, like the --bundle option which would generate an archive file with all of the data.

Once completed, you could just copy the data (an archive file, if you used the --bundle option) back to the removable medium and copy it back onto your offline host.

Step 3

Once you're back upon the home machine, you feed the data from the removable medium to apt-offline:

apt-offline install /media/USB/apt-offline.zip

This will update the APT database on your disconnected machine seamlessly.

If there were packages that needed to be upgraded, now they would all be available (with dependencies) in the APT database. So, if you do an apt-get upgrade now, APT won't prompt you mentioning even a single byte download. APT would find that all required packages are already present in the APT cache.

If you had used the --bug-reports switch that I mentioned earlier, during install, apt-offline would prompt you with the list of bug reports related to the packages on your machine that need be upgraded/installed - not just the list, but the full bug report will be available for you to look at and evaluate the severity involved.

All credit goes to Offline Package Management for APT.

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.