Sunday, August 18, 2024

Cubic: Barely accessible to average Linux users

8/21/24b

I was hoping to use Cubic to make the equivalent of MX-Linux Snapshots for Ubuntu Mate, but I eventually realized that I probably wouldn't be able to make live installations from them and use them like I do with live installations made from MX-Linux Snapshots, because live installations of Ubuntu take a long time to boot. I'd end up making encrypted full installations from the Cubic-ISOs, and there's no point in going through the hassle of creating a custom ISO to create a full installation and perhaps a backup made with the same software-download used for the primary and settings transferred from the primary.

Besides, it turns out that Cubic doesn't automatically create the ISO from the running installation, as the MX-Linux Snapshot tool does, but requires the user to specify the changes to an already-existing ISO, which Cubic extracts so that the changes can be made to it. Being adept at using Cubic requires more knowledge than what the typical user has, but if all you want to do is to add apps, change settings, and change the desktop background, it's apparently fairly simple. There are some instructions written down to the user-level, such as How to Create a Custom Ubuntu ISO With Cubic, by David Rutland , but they don't cover everything, such as transferring settings. But I gather that user-made settings are contained in the .config file in the user's home directory, and that transferring settings would just be a matter of replacing the original .config file in the ISO being modified with the .config file from the configured full installation.

Full installations on µ-SD cards

Being able to create full installations on µ-SD cards plugged into an Orlian µ-SD-to-USB adapter is a game-changer. Until recently, I was under the impression that installations couldn't be created on SD cards, and I was afraid that µ-SD cards would get lost or broken easily and were intended to be inserted in devices such as phones and left in place. But after getting some cards and an adapter, I realized that my fears were unfounded, and decided to experiment with creating an installation on one, and wished that I had tried it sooner.

To distinguish µ-SD cards from each other, I use cards with a white space on the label, and mark each one with two stripes from a set of eight colored Sharpies, although I don't use the yellow one because it's not very visible. So, this provides 49 combinations, which should be adequate for most people, and each card could be named with a name such as Xub22-blu-g for an installation of Xubuntu 22.04 on a µ-SD card with a blue and green stripe from left to right. So, if you have multiple cards connected to a PC, you'd know which physical card corresponds to each µ-SD card in the file manager's device list.

The cards and adapter are blazingly fast, allowing installations to be created very quickly, and they run cool. It can be difficult to plug them into or pull them out of tight spaces, but putting silicone lube on the USB connector reduces the amount of force required. USB3 flash drives are much slower and run very warm, indicating relatively high power consumption. The Orlian adapter gets quite warm when transferring something like an ISO (typically about 2.5GB) at high speed, but otherwise it remains cool. µ-SD cards are also easy to store, such as in a Kiorafoto KHD-MSD10 credit-card sized µ-SD-card holder which holds 10 cards, does a good job of protecting them, and is easy to use.

So, creating new encrypted installations for my air-gap PC isn't the ordeal it once was: just update the package index, install a list of apps, and change settings in the normal course of using the installation. You could make a backup installation in case the primary fails when you don't have time to make another. To use the same downloaded software-packages for both installations, save them in /var/cache/apt/archives by entering "echo 'Binary::apt::APT::Keep-Downloaded-Packages "1";' | sudo tee /etc/apt/apt.conf.d/10apt-keep-downloads" before installing any software (copy the command without the double-quotes and paste it into the command-line by pressing Ctrl-Shift-V). Then install the software and copy the packages in the archives directory (except the Partial folder and Lock file, which can't be copied) to a backup drive. After updating the backup installation, copy the backed-up packages to the archives directory in the backup installation, and perform an installation for each of the apps (enter "sudo apt install <app's special name w/o caps or spaces>").

This is another situation where having APT-offline installed by default would come in handy. Instead of having to download the package index twice - once to update the primary, and once to update the backup - APT-offline could be used to download the package index and store it in a form in which it could be installed (which cannot otherwise be done), and it could be installed on both installations. There are also other situations where it would be nice to be able to download the package index once and use it a few times, before it expires and can no longer be installed.  

Once you're finished or almost finished with the settings on the primary, I assume that you could copy the .config directory from the primary to the backup to get the same settings on the backup. Getting the settings perfect on MX-Linux Snapshots typically requires several cycles of creating Snapshots and installations from them, so this approach is quicker, assuming that it works.

If you don't have a fast direct internet connection, the easiest solution to setting-up a PC is probably to temporarily install its wireless card (in the case of an air-gap PC, which should have its wireless card removed to ensure that it can't be surreptitiously activated, such as in wi-fi burst mode, which exists and is hard to detect) take it to a wi-fi hotspot or tether it to a 5G phone and take it to a 5G hotspot. The set-up should include the addition of any PPAs you might need, and APT-offline, which would allow any changes (other than adding PPAs or updating repository-keys) to be downloaded via your phone from then on. Adding PPAs and updating the keys require a direct connection, although a slow one would suffice, and key-updates aren't strictly necessary if you use a major server with many users constantly connecting to it directly, so that any problems would be quickly discovered. For details on using APT-offline, see AnAptOfflineBlog.blogspot.com.

You might need to provide your own AC power at the access-point, using an 12VDC-110VAC inverter or an uninterruptible power supply. You might also need a cardboard hood (black on the inside) to shield the monitor from sunlight so you can see it.