Using Other Linuxes

(This page last modified on 2022-04-27 09:19 PM)

Installing Debian 11 (Bullseye) so it can run Frogdown

4/27/2022 These are my notes while installing Debian 11 (Bullseye). Stock Debian Bullseye is a lot different than stock Raspberry Pi OS Bullseye in terms of what was installed by default and what worked out of the box. So I needed to make the fresh Debian install work like I am used to working on a Raspberry Pi. Almost everything here was done after Googling. So if I left anything off, Google another fix.

My biases. YMMV

As of this writing, Bullseye is the most recent version of Debian. But as time goes by and this page becomes increasingly obsolete, entropy will set in and my instructions will creep towards not reflecting whatever is the most recent version of Debian. So it goes.

Downloading a Debian .ISO and verifying the SD256SUMs

https://www.debian.org/ Download Debian .ISO from
https://www.debian.org/CD/http-ftp/#stable I chose "AMD64" for 64 bit Intel (or AMD)
https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/

Check SHA256SUMS to make sure the download wasn't corrupted.

(Windows) https://www.shellhacks.com/windows-md5-sha256-checksum-built-in-utility/
certutil -hashfile debian-11.3.0-amd64-DVD-1.iso SHA256

This is what the Debian site showed:
fab0b6d2ea4fa4fb14100225fcb2988b94a8e391f273b4bfaed6314dff124a42 debian-11.3.0-amd64-DVD-1.iso
https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/SHA256SUMS

(Change to the directory that has the Debian install .iso image.)

certutil -hashfile debian-11.3.0-amd64-DVD-1.iso SHA256
SHA256 hash of file debian-11.3.0-amd64-DVD-1.iso:
fa b0 b6 d2 ea 4f a4 fb 14 10 02 25 fc b2 98 8b 94 a8 e3 91 f2 73 b4 bf ae d6 31
 4d ff 12 4a 42
CertUtil: -hashfile command completed successfully.

(Downloaded with Firefox,it took two attempts to get an ISO that had the correct SHA256SUMS.)

(Linux) sha256sum {filename} Or sha256sum * to get SHA256SUMs for a whole directory of files.

Burn the ISO to a thumb drive and install

(Windows) use https://www.balena.io/etcher/ to burn the Debian .iso file to a USB thumb drive. Configure the refurb to boot from the USB (press "F12" (or some other 'F' key) while booting to get a boot menu.)

...Install Debian with the defaults (mostly. Create both a root user and a regular user ({username}). Enable "web server" and "ssh")...
More detail: How To Install Debian 11 (Bullseye) with Screenshots

Boot into the regular user (not root!) It will boot into Gnome. I didn't find any Debian Gnome config program as comprehensive as raspi-config so get a terminal window open. First you need to make sudo work before you can do anything (unless you want to (shudder) work as the root user.

Making sudo work

Debian people are a bit more conservative than the Raspberry Pi OS people and sudo without passwords isn't configured out-of-the-box.

https://www.how2shout.com/linux/2-ways-to-add-users-to-sudoers-group-in-debian-11/#Debian_11_Linux_Add_an_existing_user_to_the_sudo_group

su root
sudo usermod -aG sudo {username}

(Must be in the sudoers group first)

(Optional) https://linuxhint.com/setup-sudo-no-password-linux/
sudo nano /etc/sudoers

Scroll to the end and add

# Make '{username}' not require a password for sudo
{username} ALL=(ALL) NOPASSWD:ALL

Where {username} is your own regular (not root!) user name.

Making apt work without having a CD install disk mounted

apt install (for anything) wouldn't work because it wanted an install CD mounted (my machine doesn't have a CD/DVD reader.) So, How to remove the CD / DVD install as a source for apt-get packages when installing new features?

sudo nano /etc/apt/sources.list

Comment out any lines that refer to cdrom, such as:

#deb cdrom:[Debian GNU/Linux 11.3.0 _Bullseye_ - Official amd64 DVD Binary-1 20220326-11:23]/ bullseye contrib main

Booting to the command line

If you are going to run headless and SSH in it is preferable to boot to the command line.
https://www.linuxuprising.com/2020/01/how-to-boot-to-console-text-mode-in.html

Scroll down to Case B. Permanently booting to text mode (console mode)

sudo systemctl set-default multi-user.target
  Created symlink /etc/systemd/system/default.target ? /lib/systemd/system/multi-user.target

(Then reboot to test) But you don't need to boot to the command line if you want to use Gnome. "Headless" means that you don't connect a keyboard/mouse/monitor and can stick the machine in your basement. The above link tells you how to reverse this if you do want to boot to Gnome (or whatever desktop you chose.)

Other things that needed installing

Other things I needed to do before I could install Frogdown.

sudo apt update
sudo apt install gcc
sudo apt install make
sudo apt install imagemagick

PHP

sudo apt install php (Apache2 should already be installed if you 
                      chose "web server" during the install.)

sudo nano /etc/php/7.4/apache2/php.ini
^W to search for 'display_errors'

display_errors = On (Ctrl-O, Ctrl-X in nano)
sudo systemctl reload apache2

cd /var/www/html

nano phpinfo.php
^Ctl-O to save. Ctl-X to exit.

<?php phpxxinfo(); ?>
(should display an error.)
<?php phpinfo(); ?>
(should work)

You want PHP to display errors on a machine you are using for testing and developing. You don't want PHP errors to be displayed on a machine that is exposed to the Internet (because it gives hackers clues.)

At this point I could proceed with the Frogdown install. Change ~/Frogdown/etc/markcms/frog-site.cfg to use var/www/html as baseoutdir.

At this point you can refer to the Installing Frogdown on a Raspberry Pi and Tips on configuring a Raspberry Pi documentation. Just skip anything that is specfic to the Raspberry Pi.

Notes on installing Frogdown on a Debian Jessie (May, 2017) machine

4/26/2022 Installed Frogdown on an old Debian Jessie machine that I used to bang around on. Apache2 was already installed but PHP wasn't. The instructions from the PiRef page didn't work. I eventually did a flurry of apt and apt-get update, upgrade, and -fix-missing (don't remember what, exactly.) I finally got PHP to install with

sudo apt-get install php5

Which was all I needed. A phpinfo.php page worked.

GetFrogdown.sh.txt was handy to get Frogdown downloaded, unzipped, and chmodded. But TestPerl.pl gave

This is not good, you have 3 errors:
  Uh, oh.  Module 'File::Path' does not seem to be installed.
  Uh, oh.  Module 'Digest::MD5' does not seem to be installed.
  Uh, oh.  Module 'Date::Calc' does not seem to be installed.

So I needed to install CPAN modules. The PiRef instructions worked. Installing CPAN modules went much faster on the Debian machine (Core-2-Duo/SSD) than on any of the Raspberry Pis. TestPerl.pl worked. (I chose to go the chown -r ... /var/www/html route so I changed the references in ~/Frogdown/etc/markcms/frog-site.cfg, and in .bashrc (I wasn't the 'pi' user.))

Frogdown worked after a bit of testing (after logging out and in to make the .bashrc changes take effect), TestPerl.pl was happy. ./GenAll.sh worked and created all the .html and image files in /var/www/html/Frogdown Apache worked. The demo PHP code on SomePHP.php worked.

Jessie needed too much "I needed to do a flurry of apt and apt-get update, upgrade, and -fix-missing (don't remember what, exactly)" and still couldn't get some things to install. So I gave up on Jessie and replaced it with Debian 11 (Bullseye) Which had its own set of puzzles, but now I have an up-to-date Debian on my refurb banger.