A comprehensive CLI maintenance tool for Arch Linux systems, providing automated package management, system health monitoring, and preventive maintenance capabilities with safety-first design principles.
ArchMaint simplifies routine Arch Linux system maintenance by consolidating essential tasks into an intuitive CLI interface. Designed for both automated workflows and interactive use, it emphasizes safety through dry-run capabilities, confirmation prompts, and automatic backups.
- Package Management: Update, clean cache, remove orphans
- System Cleanup: Logs, temporary files, user cache
- Automated Backups: Pre-update snapshots with restore functionality
- Health Monitoring: 6-point system diagnostics with scoring
- Dry-run Mode: Preview all changes before execution
- Safe Mode: Enhanced confirmations for destructive operations
- Dependency Checking: Validation before package operations
- Reboot Detection: Kernel update notifications
- Package Search: Interactive repository browsing
- Btrfs Snapshots: System rollback capability
- Configuration Management: Customizable retention policies
- Progress Indicators: Real-time operation feedback
- Arch Linux
- Go 1.21+
sudoprivilegespacman-contrib(for paccache)
# Clone repository
git clone https://github.com/DaEpicR/ArchMaint.git
cd ArchMaint/cli/
# Install dependencies
go mod download
go mod tidy
# Build
go build -o archmaint arch-maintenance-tool.go
# Run
./archmaint
# Install system-wide (optional)
sudo cp archmaint /usr/local/bin/make build # Build binary
make install # Build and install
make run # Build and run
make clean # Remove artifactsarchmaint # Launch menu
archmaint --dry-run # Preview mode
archmaint --safe # Extra confirmationsarchmaint status # System overview
archmaint update # Update packages (with backup)
archmaint clean # Clean cache and logs
archmaint orphans # Remove unused packages
archmaint health # System diagnostics
archmaint maintenance # Full maintenance routinearchmaint search <package> # Search packages
archmaint backup # Create manual backup
archmaint restore # Restore from backup
archmaint snapshot # Create btrfs snapshot
archmaint config # Manage settings| Command | Alias | Description |
|---|---|---|
status |
s |
Display system information and status |
update |
u |
Update packages with optional backup |
clean |
c |
Clean cache, logs, and temporary files |
orphans |
o |
Identify and remove unused packages |
services |
sv |
Monitor systemd service health |
logs |
l |
View recent system logs |
health |
h |
Run comprehensive health check |
maintenance |
m |
Execute full maintenance routine |
search |
se |
Search package repositories |
backup |
b |
Create system package backup |
restore |
r |
Restore from previous backup |
snapshot |
sn |
Create btrfs filesystem snapshot |
config |
cfg |
Configure tool settings |
help |
-h |
Display help information |
version |
-v |
Show version information |
- Dry-run: Disabled
- Safe mode: Disabled
- Backups: Enabled
- Cache retention: 30 days
- Log retention: 7 days
~/.config/archmaint/config.conf
archmaint config # Interactive configurationAvailable options:
- Toggle dry-run mode
- Toggle safe mode
- Enable/disable automatic backups
- Set cache retention period
- Set log retention period
- Toggle verbose logging
~/.archmaint/backups/ # Backup storage
The health command evaluates:
- Disk Space - Root partition usage < 90%
- Memory Usage - Available memory > 10%
- Failed Services - No systemd service failures
- Package Database - Database integrity verified
- System Errors - Minimal errors in recent logs
- Security Updates - No critical package updates pending
Output: Health score (0-100%) with detailed results
- Non-destructive operations: Yes/No confirmation
- Dangerous operations: Yes/No confirmation with warnings
- Safe mode: Requires "yes" phrase for destructive ops
- Automatic pre-update backups
- Stores: explicit packages, all packages, AUR packages
- Manual backup creation with timestamp
- Restore capability with version selection
archmaint --dry-run <command> # Preview without changesShows:
- Commands that would execute
- Files that would be modified
- Changes without applying them
archmaint status # Check system status
archmaint health # Run diagnosticsarchmaint --dry-run update # Preview updates
archmaint maintenance # Full maintenance routinearchmaint backup # Create backup
archmaint snapshot # Create snapshot (btrfs)
archmaint --dry-run update # Preview changesarchmaint health # Identify issues
archmaint logs # Review system logs
archmaint services # Check service statusgit clone https://github.com/DaEpicR/ArchMaint.git
cd ArchMaint
make deps
make build
./archmaintBuild Error: "command not found: go"
sudo pacman -S goModule Not Found
go mod tidy
go mod download
go build -o archmaint arch-maintenance-tool.goPermission Denied
# Most operations require sudo
sudo archmaint update
sudo archmaint maintenanceMissing Dependencies
sudo pacman -S pacman-contrib lm-sensors
sudo sensors-detect- Typical operation time: 5-30 seconds depending on system
- Backup creation: 1-5 seconds
- Health check: 10-15 seconds
- Full maintenance: 2-5 minutes
- Requires
sudofor system modifications - Confirmation prompts for destructive operations
- Backups stored in user home directory
- No remote connections or network access
- All operations logged locally
- Issues: GitHub Issues
- Documentation: This README
- Help:
archmaint help
- Dry-run mode
- Safe mode
- Backup/restore system
- Package search
- Btrfs snapshots
- Configuration manager
- Progress indicators
- Enhanced health checks
- Initial release
- Basic maintenance tasks
- System status display
- Service monitoring
Current: v1.1.0 - Stable with enhanced safety
Next: v1.2.0 - AUR support (maybe), notifications
Future: v2.0.0 - cooking
Maintained by: [DaEpicR] Status: Active Development