Skip to content

About

Unattended Auto Updates for CachyOS

Resources

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

86 Commits

Folders and files

Repository files navigation

cachy-auto-update

cachy-auto-update

Unattended background updates for CachyOS.

pacman, AUR, Flatpak and AppImages. In the background, with no password prompt.

Buy me a coffee on Ko-fi

Install

  1. Install the package from the AUR:

    paru -S cachy-auto-update

    paru first asks to show the build files. Press q to close them, then Enter to install. No paru yet? Get it with sudo pacman -S paru.

  2. Turn automatic updates on: open CachyOS Auto-Update from the application menu and switch on Update automatically. Or in a terminal:

    sudo cachy-auto-update enable

How to use

Open CachyOS Auto-Update from the application menu, or run cachy-auto-update.

The CachyOS Auto-Update window: 12 updates available, automatic updates on, and nothing that would make an update wait

Overview shows if updates are waiting, with an Update now button. It also says why an update would wait right now, for example a game or low battery. The other pages on the left hold all the settings.

Changing a setting asks for your password once, then not again for a few minutes.

Updates run once a week. To change that, use How often to update. To keep them to a quiet time, for example the night, pick hours under When to update on the Schedule page. Update now works at any time.

From the command line: sudo cachy-auto-update config set UpdateHours 3-6 (or any other hours, such as 22-6, or any).

Update and shut down

Done for the day? Click the arrow next to Update now and pick Update and shut down or Update and restart. The computer installs the updates, then shuts down or restarts. Cancel on the progress bar stops both.

The arrow next to Update now opens a menu with Update and shut down, and Update and restart

From the command line: sudo cachy-auto-update run --then poweroff (or reboot).

Restart

Nothing restarts on its own, unless you turn on Restart automatically under Schedule. Pick After a kernel update or After every update. Handy for a home server: with Every day, Between 03:00 and 06:00 and After every update, it updates and restarts every night.

The Schedule page set up for a home server: every day, between 03:00 and 06:00, restart after every update

It only restarts after an update that went through, and only while nobody is logged in to the desktop. Until then it waits. People on a terminal or over SSH get a message two minutes before, and sudo shutdown -c stops it.

From the command line: sudo cachy-auto-update config set AutoReboot needed (or always, or no).

Tray icon

An icon in the system tray shows if updates are waiting. Click it to install them right away. While an update runs, a click shows what it is doing. Right-click it for Update now, Update and shut down, Update and restart, Check for updates, Show log and Settings.

Do not want it? Turn off Show an icon in the system tray under Notifications.

While an update runs, the window shows how far it is.

The window while an update runs: a progress bar at 42 percent, 87 of 214 packages

A progress bar in the notification area shows it too. You can Pause or Cancel the update there.

The progress bar of a running update, with Pause and Cancel buttons

To keep it out of the way, turn on Start the progress bar minimized under Notifications. The bar then stays in the notification area and does not pop up. Click the notification icon to see it.

The Notifications page with Start the progress bar minimized and the other message settings

Language

The window speaks 20 languages: English, Czech, Dutch, French, German, Hungarian, Indonesian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Romanian, Russian, Simplified Chinese, Spanish, Swedish, Turkish, Ukrainian and Vietnamese. It follows the language of your desktop. To pick another one, open Notifications and choose it under Language of this window. It changes at once, also in the tray icon, and only for you.

The language menu on the Notifications page, listing System default, English and the other languages by their own names

Command line

cachy-auto-update status       # how things stand
sudo cachy-auto-update run     # update now
cachy-auto-update config list  # every setting

cachy-auto-update --help lists everything.

When does it update?

Once a week ✅ Updates (change it in the settings)
Battery below 30 % ⏸️ Waits (on power it runs)
A game is running ⏸️ Waits
pacman, yay or paru is running ⏸️ Waits
Shutdown or suspend during an update 🚫 Blocked until it is done, or until you click Cancel
Restart after an update ❌ Not on its own. The window and the tray icon say when one is due. Turn on Restart automatically to change that

More

What it updates
Packages pacman -Syu
AUR paru or yay
Flatpak system and user installs
AppImages through Gear Lever
Safety
  • A progress bar shows the step and the package.
  • Cancel and Pause on the progress bar never stop pacman while it installs. They wait until that part is done.
  • On Btrfs with snapper (the CachyOS default) every update gets a snapshot before and after.
  • A lock file left by a power cut is removed on the next run.
  • Package replacements are handled on their own. File conflicts are never overwritten.
  • A signature error refreshes the keyring once and tries again.
  • An AUR package that does not build is held back. Everything else still updates.
  • Old package versions and AUR build leftovers are cleaned up, so the caches do not fill the disk.
Logs
cachy-auto-update log        # last run
cachy-auto-update log -a     # all runs
journalctl -u cachy-auto-update
cachy-update

cachy-update tells you about updates, you install them. This installs them for you, so cachy-update's tray icon and notifications are turned off while automatic updates are on. So is the Reboot recommended pop-up of CachyOS, because it shows up in the middle of an update. To keep them, turn on Also run cachy-update or Show the CachyOS restart notice under Notifications.

Build from source

Written in Rust. The window is drawn with Rune.

make && sudo make install
sudo systemd-sysusers && sudo systemd-tmpfiles --create
sudo cachy-auto-update enable

Building needs rust, libxkbcommon and wayland. Optional at run time: pacman-contrib, an AUR helper, flatpak, Gear Lever.

GPL-3.0-or-later.

About

Unattended Auto Updates for CachyOS

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages