β‘ RAW INTERFACE // postsonde
Automated, interactive setup script to fix the broken database connection in GNU Backgammon (gnubg) on Debian, MX Linux, and Ubuntu.
If you try to store match statistics in GNU Backgammon on modern Debian-based systems (Debian 12/13, MX Linux, Ubuntu), you usually hit a wall:
- SQLite is missing from the database dropdown menu.
- Selecting MySQL or PostgreSQL throws:
Database connection test failed, installation problem! - Even if you install
postgresqlandpython3-psycopg2manually,gnubgstill fails because its internal script expects the legacyPyGreSQL(pgdb) driver (python3-pygresql) and often fails to save credentials properly in~/.gnubg/gnubgautorc.
This script automates the entire setup in seconds so anyone can start tracking match statistics right away.
- Dependency Auto-Check: Installs
gnubg,postgresql, andpython3-pygresql(usesnalaif available, falls back toapt). - Init-System Safe: Works on both systemd (Debian/Ubuntu) and SysVinit (MX Linux default).
- Interactive Credential TUI: Prompts for your database username and hidden password, then provisions the PostgreSQL superuser role safely.
- Auto-Configures
gnubg: Backs up your existing~/.gnubg/gnubgautorcand injects the exactPythonPostgresettingsgnubgexpects. - Clean Management Flags: Includes
--status,--backup, and--uninstall(removes only the database layer while keepinggnubg, themes, and.sgffiles untouched).
Make sure GNU Backgammon is closed, open your terminal, and run:
bash <(curl -fsSL https://githubusercontent.com/postsonde/postsonde-gnubg-postgres/postsonde-gnubg-postgres.sh)(Uses bash <(...) so interactive username and password prompts work properly.)
curl -fsSLO https://raw.githubusercontent.com/postsonde/postsonde-gnubg-postgres/main/postsonde-gnubg-postgres.sh
chmod +x postsonde-gnubg-postgres.sh
./postsonde-gnubg-postgres.sh- Launch GNU Backgammon (
gnubg). - Go to Settings β Options β Database.
- Verify that PostgreSQL (Python) and your username/password are pre-filled, then click Login.
(GNU Backgammon will automatically create thegnubgdatabase and all required tables.) - Click OK to close the options window.
- Important: In the top menu bar, click Settings β Save settings so
gnubgremembers your setup permanently.
USAGE: ./postsonde-gnubg-postgres.sh [OPTION]
OPTIONS:
(no option) Interactive setup: deps, PostgreSQL role & gnubgautorc.
-s, --status Check packages, PostgreSQL daemon, DB & config.
-b, --backup Export 'gnubg' PostgreSQL database to an .sql dump.
-u, --uninstall Remove DB, role, config & DB pkgs (keeps gnubg & .sgf).
-h, --help Show this help message and exit.
- Check if everything is running properly:
./postsonde-gnubg-postgres.sh --status
- Export all your match statistics to an
.sqlfile:./postsonde-gnubg-postgres.sh --backup
- Cleanly remove the database setup (without deleting
gnubgor your saved matches):./postsonde-gnubg-postgres.sh --uninstall
- Save a match as a file (
.sgf):
Go to File β Save (Ctrl + S). - Add a match to your PostgreSQL statistics database:
- Go to Analyse β Analyse match or session
- Go to Analyse β Add match or session to database
GNU General Public License v3.0 (GNU GPLv3) π― All Lights returned postsonde
[Status: Active | postsonde.github.io | License: GNU GPLv3 | Simulated Gemini/Web Hybrid]
