The right way to get linux software on SteamOS 3 on the Steam Deck is in order:
- Check if it’s installed by default
- Check if there is a flatpak available via the “Discover” application
- Build it from source
- Build and contribute flatpak yourself
- Look furtively over your shoulder, get hold of some binaries, stuff them in a folder in your read-write home folder and don’t tell anyone.
I swear I’m going to get to point 4 in due time but for now, here’s how I went about it when all other options were exhausted.
I was happy to see that all of my cannot-live-without CLI applications were available on the default install. OpenSSH, Python 3, git, even Vim! By default! (other text editors are available from the outset too, e.g. nano) Only… where was tmux? Surely, they weren’t expecting me to open up a new ssh connections for every time I wanted a fresh terminal? Apparently so.
I then went to the Discover app, searched and found that nobody had packaged tmux for flathub because, well, why would they? It’s a binary and some man pages, relying only on libraries that are omnipresent on linux distros.
Build it from source? SteamOS comes with every required build dependency for tmux except for bison/yacc. If I’m going to investigate how to build that first, I can see where the rest of the week is going. Packaging tmux as a Flatpak myself (on another more capable machine) sounds like a good learning experience but that’s a weekend project, not a lunch break project.
While I can’t* install the tmux package from the Arch repository, I can – I think – safely assume that it is compatible with SteamOS 3. The package page lists the package’s dependencies: libevent
, libutempter
, and ncurses
. I can check whether those are present on my Steam Deck using pacman’s query command:
(deck@steamdeck ~)$ pacman -Qi libevent
Name : libevent
Version : 2.1.12-1
Description : An event notification library
Architecture : x86_64
URL : https://libevent.org/
Licenses : BSD
...
They are all present and correct. Then I went ahead and downloaded the package from the nearest mirror (see the “Package actions” section in the page’s upper right corner) and unpackaged the compressed archive:
(deck@steamdeck ~)$ curl -LO https://europe.mirror.pkgbuild.com/community/os/x86_64/tmux-3.3-2-x86_64.pkg.tar.zst
(deck@steamdeck ~)$ tar --use-compress-program=unzstd -xvf ./tmux-3.3-2-x86_64.pkg.tar.zst
Now, I had obviously checked the package contents first and noted that there were no libraries included. This package was as simple as could be asked for. All files included are:
usr/
usr/bin/
usr/bin/tmux
usr/share/
usr/share/licenses/
usr/share/licenses/tmux/
usr/share/licenses/tmux/LICENSE
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/tmux.1.gz
In other words, I knew I would not have to try to set additional folders to check for libraries or similar hacks. However, it still failed:
(deck@steamdeck ~)$ ./usr/bin/tmux
usr/bin/tmux: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by usr/bin/tmux)
(Note that I’m referencing a usr folder in my home directory, not the root /usr
folder) So libc is present but the version of tmux I have gotten hold of is built for version 2.34. What do I have?
(deck@steamdeck ~)$ ldd --version
ldd (GNU libc) 2.33
Damn those fastmoving Arch maintainers! Fortunately – bless those thoughtful Arch maintainers! – old package versions are saved in the Arch archive. Figuring I only had to go back bit to find a version that worked with libc 2.33, i downloaded tmux version 3.2-1, repeated the steps above and hey presto, I had tmux.
While it bears repeating that this is not the correct way to run software, I think this way is much better and safer than messing with the read-only nature of the filesystem and trying to force things. The libc experience shows that we could quickly have gotten lost in version incompatibilities and – worst case scenario – installed a libc version that would break the Deck.
Another thing to keep in mind is of course that this tmux will break once SteamOS catches up to Arch and moves to lib 2.34. All the more reason to investigate this flatpak thing.