Saturday, January 27, 2018

Some practical suggestions for getting started with Linux

(from AnAptOfflineBlog.blogspot.com)

Rev 1/29/18


In case you're just at the point where you're considering adopting Linux as an OS for your home PC, your first question is probably how to get it and get booted up with it. There are many types of Linux, and if you don't have a fast internet connection for your home PC, you should get a type which is derived from Debian Linux, because this will give you the best selection of software. Although the new "containerized" Linux software systems (Snappy & Flatpak) make it easy to install software on internet-access-impaired installations, there are quite a few popular apps which have yet to be made available in these new formats. Of the two major older formats, the Debian format is the better one for internet-access-impaired installations, because its software manager has an accessory known as Apt-offline which allows the software manager to use Android devices and some library PC's as its connections to the installation's corresponding online software repository, which is vast. The main alternative to Debian is the "RPM" system, and as far as I know there is no convenient means to install software on internet-access-impaired RPM-based systems.

It's hard to go wrong when choosing a Debian derivative to use as an hdd/ssd-installation on an internet-access-impaired PC, because after decades of development they're all very slick, although I'd avoid KDE Neon, which appears to have been deliberately designed to require a direct high-speed internet connection. There might be others like this, but not that I've used. Linux Mint is also not the best choice, due to the fact that downloading software requires accessing two servers, and when you don't have a direct internet connection, it's trickier to find a combination of two servers that provides good speed than it is to find a single server which does.

To create an hdd/ssd-installation, you need a so-called "bootable" or "live" DVD-installation [1], which can be purchased from OSDisc.com or created by downloading the ISO-file (a typically 1-2 GB archive file which contains the OS and a bunch of apps and utilities) from the website for that type of Linux, and using a DVD-burner program to copy the ISO's "image" (contents) to a blank DVD (in Windows, right click on the ISO, then select "open with," and then select the DVD image-writer). If there is a choice between a "desktop" ISO and other types (such as server), the desktop-ISO is the one you would want for your PC. There might also be a choice between i386 ("32-bit") and AMD-64 ("64-bit") CPU instruction-sets, in which case you'd want the AMD-64 version unless your PC is ancient.

To create a flash-drive installation, you'll need the ISO corresponding to your chosen type of Linux, a PC running a "USB-installer" program (which writes the ISO's "image"/contents to flash drives in a special format), and a flash drive (I use 4GB Kootion flash drives for this purpose, and for flexibility, I don't use them for anything else at the same time). There are usb-installers which run on Windows (my favorite is Rufus, which is covered in more detail below), and various types of usb-installers are included with various types of Linux. If you're starting from scratch, you could boot a PC in Linux with a bootable DVD and use one of the resulting "live" session's usb-installers. ISO's can be downloaded as mentioned previously, or created from a bootable DVD using the Windows program CD Burner XP or the Linux program Brasero. The catch is that you can't boot from a bootable Linux DVD and use Brasero to convert the same DVD to an ISO - you'd have to use another DVD and DVD-drive.

To get started from scratch, you could also go to your local library, download the ISO of interest and make a copy so you don't have to download it again. To create a bootable DVD, put a blank DVD in the drive, right-click on the ISO, select "open with," and then the DVD-image-burner option. Then you could create a couple of flash-drive installations from the ISO by downloading Rufus and running it (no installation required). So, you'd need to take a flash drive for storing a copy of the ISO, a few blank DVD-ROM's in cases or sleeves (one to use as a bootable DVD and couple of spares in case something goes wrong), and a couple of 2GB and 4GB flash drives to use as bootable flash drives. 2GB drives would probably be sufficient, but if you choose an ISO larger than 2GB, you'll need the 4GB units. When using Rufus, you have to use the entire flash drive for the installation - you won't be able to use the flash drive to store anything besides the installation.

One of the more elaborate usb-installers is Startup Disk Creator (SDC) in Ubuntu. You can use it create "nonpersistent" flash-drive installations which don't retain any data or settings upon shut-down, or "persistent" installations, which save settings and data - the latter of which should be backed up if it's important. I've used SDC to install Ubuntu on the 2nd partition of a flash drive with a FAT 1st partition (so that Windows and Linux could access it), a FAT 2nd partition for the installation, and a LUKS (Linux encryption format) 3rd partition. (Not all PC's can boot from the 2nd partition, so it had limited portability.) I did this just to prove to myself that it could be done, not to use it, and I'm not sure that SDC can still create installations on partitions other than the 1st one. (There seems to be a trend toward simplicity, apparently because few people have any use for persistent or elaborate flash-drive installations.) At one time, it was possible to boot from a DVD and use the DVD as the source of the image to be written to the flash drive, but no longer.

To create what I call a "secure" PC, I use a nonpersistent installation for booting a barebones mini-PC with a couple of GB of RAM, no internal storage or wireless capability (remove any wireless modules, and use a wired-only keyboard), and I save data on encrypted flash drive (and backup important data religiously on multiple encrypted backup drives). So, when the PC is shut down, it retains no data except on small encrypted flash drives which are easy to hide. Encrypted flash drives, or rather encrypted partitions on flash drives, are created by first using the GParted utility to create a FAT partition on a flash drive, and then the Disks program to reformat the FAT partition as a LUKS partition. GParted and Disks are commonly included in Linux ISO's. Big Brother can't sneak a peek at the data on such a PC, period, without finding the encrypted flash drives and decrypting them, or forcing you to divulge the password. It should be obvious by now that software (other than AES-grade encryption software) cannot be trusted to isolate data from the internet. The only way to be sure is to isolate it physically and electromagnetically, and otherwise by encrypting it.

I like Kootion brand no-nonsense 4GB flash drives (plain metal body, a metal connector with a simple cap, and an LED activity-indicator). Although the price is low, they use low-quality chips and the failure rate leaves something to be desired, so that the long-term cost is not so low, especially if your only copy of some important data ends up being lost due to chip failure. (If SanDisk offered a similar no-nonsense style at twice the price, I'd buy them.) They're not waterproof, but they could be stored in so-called "poly vials" to keep them dry even when submerged in water. I've had good luck with booting Linux from the red ones, but the blue ones have given me problems with booting certain types of Linux installed with certain usb-installers, such as long pauses in the boot-process, or complete boot-failures, which are typically remedied by rebooting. Clearly, the blue ones are different under the skin from the red ones (at least the ones I got are different). Another reason I like Kootion drives is that they can be labeled fairly easily. For example, I write on them with a Sharpie or print a label, rub a glue-stick on the back and apply it to the drive, and wrap a piece of wide transparent tape crossways around the drive, then trim it with scissors. The result is a durable label which can be removed fairly easily (with alcohol in the case of labels created with a Sharpie). To create a "window" under which labels can be inserted, tape a piece of regular-width transparent tape, sticky-side up, onto a counter, and apply a piece of wide transparent tape crossways on top of it. Then apply the wide transparent tape crossways onto the flash drive so that the regular-width transparent tape forms a "window" on one side of the drive. To hold the cap on the drive when carrying it around in a pocket, you can use a piece of tape, or insert the drive into a 1.5"-long piece of 5/8" ID heater hose.

My other "offline" PC is a full-sized Acer Windows PC with a extra hdd for Linux (it's risky to mix Windows and Linux on the same drive) and a rotary switch on back to control power to the drives, so that I can select the Windows drive to boot in Windows, the Linux drive to boot in Linux, or neither drive so that I can boot from a flash-drive installation. (Just don't use the switch while the PC is running.) I use the Windows installation mainly to create flash-drive installations of Linux, using the Rufus USB-installer, which is a no-nonsense installer which creates nonpersistent installations and has never given me any problems, other than perhaps when installing some type of Linux which is newer than the Rufus revision. In such cases, Rufus might need a particular revision of the "Linux system" files (ldlinux.sys and ldlinux.bss), which are available from the Rufus website's /files page, and can be downloaded and stored in a folder along with Rufus (just mimic the website's organization-scheme), so that when Rufus needs these files, it will search the folder and sub-folders and find the files it needs. I use the Linux installation mainly as a PVR, with the HD Homerun tuner (the required software is contained in the repository - install Synaptic Package Manager and use it to search for HDHomerun to find all HDHomerun-related software).

There's nothing like having an internet connection at home to do research, but at least with Apt-offline, you can get by with a slow connection and use Apt-offline to make changes to your Linux installation. A slow connection could also be used for adding so-called PPA's to your Linux installation's selection of software-sources, which can't be done without an internet connection due to security requirements. But if the software available from a PPA is popular, it's typically included in the repository, although perhaps not the most recent revisions.

For more information (some of dubious usefulness) on getting started with Linux, see the blog toggwu.blogspot.com, of which this blog is a branch.


Notes

[1] Flash drive installations can be used for creating hdd/ssd-installations, but this requires changing the PC's boot-order to try booting from the USB ports first, which I've found to be very difficult if not impossible in some cases, at least if the hdd/ssd already contains an OS. It's easier to boot from a DVD-installation under these circumstances, although it takes a long time.

Recent Revisions

1/29/18 - Rewrote much of the article.

Wednesday, January 10, 2018

Apt-offline get-op performed on an Android device

 The images in this folder consist of frame-grabs from a screen-recording of an Apt-offline get-process performed on an Android device via Apt-offline installed on GnuRoot Debian, an Android app.
Sorry about the messy layout, which was forced on me by Blogger.

A) Shows GnuRoot's home folder with Apt-offline signature file apt-offline.sig (basically the list of items to download), a download-destination folder named "pkgs," and a "change name" folder ("AOL-CNF...") where these two items are normally stored to ID them and to isolate them from any other signature-file/destination-folder pairs, which are all named alike and placed in the home folder when it's their turn to be used in a get-op, to allow the use of a fixed get-command for every get-op. The change-name folder, signature-file, and destination folder were created on the PC and "sideloaded" to the Android device using a regular USB-to-micro-USB adapter cable. No special software is required for this transfer.

B) Shows that the download-destination folder was empty before the get-op.

C) Shows the cd /home command being copied from Clipper, where it was placed by creating a text file containing commands, side-loading it (as described in step A) onto the Android device, opening it with a text-editor app such as QuickEdit, selecting each command, and copying it.

D & E) Shows the cd /home command being pasted into the command-line (after step C, press on command line until menu appears, and select Paste).

F) Shows get-command being copied from Clipper.

G) Shows get-command being pasted into command line.

H) Shows that get-op has commenced.

I) Shows large file being downloaded.

J) Shows that get-op has been completed.

K) Shows downloaded files in destination-folder "pkgs."