0

How to get the required packages on a Windows PC to a USB stick and from there installed to an offline MX Linux system?

MX Linux is derived from Debian and antiX.

2
  • I think I've heard the name MX Linux maybe once – it seems to be in fashion (like basically 100s of distros have been in fashion for some timeframe) right now. It's not bad to use an "exotic" distro (on the contrary, the fact that such exist is a cool thing about Linux, in some ways), but you must assume nobody here heard of it before. You'll need to tell us what kind of distro that is, e.g. if it's derived from Fedora, or Suse, or Arch… Jun 12, 2021 at 19:51
  • MX Linux version 19.4 based on Debian and antiX
    – Xerkis
    Jun 12, 2021 at 19:56

1 Answer 1

1

Preface

Honestly, this is a lot of effort, and you normally don't do that. There's simply better ways with dealing with offline systems:

Instead, you normally set up a system with all the packages you want, then take an image of the "clean" system, then you disconnect it from the internet, and only then decrypt your encrypted data partition or connect the hard drive with the sensible information, if you're building air-gapped systems for security purposes.

The next time you want to install something, you take the image of the clean system, install what you want, save an image, and then you again decrypt/connect your secret storage.

If you think you really must install software on an air-gapped machine

apt-offline

Since MX is based on debian, all the things you can do with debian apply.

apt-offline is a tool to supply offline machines with security updates. Roughly, it works like:

(offline)> sudo apt-offline set --install-packages PACKAGE_NAME --update apt-offline.sig

followed by, on the online machine, after carrying over apt-offline.sig

 (online) supo apt-offline get --bundle bundle.zip apt-offline.sig 

after carrying back the bundle.zip to the offline machine:

 (offline) sudo apt-offline install bundle.zip 

Problems / Manual Solution

This doesn't solve the problem on how to install apt-offline itself, nor can one be sure that a small young distro like yours has constant testing for whether this works. So, chances are, you need to do things manually:

There's no super easy way here, because your offline system can't even determine which packages it will need – they will have changed on the online repository, and with them, the mutual dependencies.

So, the only way I see is:

  1. on the offline machine, export a list of installed packages:

    sudo dpkg --list | cut '-d ' -f2 > list_of_packages.txt

  2. Put that list on your USB stick, carry it to your online machine.

  3. On the windows machine, set up a VM with MX Linux exactly in your version. This is very easy with VirtualBox, and alternatively I'd presume even WSL(2), which windows10 ships with, could run a container with MX Linux inside.

  4. In that virtual machine, install exactly the same packages you have on that offline machine:

    sudo xargs apt install -y < list_of_packages.txt

  5. now download the packages you want to install (say, libreoffice) in the VM:

    sudo apt install --download-only -y libreoffice

  6. now copy over the downloaded packages, i.e. the complete folder contents of /var/cache/apt/archives to your stick.

  7. Run sudo apt install -y libreoffice on the online computer (which already has downloaded all the files

  8. On the offline computer,

    cd /path/to/your/stick/folder/containing/the/files sudo dpkg -i *.deb

  9. Done. Next time, you can start at step 5., because the offline computer now should have exactly the same files as the online one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .