arch: pacman automatic download

This little post explains how to enable download for packages of pacman. It uses a systemd service.

Create the download service (note the option -w for just downloading the packages):

$ sudo vim /etc/systemd/system/pacman-downloader.service
[Unit]
 Description=Automatic Update
 After=network-online.target 

[Service]
 Type=simple
 ExecStart=/usr/bin/pacman -Syuwq --noconfirm
 TimeoutStopSec=180
 KillMode=process
 KillSignal=SIGINT

[Install]
 WantedBy=multi-user.target

Create a timer service to launch the downloader:

$ sudo vim /etc/systemd/system/pacman-downloader.timer
[Unit]
 Description=Automatic Update when booted up after 5 minutes then check the system for updates every 60 minutes

[Timer]
 OnBootSec=5min
 OnUnitActiveSec=60min
 Unit=pacman-downloader.service

[Install]
 WantedBy=multi-user.target

Enable and start the service using systemctl.


Source-link: www.techrapid.co.uk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s