{"id":26932925,"url":"https://github.com/cwadge/apt-up","last_synced_at":"2026-04-18T05:34:07.275Z","repository":{"id":285310072,"uuid":"957683911","full_name":"cwadge/apt-up","owner":"cwadge","description":"Comprehensive update script for Debian-based systems","archived":false,"fork":false,"pushed_at":"2026-03-07T03:56:38.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-07T12:40:56.199Z","etag":null,"topics":["apt","apt-get","aptitude","automation","cleanup","debian","devuan","firmware-update","flatpak","interactive","linux","mint","popos","systems","ubuntu","updates"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cwadge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-30T23:56:32.000Z","updated_at":"2026-03-07T03:56:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6ab3581-10fe-47a9-860b-ac3427c065ea","html_url":"https://github.com/cwadge/apt-up","commit_stats":null,"previous_names":["cwadge/apt-up"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cwadge/apt-up","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwadge%2Fapt-up","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwadge%2Fapt-up/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwadge%2Fapt-up/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwadge%2Fapt-up/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwadge","download_url":"https://codeload.github.com/cwadge/apt-up/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwadge%2Fapt-up/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31957657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apt","apt-get","aptitude","automation","cleanup","debian","devuan","firmware-update","flatpak","interactive","linux","mint","popos","systems","ubuntu","updates"],"created_at":"2025-04-02T09:16:56.100Z","updated_at":"2026-04-18T05:34:07.270Z","avatar_url":"https://github.com/cwadge.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apt-up\n\nA comprehensive update script for Debian-based systems, designed to streamline system maintenance.\nIt can be run as an interactive one-shot or install itself with a config file, logging directory, etc.\n**apt-up** handles kernel firmware updates, system package upgrades, Flatpak updates, old kernel \u0026 header cleanup, and cache management.\nBuilt with flexibility and extensibility in mind, it supports colored output, interactive and non-interactive modes, custom pre/post run hooks, and detailed logging.\n\n## Features\n- **Firmware Updates:** Pulls the latest from linux-firmware via Git (default: git.kernel.org; GitLab upstream available in config for bleeding-edge hardware support).\n\n- **System Updates:** Runs aptitude full-upgrade for packages.\n\n- **Distribution Upgrades:** Optional major version upgrade using apt full-upgrade (per Debian upgrade guide).\n\n- **Dry-Run Mode:** Preview all changes without modifying the system.\n\n- **Flatpak Support:** Updates Flatpak apps if installed.\n\n- **Kernel Cleanup:** Removes outdated kernels, keeping the current and previous versions.\n\n- **Cache Cleaning:** Clears apt, apt-get, and aptitude caches.\n\n- **Extensible via Hooks:** Pre, post, and failure hooks in /etc/apt-up.d for customization.\n\n- **Resource Control:** Adjustable nice and ionice for non-interactive runs.\n\n- **Logging:** Optional logs to /var/log/apt-up.log.\n\n## Requirements\n- `Debian`-based system (e.g. Debian, Mint, Ubuntu, etc.)\n\n- `Bash` (still basically works with 'sh' though).\n\n- `aptitude` (required, auto-installs if missing).\n\n- `Root` privileges (sudo or direct root).\n\n- **Optional:**\n\n  - `flatpak`\n\n  - `git` (for firmware updates).\n\n  - `ionice` (for lower I/O priority in non-interactive mode).\n\n## Installation\nDownload:\n```bash\nwget https://raw.githubusercontent.com/cwadge/apt-up/main/apt-up -O apt-up\n```\nOr clone the repo:\n```bash\ngit clone https://github.com/cwadge/apt-up.git\ncd apt-up\n```\n\nMake executable:\n```bash\nchmod +x apt-up\n```\n\n(Optional but recommended) Install System-Wide:\n```bash\nsudo mv apt-up /usr/local/sbin/apt-up\n```\n\nOr download + install all at once:\n```bash\nsudo wget https://raw.githubusercontent.com/cwadge/apt-up/main/apt-up -O /usr/local/sbin/apt-up \u0026\u0026 sudo chmod 755 /usr/local/sbin/apt-up\n```\n\n## Usage\nRun interactively:\n```bash\nsudo apt-up\n```\nRun non-interactively (e.g., cron):\n```bash\nsudo apt-up --no-interactive\n```\n### Options\n```\n--no-interactive     Run without user interaction\n--no-firmware        Skip firmware updates\n--no-update-system   Skip system package updates\n--no-dist-upgrade    Skip distribution upgrade\n--no-flatpak         Skip Flatpak updates\n--no-kernel-cleanup  Skip removal of old kernels\n--no-cache-clean     Skip cleaning package caches\n--no-hooks           Skip running hook scripts\n--interactive        Run the script in interactive mode\n--update-firmware    Update system firmware\n--update-system      Update system packages\n--dist-upgrade       Perform distribution upgrade (uses apt instead of aptitude)\n--update-flatpak     Perform Flatpak updates\n--kernel-cleanup     Remove old kernels and headers\n--cache-clean        Clean all apt package caches\n--run-hooks          Run scripts in hook directories\n--dry-run            Show what would be done without making changes\n--dry-run-hooks      Run hook scripts during --dry-run, passing IS_DRY_RUN=true (default)\n--no-dry-run-hooks   List hooks during --dry-run without executing them\n--install            Create configuration files and hook directories\n--help               Display this help message\n```\n### Configuration\n\nEdit `/etc/apt-up.conf` (after optional `sudo apt-up --install`).\n\n## Dry-Run Mode\n\nPreview all changes before committing to them with `--dry-run`. This mode shows what would happen without modifying your system.\n\n**Important:** Dry-run mode **does** download package lists (via `apt update` / `aptitude update`) to show accurate information about available updates. This is necessary to provide meaningful previews. However, no packages are installed, removed, or upgraded.\n\n### What Gets Checked\n\n- **System Updates:** Downloads package lists, then shows what would be upgraded (using `aptitude -s`)\n- **Flatpak Updates:** Shows available Flatpak updates (using `flatpak remote-ls --updates`)\n- **Firmware:** Checks if new firmware is available without fetching\n- **Kernel Cleanup:** Lists old kernels and headers that would be removed with size estimates\n- **Cache Cleaning:** Shows current cache sizes that would be freed\n- **Distribution Upgrades:** Downloads package lists, then simulates the upgrade process (using `apt -s`)\n\n### Usage\n\nBasic dry-run:\n```bash\nsudo apt-up --dry-run\n```\n\nDry-run for specific operations:\n```bash\n# Preview distribution upgrade\nsudo apt-up --dry-run --dist-upgrade\n\n# Check kernel cleanup only\nsudo apt-up --dry-run --no-update-system --no-firmware --no-flatpak\n```\n\n### Hook Scripts\n\nBy default, hook scripts **are executed** during dry-run mode. Before any hooks run, apt-up exports `IS_DRY_RUN=true` into the environment so that hook scripts can detect dry-run mode and skip their own side effects:\n\n```bash\n#!/bin/bash\n# Example hook with IS_DRY_RUN awareness\n\nif [ \"${IS_DRY_RUN:-false}\" = \"true\" ]; then\n    echo \"[DRY-RUN] Would perform custom action\"\n    exit 0\nfi\n\n# Normal execution\necho \"Performing custom action...\"\n```\n\nIf a hook runs during dry-run but contains no reference to `IS_DRY_RUN`, apt-up prints a warning to flag that it may not be dry-run-aware:\n\n```\n[WARNING] Hook '50-legacy-hook' does not check IS_DRY_RUN and may make unintended changes\n```\n\nTo skip hook execution entirely during dry-run (listing hooks instead), use `--no-dry-run-hooks` on the command line or set `DRY_RUN_HOOKS=false` in `/etc/apt-up.conf`:\n\n```bash\n# Skip hook execution during --dry-run; only list what would run\nsudo apt-up --dry-run --no-dry-run-hooks\n```\n\n```\n[INFO] Running pre hooks\n[DRY-RUN] Would run hook: 00-example\n[DRY-RUN] Would run hook: 50-ge-proton\n```\n\n### Example Output\n\n```bash\n$ sudo apt-up --dry-run\n\n╔════════════════════════════════════════════════════════════════╗\n║                         DRY-RUN MODE                           ║\n║            No changes will be made to the system               ║\n╚════════════════════════════════════════════════════════════════╝\n\n[DRY-RUN] Would check for package updates\n[DRY-RUN] Packages that would be upgraded:\nInst firefox-esr [115.8.0esr-1~deb12u1] (115.9.0esr-1~deb12u1)\nInst linux-image-6.1.0-18-amd64 [6.1.76-1] (6.1.82-1)\n... and 23 more packages\n\n[INFO] Running pre hooks\n[INFO] Running hook: 00-example\n[DRY-RUN] Would perform custom action\n\n[DRY-RUN] No Flatpak updates available\n\n[DRY-RUN] Would remove these packages:\n[DRY-RUN]   - linux-image-6.1.0-17-amd64\n[DRY-RUN]   - linux-headers-6.1.0-17-amd64\n[DRY-RUN] Would free approximately: 287.4 MB\n\n[DRY-RUN] New firmware available:\n[DRY-RUN]   Current: a8c5f23\n[DRY-RUN]   Remote:  d4e9b67\n[DRY-RUN] Would update firmware files in /lib/firmware\n\n[DRY-RUN] Would clean apt cache (~1.3 GB)\n\n[INFO] Running post hooks\n[INFO] Running hook: 50-ge-proton\n[DRY-RUN] Would update GE-Proton: GE-Proton10-29 → GE-Proton10-30\n```\n\n## Distribution Upgrades\n\n**apt-up** can perform major distribution version upgrades using the `--dist-upgrade` option. This feature uses `apt full-upgrade` instead of `aptitude full-upgrade`, per the Debian upgrade guide.\n\n### Important Notes\n\n- Distribution upgrades are **disabled by default** for safety\n- This feature works with any Debian-based distribution (Debian, Ubuntu, Mint, etc.)\n- **Always update `/etc/apt/sources.list` to point to the new release before running**\n- The upgrade process can take considerable time and may require manual intervention\n\n### Preparation Steps\n\nBefore performing a distribution upgrade:\n\n1. **Backup your system and important data**\n2. **Update your sources.list:**\n   ```bash\n   sudo nano /etc/apt/sources.list\n   # Change release codenames (e.g., bookworm → trixie, jammy → noble)\n   ```\n3. **Review the release notes for your distribution**\n4. **Ensure adequate disk space** (check with `df -h`)\n5. **Consider running from a terminal multiplexer** (tmux or screen) for stability\n\n### Usage\n\nInteractive mode (recommended):\n```bash\nsudo apt-up --dist-upgrade\n```\n\nNon-interactive mode (for automation):\n```bash\nsudo apt-up --dist-upgrade --no-interactive\n```\n\nEnable in config file:\n```bash\n# In /etc/apt-up.conf, uncomment:\nENABLE_DIST_UPGRADE=true\n```\n\n### What It Does\n\nThe distribution upgrade process:\n1. Validates sources.list accessibility\n2. Provides warnings and pre-upgrade checklist\n3. Updates package lists from new repositories\n4. Performs minimal upgrade (`apt upgrade`)\n5. Performs full upgrade (`apt full-upgrade`)\n6. Provides post-upgrade recommendations\n\n### Post-Upgrade\n\nAfter a successful upgrade:\n- Reboot the system when convenient\n- Review system logs for errors\n- Remove obsolete packages: `sudo apt autoremove`\n- Verify critical services are running\n\n## Example Run\nHere's what it looks like in action, checking for firmware \u0026 system updates, then running a custom hook script:\n```\n[INFO] Loading configuration from /etc/apt-up.conf\n╔════════════════════════════════════════════════════════════════╗\n║              Exporting global variables...                     ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Exporting: IGNORE_CC_MISMATCH=1\n[INFO] Exporting: GE_PROTON_TARGET=/home/gamer_account/.steam/steam/compatibilitytools.d\n╔════════════════════════════════════════════════════════════════╗\n║              Running pre-update scripts...                     ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Running pre hooks\n╔════════════════════════════════════════════════════════════════╗\n║              Checking for updated files...                     ║\n╚════════════════════════════════════════════════════════════════╝\nHit http://deb.xanmod.org releases InRelease\nHit https://security.debian.org/debian-security bookworm-security InRelease\nHit https://deb.debian.org/debian bookworm InRelease\nHit https://deb.debian.org/debian bookworm-updates InRelease\nHit https://brave-browser-apt-release.s3.brave.com stable InRelease\nHit https://deb.debian.org/debian bookworm-backports InRelease\nHit https://repo.steampowered.com/steam stable InRelease\nHit https://www.deb-multimedia.org bookworm InRelease\nHit https://www.deb-multimedia.org bookworm-backports InRelease\nHit https://download.opensuse.org/repositories/home:/strycore/Debian_12 ./ InRelease\n\n╔════════════════════════════════════════════════════════════════╗\n║              Updating files if necessary...                    ║\n╚════════════════════════════════════════════════════════════════╝\nNo packages will be installed, upgraded, or removed.\n0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 0 B of archives. After unpacking 0 B will be used.\n\n╔════════════════════════════════════════════════════════════════╗\n║              Updating flatpak packages...                      ║\n╚════════════════════════════════════════════════════════════════╝\nLooking for updates…\n\nNothing to do.\n╔════════════════════════════════════════════════════════════════╗\n║              Cleaning out the apt cache...                     ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Finished cleaning cache.\n╔════════════════════════════════════════════════════════════════╗\n║              Purge old kernels \u0026 headers...                    ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Current running kernel: 6.15.5-x64v3-xanmod1\n[INFO] Latest installed kernel: 6.15.5-x64v3-xanmod1\n[INFO] Current kernel is latest, keeping: 6.15.5-x64v3-xanmod1 and previous: 6.15.4-x64v3-xanmod1\n[INFO] Keeping headers for kernel 6.15.4-x64v3-xanmod1: linux-headers-6.15.4-x64v3-xanmod1\n[INFO] Keeping headers for kernel 6.15.5-x64v3-xanmod1: linux-headers-6.15.5-x64v3-xanmod1\n[INFO] No old kernels or headers to remove.\n╔════════════════════════════════════════════════════════════════╗\n║              Updating kernel firmware...                       ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Checking for firmware updates...\nremote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)\nFrom https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git\n * branch            main       -\u003e FETCH_HEAD\nHEAD is now at 2208e9f Merge branch 'intel/fan_control_8086_e20b_8086_1100' into 'main'\n[INFO] Firmware already up to date.\n╔════════════════════════════════════════════════════════════════╗\n║              Syncing buffers out to disk...                    ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Disk sync completed successfully.\n╔════════════════════════════════════════════════════════════════╗\n║              Running post-update scripts...                    ║\n╚════════════════════════════════════════════════════════════════╝\n[INFO] Running post hooks\n[INFO] Running hook: 50-ge-proton\nChecking for GE-Proton updates...\nUsing overridden Steam directory: /home/gamer_account/.steam/steam/compatibilitytools.d\nLatest version: GE-Proton10-8\nGE-Proton10-8 already installed at /home/gamer_account/.steam/steam/compatibilitytools.d/GE-Proton10-8\nNo installation needed.\nCleaning up old GE-Proton versions...\nNo old versions to clean up.\nDone!\n╔════════════════════════════════════════════════════════════════╗\n║                       Finished.                                ║\n╚════════════════════════════════════════════════════════════════╝\n```\n(Normally output is color-coded, if the terminal supports it.)\n\n## Hooks\nIf you want to extend apt-up's functionality, you can add custom scripts to:\n- `/etc/apt-up.d/pre.d/` (before updates).\n\n- `/etc/apt-up.d/post.d/` (after updates).\n\n- `/etc/apt-up.d/fail.d/` (on failure).\n\nNOTE: Scripts with '`critical`' in the name (e.g. `00-critical-check.sh`) halt execution if they fail.\n\nHooks run in dry-run mode by default with `IS_DRY_RUN=true` exported — implement it in your hook to skip side effects gracefully. See [Dry-Run Mode \u003e Hook Scripts](#hook-scripts) for full details.\n\nRun `sudo apt-up --install` to create these directories (with a sample hook in `pre.d`).\n\n## License\n\nGNU General Public License v2.0 or later ([LICENSE](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)) - contributions must remain open-source.\n\n## Contributing\n\nYou know the drill: fork, open an issue or submit a pull request. \n\n---\n\n_A tool for maintaining Debian-based systems by Chris Wadge_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwadge%2Fapt-up","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwadge%2Fapt-up","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwadge%2Fapt-up/lists"}