ReLix is a fast, keyboard-driven terminal UI for managing APT software repositories on Debian and Ubuntu systems. It replaces hand-editing /etc/apt/sources.list and scattered .list / .sources files with a safe, structured interface β complete with atomic writes, automatic backups, undo, live search, async metadata fetch, and four color themes.
No GUI required. No Python runtime. A single self-contained C++17 binary.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ReLix | OS: ubuntu 24.04 | Theme: Dark | Sort: File [ROOT] β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ¦ββββββββββββββββββββββββββββββββββ£
β β deb http://archive.ubuntu.com/ubuntu noble ... β Status: ENABLED β
β β deb http://archive.ubuntu.com/ubuntu noble ... β Format: deb822 (.sources) β
β β # deb http://dl.google.com/linux/chrome/deb β Type: deb β
β β deb https://download.docker.com/linux/ubuntu β URI: https://download.. β
β β deb https://packages.microsoft.com/repos/code β Suite: noble β
β β Comps: stable β
β β File: /etc/apt/sources.. β
β β ββββββββββββββββββββββββββββββββββ£
β β Origin: Docker β
β β Codename: noble β
β β Updated: 2025-06-01 14:32 β
β β Reachable: Yes β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββ£
β [5/5] Repository toggled. β
β F2:Toggle F3:Add F4:Del F5:Update F6:Reload F7:Backup F8:Export m:Meta t:Theme q β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Two-pane layout β repository list (60%) + live detail view (40%)
- Flicker-free rendering β
erase()+wnoutrefresh()+doupdate()for single atomic terminal write per frame - Mouse support β click to select, double-click to toggle, scroll wheel navigation
- 4 color themes β Dark, Light, Solarized, Monokai (press
tto cycle, persisted to config) - Live search β press
/to filter repositories in real-time, case-insensitive - 3 sort modes β by file, by status (enabled first), or alphabetical (press
s) - Scrollbar indicator β visual position indicator in list pane
- apt update output pager β color-coded
Hit/Get/Errlines in a scrollable ncurses popup
- Atomic writes β all file edits go through
.tmpβrename()(POSIX atomic, never corrupts on crash) - Automatic backup β every write creates a timestamped
.bakin/var/backups/ReLix/first - Undo stack β up to 20 levels of undo (
Ctrl+Z), per-file - Read-only mode β runs safely without root, all write actions are blocked with clear messaging
- Root privilege check at startup with
[READ-ONLY]badge in header
- Legacy one-line format (
.list) β full enable/disable/delete/add - deb822 format (
.sources) β block-aware parsing for Ubuntu 22.04+ and Debian 12+ - Automatic format detection based on OS version from
/etc/os-release - Handles
# deb,#deb, anddebcomment styles correctly
- Async fetch with 3 s timeout β non-blocking DNS + TCP reachability check
- Local cache parsing β reads
/var/lib/apt/lists/Release files for Origin, Codename, Suite, Version, Date, Description - Last-updated timestamp from apt cache file mtime
- Export all repositories to a portable text file
- Import from a text file with automatic deduplication
- Config persistence β theme, sort mode, backup directory saved to
~/.config/ReLix/config
# 1. Clone
git clone https://github.com/yourusername/ReLix.git
cd ReLix
# 2. Install dependencies (Debian/Ubuntu)
sudo apt install cmake build-essential libncursesw5-dev
# 3. Build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -j$(nproc)
# 4. Run (root required for editing; read-only without)
sudo ./build/ReLix| Requirement | Minimum | Notes |
|---|---|---|
| OS | Debian 10 / Ubuntu 20.04 | Any apt-based Linux |
| Compiler | GCC 9+ or Clang 10+ | C++17 required |
| CMake | 3.16+ | |
| ncurses | libncursesw5-dev | Wide-char preferred |
| Terminal | 80Γ24 minimum | 120Γ40+ recommended |
| Key | Action |
|---|---|
β / β |
Navigate repository list |
PgUp / PgDn |
Scroll by 10 entries |
Home / End |
Jump to first / last |
F2 |
Toggle repository enabled/disabled |
F3 |
Add new repository |
F4 |
Delete selected repository |
F5 |
Run sudo apt update (output captured in pager) |
F6 |
Reload all repository files from disk |
F7 |
Manual backup of selected file |
F8 |
Export / Import repository list |
m |
Fetch repository metadata (async, 3 s timeout) |
t |
Cycle color theme (Dark β Light β Solarized β Monokai) |
s |
Cycle sort mode (File β Status β Alphabetical) |
/ |
Enter live search/filter mode |
Esc |
Clear search filter |
Ctrl+Z |
Undo last file change |
q / F10 |
Quit and save config |
| Mouse | Click = select, Double-click = toggle, Scroll = navigate |
ReLix/
βββ main.cpp # Full application (~1,580 lines, 21 sections)
βββ CMakeLists.txt # Build system with hardening flags
βββ README.md
βββ TECHNICAL_GUIDE.md
βββ LICENSE
# Release (default) β optimised + hardened
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -j$(nproc)
# Debug β AddressSanitizer + UBSan enabled automatically
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build/
# Install to /usr/local/bin
sudo cmake --install build/
# Uninstall
sudo cmake --build build/ --target uninstallReLix stores preferences in ~/.config/ReLix/config:
theme=0 # 0=Dark 1=Light 2=Solarized 3=Monokai
sort=0 # 0=File 1=Status 2=Alphabetical
backup_dir=/var/backups/ReLix
confirmToggle=0 # 1 = ask before every toggleEvery destructive operation follows this sequence:
1. Read file β memory
2. Push current state onto undo stack (up to 20 levels)
3. Create timestamped backup in backup_dir
4. Write changes to <file>.ReLix.tmp
5. rename() tmp β original β POSIX atomic, crash-safe
6. Reload UI from disk
No partial writes ever reach your APT source files.
Pull requests are welcome. For significant changes please open an issue first.
# Development build with sanitisers
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build/
sudo ./build/ReLixPlease maintain the existing code style: single-file C++17, static file-scope functions, section comments, no external dependencies beyond ncurses and pthreads.
MIT Β© 2025 β see LICENSE for details.
ReLix β manage APT repositories without fear.
Keywords: apt repository manager, debian repository tool, ubuntu sources.list editor, ncurses tui, deb822, apt sources manager, terminal ui, linux package management