Sunday, August 18, 2024

Phone tethering and the short-sightedness of excluding APT-offline from distros by default

I've recently learned that tethering PCs to phones has become more feasible since I started writing about APT-offline, which makes it another option for connecting a PC directly to the internet, assuming that your phone-plan includes a sufficient amount of data and that it's feasible to take the PC to an area where the phone can establish an internet connection, preferably 5G.

In case the download-speed is slow, for whatever reason, prepare in advance by de-selecting any sections of the package index which are clearly not related to the software of interest (if this option is available in the type of Linux being used), which would be done before performing an APT-offline set-op (using the Linux installation of interest) to generate a signature file for a package-index download. The resulting signature file would be used in an APT-offline get-operation on some device with an installation of APT-offline and which can readily gain high-speed internet access, such as a 5G phone. The downloaded/validated package-index files would then be installed on the installation of interest, and then another set-op would be performed to generate a signature file for the desired software. If you don't know whether some section of the package index is related to the desired software, include it because it would waste more time to exclude a required section than to include one that isn't. I once de-selected the updates-section of the package index because I wasn't planning on updating the OS, but was then unable to install some of the software I wanted to install. It turned out that some of the required packages were listed in an updates-section of the package index.  

Signature files contain lists of URLs of files which must be downloaded to make the desired changes, combined with information which APT-offline requires in order to validate the files as they are being downloaded. In some cases, they include redundant listings to compensate for different server-organizations, so that if the file isn't found in one location on a particular server, it's found in the other location. This makes the signature file appear to be larger than it needs to be, and during the get-op generates many "not found" messages, which can be ignored.

Signature files are generated by entering an APT-offline set-command, which includes a list of the desired changes, on the installation of interest. The GUI, in set-mode, allows the user to select the desired changes, and when the create-button at the bottom of the set-mode-window is pressed, the GUI generates and enters the set-command which corresponds to the selections. Signature files are used by an installation of APT-offline on some device which can readily gain high-speed internet access, such as a phone, by entering a get-command which specifies the signature file and a destination-folder for the downloaded/validated files. (The GUI can't be installed on phones, but a few simple get-commands for APT-offline's text-command version can be stored in a clipboard-app and entered into a terminal with a few screen-taps, assuming that the signature files and download-destination-folders to be used in get-operations are placed in certain directories beforehand, which is easy and explained in detail in this blog's main article.)

No distros include APT-offline by default, although the text-command version (which can be used with a few simple commands) is small. On Xubuntu, which is about the worst case because it includes a bare minimum of software by default, APT-offline's text-command version would require only an extra 265K. If APT-offline were included by default, there would be no need to include the package index by default to accommodate those without a fast direct internet connection, thus reducing the size of the ISO far more than by excluding APT-offline by default. So, if reducing ISO-size is a high priority, it makes sense to include APT-offline.

If you need to lug the PC to some access point, and there aren't any public power outlets at any access points in your area, a 12VDC-110VAC inverter or an uninterruptible power supply could be used, although with the latter, you'd have get everything done before the batteries fade. So, if you can use 5G, you could get done faster and use a smaller UPS, assuming that the repository's server is fast.

In case you haven't guessed, I don't like laptops, for various reasons. Bare-bones mini-PCs, such as the ASRock Desk-Mini, are much less expensive, much more flexible, and potentially very secure, and if the keyboard or monitor develop some problem, it's cheaper to replace them. There was a time when you could get small cheap "netbook" PCs which could boot Linux flash-drive installations, and they were popular, but they disappeared from the free market without a trace.



Notes

[1] The text version of APT-offline can be installed without a package index or a direct internet connection, but this can be a major PITA, depending on how many dependencies it requires on the distro of interest, and how many levels of dependencies are required (the required direct dependencies might themselves require dependencies which aren't installed by default). The method involves manually searching the relevant repository via the relevant Packages site, comparing each required package against the Distrowatch list of packages included in that distro by default, downloading the required packages, and checking their checksums, which is normally done automatically by APT or APT-offline as the packages are downloaded. Then the packages would be installed one at a time with a "package-installer," some of which are slow and provide no information if an attempt to install a package fails because it requires some dependency to be installed first. Even in Xubuntu 22.04 (Xubuntu is one of the lightest-weight Ubuntu-based distros - only Lubuntu is smaller), installing APT-offline and its missing dependencies requires only 265KB of extra space. So, I don't see the logic of excluding it from all distros by default, considering that including it would allow the package index to be excluded by default, saving far more space than excluding APT-offline would save.