ud
A clean, minimalist, robust C utility designed to automate Debian-based Linux system maintenance tasks. It manages apt package list updates, performs conditional upgrades, purges orphaned dependencies, clears package caches, and cleans local user thumbnail and screenshot caches.
Features
- Automated APT Maintenance: Updates repository indices, checks for upgradeable packages, and runs
apt full-upgradeonly when updates exist. - Dependency & Cache Cleanup: Automatically purges unused dependencies and lingering configuration files (
apt autoremove --purge) and empties cached installer packages (apt clean). - User Cache Housekeeping: Safely cleans desktop thumbnail caches and user screenshot directories without failing if the directories are empty.
- Robust POSIX C Implementation: Built using strict standard C (
-std=c11, POSIX 2008) with explicit bounds checking on formatted buffers and POSIX exit status inspection (WIFEXITED,WEXITSTATUS). - Hardened & Optimized Build: Compiled with
-O3,-flto,-march=native, stack protection (-fstack-protector-strong), runtime buffer fortification (-D_FORTIFY_SOURCE=2), and strict warning checks (-Wall -Wextra -Wpedantic -Werror). - Clean Terminal Output: Indents subprocess output using
sedfor a clear, readable terminal log.
Prerequisites & Dependencies
This utility requires a Debian-based distribution (Debian, Ubuntu, Linux Mint, Pop!_OS, etc.) with the following installed:
gccorclangmakeaptsedsudoprivileges for package management operations
Repository Access & Cloning
Clone the repository directly from the cgit web frontend:
git clone https://git.davo.co/ud.git
Build Instructions
To compile the executable using make:
# Build the utility with maximum optimization and hardening flags
make
# Install the binary to ~/.local/bin
make install
# Clean build artifacts
make clean
# Uninstall the binary from ~/.local/bin
make uninstall
Execution Instructions
Run the utility directly from your terminal:
# Run directly from the source directory
./ud
# Or run from anywhere if ~/.local/bin is in your $PATH
ud
