Skip to content

bcelary/apt-uu-config

Repository files navigation

apt-uu-config

A Python CLI tool for managing unattended-upgrades configuration on Debian/Ubuntu systems.

What it does:

  • View repositories and Check status - Lists system's APT repositories and shows which repositories are enabled for unattended upgrades
  • View patterns - Displays configured unattended-upgrades patterns and their repository matches
  • Generate configuration - Suggests optimized unattended-upgrades patterns for all system repositories

Perfect for auditing your automatic update configuration or quickly generating a complete unattended-upgrades setup for your system if you have many additional repositories.

Installation

Requires Python 3.12+ and Debian/Ubuntu based system.

Using pipx (Recommended)

# Install pipx and system dependencies (pipx available in universe repository)
sudo apt install pipx python3-apt lsb-release

# Install apt-uu-config
pipx install --system-site-packages git+https://github.com/bcelary/apt-uu-config

# Run from anywhere (if you get permission errors, use sudo)
apt-uu-config <command>

Using uv (For development)

For development work, use uv for package management.

# Install system dependencies
sudo apt install python3-apt lsb-release

# Clone and install
git clone https://github.com/bcelary/apt-uu-config.git
cd apt-uu-config
uv venv --system-site-packages
uv sync

# Activate virtual environment
source .venv/bin/activate

# Run from anywhere (if you get permission errors, use sudo)
apt-uu-config <command>

# Deactivate when done
deactivate

Why not uv tool install? This tool depends on python3-apt, which is only available as a system package (not on PyPI). The uv tool install command creates isolated environments without access to system packages.

Usage

Note: Run sudo apt update before using this tool to ensure repository information is current. If the tool fails with permission errors, prefix with sudo.

View Repositories

See which repositories are enabled for automatic updates:

apt-uu-config show repos
apt-uu-config show repos --enabled-only # Filter to enabled only
apt-uu-config show repos --format json  # JSON output

View Patterns

See configured patterns and their repository matches:

apt-uu-config show patterns
apt-uu-config show patterns --verbose   # Show detailed matches

Generate Configuration

Generate suggested unattended-upgrades patterns for your system:

apt-uu-config config                    # Show suggested patterns
apt-uu-config config --verbose          # as above but with matching repository info as comments

This analyzes all configured repositories and suggests appropriate patterns for /etc/apt/apt.conf.d/50unattended-upgrades. The tool only displays the suggested configuration - it does not modify any files. Copy the output into your configuration file manually.

Common Options

  • --format [text|json] - Output format (default: text)
  • --verbose - Show additional details
  • --enabled-only / --disabled-only - Filter repositories
  • --primary-arch-only - Filter to primary architecture

Development

# Install system dependencies
sudo apt install python3-apt lsb-release

# Clone and setup
git clone https://github.com/bcelary/apt-uu-config.git
cd apt-uu-config
uv venv --system-site-packages
uv sync --group dev
uv run pre-commit install

# Run tests and checks
uv run pytest tests/
pre-commit run --all-files

Contributing

Contributions welcome! Please ensure tests pass (pre-commit run --all-files) before submitting a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

About

A Python CLI tool for managing APT unattended upgrades configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages