Jun Aruga's Blog

Output, activities, memo and etc.

Install Slack on Flatpak on Fedora 36

I referred to the [1].

Install Slack

First, you need to install Flatpak if you don't have it.

$ sudo dnf install flatpak

Install the flathub repo file.

$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Reboot at once in this timing.

$ sudo reboot

Install Slack.

$ flatpak install flathub com.slack.Slack -y

Run Slack

In my environment where running i3 by running the startx, I saw the error below.

$ flatpak run com.slack.Slack
[2 zypak-helper] Failed to connect to session bus: [org.freedesktop.DBus.Error.NotSupported] Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
[2 zypak-helper] src/helper/main.cc:40(DetermineZygoteStrategy): Assertion failed: bus

I added the lines below, seeing the [2].

diff --git a/home/.xinitrc b/home/.xinitrc
index abe931a..a902714 100644
--- a/home/.xinitrc
+++ b/home/.xinitrc
@@ -1,3 +1,7 @@
 xrdb ~/.Xresources
 
+# dbus-launch for Slack on Flatpak.
+# https://github.com/flatpak/flatpak/issues/2754
+eval "$(dbus-launch --sh-syntax --exit-with-session)"
+
 exec i3

And it worked after running the startx again.

$ flatpak run com.slack.Slack

Here is the detail of the command above.

$ rpm -qf /bin/dbus-launch
dbus-x11-1.14.4-1.fc36.x86_64

$ dbus-launch --sh-syntax --exit-with-session
DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/dbus-rqcQtmDHcj,guid=776599334e0d304f27523f2d63868934';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=8326;
DBUS_SESSION_BUS_WINDOWID=31457281;

I added the alias below.

.bashrc

+if flatpak info com.slack.Slack > /dev/null 2>&1; then
+    alias slack='flatpak run com.slack.Slack'
+fi

References

Uninstall Snap on Fedora

I installed Snapd to install Slack on it in the past.[1]

However, I knew an alternative Flatpak and compared the Flatpack with Snap.[3][4] I thought it would be better to uninstall Snap and install Flatpak.

Uninstall Snap

I referred to the [5] to uninstall Snap.

$ df -h | grep loop
/dev/loop1       56M   56M     0 100% /var/lib/snapd/snap/core18/2632
/dev/loop5       56M   56M     0 100% /var/lib/snapd/snap/core18/2620
/dev/loop3       64M   64M     0 100% /var/lib/snapd/snap/core20/1634
/dev/loop2      115M  115M     0 100% /var/lib/snapd/snap/core/14056
/dev/loop4      128K  128K     0 100% /var/lib/snapd/snap/bare/5
/dev/loop8       82M   82M     0 100% /var/lib/snapd/snap/gtk-common-themes/1534
/dev/loop6       64M   64M     0 100% /var/lib/snapd/snap/core20/1695
/dev/loop7      219M  219M     0 100% /var/lib/snapd/snap/gnome-3-34-1804/77
/dev/loop10      92M   92M     0 100% /var/lib/snapd/snap/gtk-common-themes/1535
/dev/loop9      128K  128K     0 100% /var/lib/snapd/snap/powerstat/140
/dev/loop12     113M  113M     0 100% /var/lib/snapd/snap/slack/67
/dev/loop13     117M  117M     0 100% /var/lib/snapd/snap/core/14399
/dev/loop0      116M  116M     0 100% /var/lib/snapd/snap/slack/68
$ sudo dnf remove snapd
$ df -h | grep loop

That's it!

Install Flatpak

I referred to the [6]. It was already installed.

$ sudo dnf install flatpak
...
Package flatpak-1.12.7-5.fc36.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

References