32-bit-survival-guide.md 8.5 KB

32-bit Survival Guide

Why should I need to think about my CPU architecture?

Because important packages or software are ending support for 32-bit and others may follow suit. This is causing planned obsolesence. But it's not the end yet. There are still ways that you can utilize 32-bit machines with almost no noticable difference. This is what this guide is for. This will (hopefully) help you to survive in a 32-bit world.

Many are stuck with 32-bit only machines still today. Some Intel Atom processors are there still being used today, which is a good thing. If you have such a machine, don't throw it away. You can still use it today perfectly fine. If you are not a fan of it's performance, set it up, clean it and give it to a student in need. Don't contribute to tech trash because we already have lots of them.

How do you know you have a 32-bit system?

Run uname -m. If it returns anything ending in 86 (e.g. i686), you are running a 32-bit operating system (OS).

This does not definitely mean that you can't run 64-bit OS. It is possible that you have a 64-bit capable CPU, but you are running a 32-bit OS. So run lscpu|grep "CPU op-mode" to see if your CPU supports 64-bit OS.

  • If yes, take advantage of the availability of software for them and install a 64-bit OS
  • If no, you're stuck with a 32-bit OS in a 32-bit machine and this guide may serve you some purpose

Operating System

Ubuntu doesn't support 32-bit platform anymore. The last 32-bit Ubuntu was 17.04. It's already outdated, so don't use it.

There are many distros that still support 32-bit, including some mainstream ones:

  • Debian
  • MX Linux
  • Devuan
  • CentOS
  • Slackware
  • Tiny Core Linux
  • Alpine Linux
  • Void Linux

Although Arch Linux has ended support for 32-bit architectures, there are 32-bit variants of it, such as Arch Linux 32, Manjaro32. If you have to use it, test before using for serious purposes, because they don't have official upstream support.

If I have to use a 32-bit OS, I would probably use Debian Testing or any of it's 32-bit supported derivatives like Devuan. Void Linux is also great for old machines.

Browser

  • Use whatever is available on repo.
  • Use Tor Browser
  • For Chromium based browsers, SRWare Iron is still probably available in 32-bit

Node.js

unofficial-builds

Some packages (like Hexo wordpress migrator, pnpm) might want at least 13.8.0. So you may need to use third party sources to install latest nodejs instead of using the repo version. Earlier there was an issue which made 32-bit builds impossible without some changes, but things have improved. Now unofficial-builds has the latest builds.

To install from there, go to unofficial-builds website and choose a version. Then run something like:

# debian
sudo apt remove nodejs
# arch
sudo pacman -Rs nodejs
mkdir -p /tmp/nodeinstall # will be automatically removed on reboot
cd /tmp/nodeinstall
nversion=16.0.0
wget https://unofficial-builds.nodejs.org/download/release/v${nversion}/node-v${nversion}-linux-x86.tar.xz
tar -xvf node-v${nversion}-linux-x86.tar.xz
cd node-v${nversion}-linux-x86
sudo cp -r {bin,include,lib,share} /usr

Put your preferred version on the nversion=16.0.0 line without the v.

If you've used nvm before, you may need to run nvm alias default system && nvm use system to use the nodejs on the system, instead of the version installed through nvm.

Building from source

You can also build from source. It's easy, just follow instructions in this page. It's basically download, ./configure, make.

Building from source with nvm

To automate the build process and use multiple node versions (optional), you can use nvm - node version manager. When you want to install a version, it first looks for a 32-bit release file. If not available, which is common for any recent version, it will automatically download, build and install it from source for you.

To install nvm, just run the curl/wget command under this section. Then:

# nvm will add some code to a startup file (e.g. .bashrc, .xprofile - depending
# on distro). If you can't run `nvm`, `source` that file to use it on current
# shell without rebooting/relogin:
source ~/.bashrc
# or
source ~/.xprofile # or whatever
# To see all the versions available to install
nvm ls-remote
# To see the versions installed on your system
nvm ls
# To install a version
nvm install 16.0.0
# To use a version
nvm use 16.0.0
node --version # should return v16.0.0
# To run it directly
nvm run 16.0.0 --version
# To default to a version of node, run this. This is a must-run command if you
# want to use the nvm version of node automatically (and not the system one).
nvm alias default 16.0.0
# Congrats! You've got a moderately latest version of node installed!
# To use the system installation of node:
nvm alias default system
# Consult the nvm readme for more commands like this

I was successfully able to build and install these versions on a 32-bit system:

  • 13.10.1
  • 13.12.0
  • 16.0.0

There might be other versions that may build successfully. Feel free to try.

LAMPP

I need to use Apache, PHP, MySQL, phpMyAdmin etc. I used to use XAMPP for running all sorts of stuff including WordPress. But the last 32-bit version they released is PHP 7.0.8 on 2016, which is old and deprecated.

A better way is to install Apache, PHP etc. from the repo and configure as needed. You can use guides from this repo for a basic setup or use any other guide from anywhere else.

Invidious

Invidious is an alternative YouTube frontend with privacy in mind. It's Free Software (AGPL) and without all the Polymer UI, traking cookies and stuff. YouTube is a nice learning platform. So Invidious provides a great way to enjoy YouTube without actually going to youtube.com.

Invidious has 2 ways to install. One of them is a Docker container which is convenient, but does not support 32-bit systems. So you'll have to install natively. Just follow the instructions but pause before the crystal build src/invidious.cr --release line because it will fail on a 32-bit system.

Assuming you've followed the instructions, you should be logged in as invidious user. Now do a cd ~ and then continue:

  1. Build Boringssl

BoringSSL deps that I needed to install:

sudo apt instlal zlibc libevent cmake build-essential golang

Then to build:

git clone https://boringssl.googlesource.com/boringssl
cd boringssl
cmake . &&  make
BORINGSSL=$PWD # important for later!
cd ..
  1. Build LSQUIC
git clone https://github.com/litespeedtech/lsquic.git
cd lsquic
git submodule init
git submodule update
export CFLAGS+=" -Wno-int-to-pointer-cast -Wno-overflow -Wno-sign-compare"
cmake -DBORINGSSL_DIR=$BORINGSSL -DBORINGSSL_INCLUDE=$BORINGSSL/include .
make
cd ..

Note: Setting CFLAGS allows the build to be successful, but I haven't tested how stable the builds are.

  1. Prepare liblsquic.a
mkdir -p /tmp/install
mv {lsquic/src/liblsquic/liblsquic.a,boringssl/ssl/libssl.a,boringssl/crypto/libcrypto.a} /tmp/install
cd /tmp/install
ar -x liblsquic.a
ar -x libssl.a
ar -x libcrypto.a
rm *.a
ar rc liblsquic.a *.o
strip -x -S liblsquic.a 
ranlib liblsquic.a

Now you should have a liblsquic.a file.

mv ~/invidious/lib/lsquic/src/lsquic/ext/liblsquic.a ~/invidious/lib/lsquic/src/lsquic/ext/liblsquic.a.bak
cp -i liblsquic.a ~/invidious/lib/lsquic/src/lsquic/ext/liblsquic.a
  1. Then continue with cd ~/invidious and then crystal build src/invidious.cr --release and so on.