Skip to content

Instantly share code, notes, and snippets.

@raspi
Last active June 2, 2024 03:19
Show Gist options
  • Save raspi/cd79a759cc36c287a9502258778dd131 to your computer and use it in GitHub Desktop.
Save raspi/cd79a759cc36c287a9502258778dd131 to your computer and use it in GitHub Desktop.
Arch Linux Pacman auto download updated packages
# Download new packages but don't install them
# Save in /etc/systemd/system/
[Unit]
Description=Pacman Automatic Download (no install) service
After=network-online.target
[Service]
# Wait time if process hangs
TimeoutStopSec=5m
# Command to run
ExecStart=/usr/bin/pacman --sync --refresh --sysupgrade --downloadonly --noconfirm
Type=simple
KillMode=process
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
# Timer which runs service
# Save in /etc/systemd/system/
# Enable:
# systemctl enable /etc/systemd/system/pacman-auto-update.timer
# Start:
# systemctl start pacman-auto-update.timer
# Next run time:
# systemctl list-timers --all
[Unit]
Description=Pacman Automatic Download (no install) timer
[Timer]
# Uptime after it's ran
OnBootSec=60min
# Wait time for next run
OnUnitInactiveSec=120min
Unit=pacman-auto-update.service
Persistent=true
RandomizedDelaySec=5min
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment