{"id":27039975,"url":"https://github.com/cdvel/arch-maintenance","last_synced_at":"2025-04-05T03:27:27.820Z","repository":{"id":280383128,"uuid":"941802304","full_name":"cdvel/arch-maintenance","owner":"cdvel","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-03T04:52:54.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T05:28:46.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdvel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-03-03T04:30:38.000Z","updated_at":"2025-03-03T04:53:20.000Z","dependencies_parsed_at":"2025-03-03T05:38:51.570Z","dependency_job_id":null,"html_url":"https://github.com/cdvel/arch-maintenance","commit_stats":null,"previous_names":["cdvel/arch-maintenance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Farch-maintenance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Farch-maintenance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Farch-maintenance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdvel%2Farch-maintenance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdvel","download_url":"https://codeload.github.com/cdvel/arch-maintenance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284931,"owners_count":20913690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-05T03:27:27.331Z","updated_at":"2025-04-05T03:27:27.804Z","avatar_url":"https://github.com/cdvel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arch Linux Maintenance\n\nAn automated maintenance script for Arch Linux systems with scheduled execution and safety features.\n\n## Overview\n\nThis repository contains scripts to automate routine maintenance tasks for Arch Linux. It handles system updates, cache cleaning, orphaned package removal, and various other maintenance tasks safely and efficiently.\n\n## Features\n\n- 🔄 Full system updates (pacman and AUR via yay)\n- 🧹 Package cache cleaning\n- 🗑️ Orphaned package removal\n- 💾 Pacman database backups\n- 📋 System logs check\n- 💿 SSD TRIM support\n- 📊 Disk usage reporting\n- 📱 Flatpak support and dependency protection\n- ⏱️ Automated biweekly execution via systemd\n- 📝 Comprehensive logging\n- 🛡️ Safety features (dry-run mode, confirmations)\n\n## Requirements\n\nThe following packages are required for full functionality:\n\n- `pacman` (built-in on Arch)\n- `reflector` - For optimizing mirror lists: `sudo pacman -S reflector`\n- `yay` - For AUR support: [Installation instructions](https://github.com/Jguer/yay#installation)\n- `flatpak` - For Flatpak application support: `sudo pacman -S flatpak`\n\nWithout these packages, some features may be disabled or limited in functionality.\n\n## Files\n\n- `arch_maintenance.sh` - The main maintenance script\n- `setup_maintenance.sh` - Installation script to set up automation\n- `arch-maintenance.service` - Systemd service definition\n- `arch-maintenance.timer` - Systemd timer for biweekly execution\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/cdvel/arch-maintenance.git\n   cd arch-maintenance\n   ```\n\n2. Make the scripts executable:\n   ```bash\n   chmod +x arch_maintenance.sh setup_maintenance.sh\n   ```\n\n3. Run the setup script:\n   ```bash\n   sudo ./setup_maintenance.sh\n   ```\n\nThis will:\n- Create a maintenance directory at `~/arch-maintenance`\n- Install the systemd service and timer\n- Set up log rotation\n- Enable automatic execution every two weeks\n\n## Usage\n\n### Automatic Execution\n\nAfter installation, the script will run automatically every two weeks and log its output to `~/arch-maintenance/logs/`.\n\nCheck the timer status:\n```bash\nsystemctl status arch-maintenance.timer\n```\n\nSee when the next run is scheduled:\n```bash\nsystemctl list-timers arch-maintenance.timer\n```\n\n### Manual Execution\n\nRun the script manually with:\n```bash\nsudo ~/arch-maintenance/arch_maintenance.sh\n```\n\n### Command Line Options\n\nThe script supports several command-line options for safety:\n\n- `-h, --help` - Show help message\n- `-n, --no-update` - Skip system updates\n- `-c, --no-cache-clean` - Skip cache cleaning\n- `-o, --no-orphans` - Skip orphaned package removal\n- `-j, --no-journal-clean` - Skip journal cleaning\n- `-y, --yes` - Auto-confirm all actions\n- `--yolo` - Skip all confirmations and use aggressive defaults\n- `-d, --dry-run` - Show what would be done without making changes\n- `-b, --no-backup` - Skip pacman database backup\n- `-f, --no-flatpak` - Skip Flatpak updates and maintenance\n- `--no-flatpak-reinstall` - Skip reinstalling Flatpak packages after maintenance\n\nExample of a dry run:\n```bash\nsudo ~/arch-maintenance/arch_maintenance.sh --dry-run\n```\n\n### Flatpak Support\n\nThe script includes special handling for Flatpak applications:\n\n- Updating Flatpak applications\n- Cleaning unused Flatpak runtimes\n- Reinstalling Flatpak packages after orphan removal to restore dependencies\n\n**Note:** Orphan package removal may break Flatpak dependencies, which is why the script automatically reinstalls Flatpak packages at the end of the maintenance process.\n\nIf you're experiencing issues with Flatpak applications after running the script, you can manually repair them with:\n```bash\nflatpak repair\n```\n\n## Logs\n\nLogs are stored in `~/arch-maintenance/logs/` with timestamps and are automatically rotated to prevent excessive disk usage.\n\n## Customization\n\nEdit the `arch_maintenance.sh` script to customize which maintenance tasks are performed.\n\nThe systemd timer can be modified by editing `/etc/systemd/system/arch-maintenance.timer` and running:\n```bash\nsudo systemctl daemon-reload\n```\n\n## License\n\n[MIT License](LICENSE)\n\n## Credits\n\nBased on [Fernando Cejas's Arch Linux system maintenance guide](https://fernandocejas.com/blog/engineering/2022-03-30-arch-linux-system-maintance/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdvel%2Farch-maintenance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdvel%2Farch-maintenance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdvel%2Farch-maintenance/lists"}