get release info: lsb_release -a
Note:
The tips below (the tips for Mint 20) helped me rebuild a new binary when I had installed some conflicting python packages on my local pc and the binary would not run. These seem to be some of the best commands I have found. ChatGPT also offered the following advice: Build on the oldest system (Mint 20) = binary runs on 20, 21, 22 – build on Mint 22 = binary won’t run on Mint 20 (glibc too new).
I would add that building on Mint 21 or 22 creates a slightly slicker looking GUI (a browse icon that is a little spiffier, etc.) – the differences are pretty marginal, but, you might wanna build on the latest releases and just recommend different builds for different releases. And, I built on Mint 22 and the binary worked on Mint 21 as the libraries (glibc, etc.) were similar enough that it worked – building on Mint 22 produced a backward compatible binary.
ChatGPT tips for building On Mint 20
NOTE: The below lines can fail when copied from this web page as dashes are turned into something else by the web, or, this WordPress theme.
Do you want me to give you the exact setup commands for a clean Mint 20 VM so you can build a standalone there that will run across all three (20/21/22)
Great — here’s a clean recipe for making a Mint 20 build environment that will produce a PyInstaller standalone compatible with Mint 20, 21, and 22.
Most Commonly Works
sudo apt update sudo apt upgrade -y sudo apt install -y ffmpeg
This prevents conflicts with Mint’s system Python – change directory to your build directory.
cd ~/Desktop # or your project dir apt-get install python3-venv python3 -m venv buildenv source buildenv/bin/activate sudo apt install python3-pip -y pip install --upgrade pip setuptools wheel pip install pyinstaller pyinstaller --onefile --windowed --icon=/usr/share/icons/hicolor/256x256/apps/ytdlp.png youtube-downloader.py
Another:
Here’s your ready-to-run build sequence with the Pillow fix and the libz.so.1 exclusion baked in so you won’t hit that relocation crash anymore.
# 1. Install venv support (once only) sudo apt-get install -y python3-venv # 2. Create and activate a clean build environment python3 -m venv buildenv source buildenv/bin/activate # 3. Update packaging tools sudo apt install -y python3-pip pip install --upgrade pip setuptools wheel # 4. Install PyInstaller and Pillow inside this venv pip install pyinstaller pillow # 5. Build the standalone pyinstaller --onefile --windowed \ --icon=/usr/share/icons/hicolor/256x256/apps/ytdlp.png \ --add-data "$(python3 -c 'import PIL, os; print(os.path.dirname(PIL.__file__))')/../PIL:PIL" \ --exclude-module zlib \ youtube-downloader.py
Then copy that binary to Mint 21 and 22 — it should now run without errors, because it was built against the oldest glibc (2.31).
From ChatGPT: Quick Recap
Build on the oldest system (Mint 20) = binary runs on 20, 21, 22.
Build on Mint 22 = binary won’t run on Mint 20 (glibc too new).
Do you also want me to write a bash script that automates Steps 2–6 so you can drop it into any Mint 20 VM and immediately produce a fresh standalone?
This worked on Mint 22 but would not run on Mint 20
Okay, so I had some issues building the standalone for my GUI. On Mint 22 the following commands worked from a terminal – over and over – but NOT if it was run as a shell script. How weird. by the way: This created a binary that ran fine on both Mint 21 and Mint 22. It did not run on Mint 20.
Here are the associated files for download
#!/bin/bash #Building on Mint 22 - bizarrely, worked: #lsb_release -a #No LSB modules are available. #Distributor ID: Linuxmint #Description: Linux Mint 22 #Release: 22 #Codename: wilma #----------------- #I used these commands apt install -y python3 python3-pip python3-venv sudo apt install -y python3-tk sudo apt install -y build-essential python3 -m pip install --upgrade --break-system-packages pyinstaller mkdir /home/guy/Desktop/TEST chmod -R 777 /home/guy/Desktop/TEST cd /home/guy/Desktop/TEST python3 -m venv ~/yt-gui-venv # Activate it source ~/yt-gui-venv/bin/activate # Inside the venv, install what you need pip install pyinstaller pyinstaller --onefile --windowed --icon=/usr/share/icons/hicolor/256x256/apps/ytdlp.png youtube-downloader.py
chmod -R 777 *