Skip to content

Commit

Permalink
Differentiate the user and system methods for updating Flatpaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers committed Oct 21, 2023
1 parent 6d4965a commit 307cf9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Armbian",
"asdf",
"ashift",
"assumeyes",
"audiobooks",
"audiodev",
"autodefrag",
Expand Down Expand Up @@ -141,6 +142,7 @@
"nographic",
"nojoliet",
"noload",
"noninteractive",
"nopasswd",
"norecover",
"norock",
Expand Down
19 changes: 12 additions & 7 deletions _posts/2021-03-16-Automate Flatpak Updates With systemd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ Since I don't want to have multiple app stores on my machine, I opted for using
== Tutorial

The instructions here describe how to create systemd service and timers to automate updating both user and system Flatpak installations.
The system systemd units will only update the system Flatpaks, whereas the user systemd units will update both the user's Flatpaks and the system's.
In most cases, having both user and system services to update Flatpaks is unnecessary.
The system systemd units are handy for the default Flatpak behavior, which installs Flatpaks system-wide.
The user systemd units are great for users who opt to install Flatpaks in their user-specific installation, such as Flatpak developers.

The tutorial uses elementary OS 5.1 as a reference operating system but are more generally applicable to any Linux system with systemd and Flatpak.
I assume you are familiar with these concepts and keep things brief.
I assume you are familiar with these concepts and will keep things brief.
Separate instructions are provided for the user and system Flatpak installations.
The systemd units here were derived from those provided by https://github.com/flatpak/flatpak/issues/1399#issuecomment-403065567[_marcelpaulo_'s GitHub comment].

[NOTE]
[TIP]
====
The systemd user unit files are placed in the directory `/etc/systemd/user/` where they are applied to all users on the system.
An individual user can place the unit files in the directory `~/.config/systemd/user/` to only effect her account.
Expand All @@ -33,23 +38,23 @@ An individual user can place the unit files in the directory `~/.config/systemd/

User::
+
[source,systemd]
[,systemd]
./etc/systemd/user/update-user-flatpaks.service
----
[Unit]
Description=Update user Flatpaks
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak update --assumeyes --noninteractive --user
ExecStart=/usr/bin/flatpak update --assumeyes --noninteractive
[Install]
WantedBy=default.target
----

System::
+
[source,systemd]
[,systemd]
./etc/systemd/system/update-system-flatpaks.service
----
[Unit]
Expand All @@ -69,7 +74,7 @@ WantedBy=multi-user.target

User::
+
[source,systemd]
[,systemd]
./etc/systemd/user/update-user-flatpaks.timer
----
[Unit]
Expand All @@ -85,7 +90,7 @@ WantedBy=timers.target

System::
+
[source,systemd]
[,systemd]
./etc/systemd/system/update-system-flatpaks.timer
----
[Unit]
Expand Down

0 comments on commit 307cf9a

Please sign in to comment.