Skip to main content

Linux Software Update Policy

Overview

The Linux Software Update Policy keeps managed Linux devices up to date. The Swif agent runs the device's package manager on a schedule you set, and installs available updates. You can also add external package repositories, such as Google Chrome's, so devices get updates from them too.

Linux distributions don't share a single management API, unlike macOS and Windows. So Swif manages updates through each distribution's own package manager, such as apt, dnf, zypper, or pacman.

Important: The device's own update settings may show updates as off. Swif runs updates through the package manager directly, not through the distribution's update settings. So Software & Updates or a similar settings panel may show automatic updates as Off, even though Swif is installing updates. That's expected.


Supported platforms and requirements

Item

Details

Platform

Linux

Device ownership

Company-owned and BYOD

Swif agent

Required


Settings reference

Setting

What it does

Default

Automatic Update

On: the Swif agent updates the package lists and installs available updates on the schedule below. For example, on Debian and Ubuntu it runs apt update && apt upgrade. Off: Swif doesn't install updates.

On

Cron Schedule

When automatic updates run, in cron format. A setting under Automatic Update, shown only while it's on.

0 0 * * * (every day at midnight)

Repos

External package repositories to add to devices. See Add external repositories below.

Empty

Cron Schedule

The schedule uses the standard five-field cron format:

minute  hour  day-of-month  month  day-of-week

Schedule

Cron Schedule value

Every day at midnight (default)

0 0 * * *

Every day at 2:00 AM

0 2 * * *

Every 6 hours

0 */6 * * *

Weekdays at 12:30 PM

30 12 * * 1-5

Every Sunday at 3:00 AM

0 3 * * 0

Choose a time when devices are usually on and connected, but not in heavy use. Devices that are off at the scheduled time update at the next scheduled run.


Add external repositories

Use Repos to add a package repository that isn't part of the distribution, such as a vendor's repository for an app your team uses. Devices then get updates from it during scheduled runs.

Repository fields

Field

What to enter

Required

Platform

The package manager the repository is for. See the table below.

Yes

Repo URL

The repository's address.

Yes

Distribution

The release channel, such as stable, testing, or unstable. Shown for APT and DEB.

No

Components

The repository components, such as main, contrib, or non-free. Shown for APT and DEB.

No

Repo ID

A unique name for the repository. Shown for Pacman, Arch, Flatpak, Zypper, and Nix.

Depends on the package manager

Architecture

The system architecture, such as amd64, arm64, or armhf.

No

Key Sources

Where to get the repository's signing key: a key server (such as keyserver.ubuntu.com), a key URL, or a file path on the device.

If the repository is signed

Recv Keys

The key ID to fetch from the key server in Key Sources.

No

Platform options

Platform

Use for

APT, DEB

Debian, Ubuntu, and other Debian-based distributions

RPM, DNF, YUM

Fedora, RHEL, Rocky Linux, CentOS, and other RPM-based distributions

ZYPPER

openSUSE and SUSE Linux Enterprise

PACMAN, ARCH

Arch Linux and Arch-based distributions

FLATPAK

Flatpak remotes

NIX

Nix and NixOS

Snap doesn't support adding repositories, so it isn't listed.

Where Swif adds repositories

On Debian and Ubuntu, Swif adds its own .list files in /etc/apt/sources.list.d/, instead of changing the main sources.list. This keeps Swif-managed repositories separate and easy to track. Swif adds files there when:

  • you add repositories in this policy

  • an app you deploy through Swif comes from its own repository, such as Google Chrome

  • Swif needs its own service repository for automatic updates

Manage these repositories through the policy, not by editing the files. Manual changes can conflict with Swif.


Before you start

  1. Choose an update schedule that suits your users' working hours.

  2. Collect the details of any external repositories: the URL, release channel and components (for APT), and signing key.

  3. Test on a small group. Distributions differ, so check that the updates and repositories work on each distribution you manage.


Create the policy

  1. In Swif, go to Device Management > Policies, then select Create new policy > Configure a Policy.

  2. Select Linux Software Update Policy.

  3. Enter a clear name, such as Linux Updates – Nightly.

  4. Keep Automatic Update on, and set the Cron Schedule that appears under it.

  5. Under Repos, add any external repositories.

  6. Save the policy.

  7. Assign it to a device group of Linux devices.


Example configurations

Example 1: Nightly updates

Setting

Value

Automatic Update

On

Cron Schedule

0 2 * * *

Repos

Empty

Devices install updates from their distribution's default repositories every night at 2:00 AM.

Example 2: Add the Google Chrome repository on Ubuntu

Field

Value

Platform

APT

Repo URL

https://dl.google.com/linux/chrome/deb/

Distribution

stable

Components

main

Architecture

amd64

Key Sources

https://dl.google.com/linux/linux_signing_key.pub

Devices get Chrome updates from Google's repository during each scheduled run.

Example 3: Updates on weekday afternoons

Setting

Value

Automatic Update

On

Cron Schedule

30 12 * * 1-5

For devices that are usually off at night, updates run at 12:30 PM on weekdays.


Verify the policy

  1. In Swif, open the device and confirm that the policy shows as applied.

  2. After the scheduled time, check the package manager's log on the device. For example:

    • Debian and Ubuntu: /var/log/apt/history.log

    • Fedora and RHEL: /var/log/dnf.log

  3. If you added repositories on Debian or Ubuntu, check that their .list files are in /etc/apt/sources.list.d/.


Troubleshooting

The system settings show automatic updates as off

This is expected. Swif runs updates through the package manager directly, not through the distribution's update settings.

Updates didn't run at the scheduled time

  • Check that Automatic Update is on, and that the Cron Schedule is valid.

  • Check that the device was on and connected at the scheduled time.

  • Check the package manager's log for errors.

An update failed

Check the package manager's log, such as /var/log/apt/history.log or /var/log/dnf.log, and the device's logs in Swif. See Linux failed to fetch packages for updates.

Updates from an external repository fail with a key error

The repository's signing key wasn't fetched. Check Key Sources, and Recv Keys if the key comes from a key server.

I found extra .list files in sources.list.d

These are Swif-managed repositories. Manage them through this policy, and don't edit them by hand.

Repositories are still on a device after I removed the policy


Related resources

Did this answer your question?