Skip to content

Instantly share code, notes, and snippets.

@theodric
Last active December 26, 2023 13:16
Show Gist options
  • Save theodric/cb60ac3d0e1232450435007e09ffefcc to your computer and use it in GitHub Desktop.
Save theodric/cb60ac3d0e1232450435007e09ffefcc to your computer and use it in GitHub Desktop.
Setting up an Arch chroot environment on the Steam Deck, then using as NOT a chroot environment
## So you want to use stuff like 'tmux' and 'lolcat' on the Steam Deck, but they haven't been included in the base OS?
# One way to do it is this.
# 1. setup a chroot environment so there is a file structure in which Pacman can download/unpack packages and their dependencies.
# 2. don't use it as a chroot environment; rather, add the various /bin directories inside it to your $PATH, and create an /etc/ld.so.conf.d/deck-local-arch.conf to permit the bins to find the libs they need.
mkdir -p ~/.local/packer
cd ~/.local
#these steps are required, or else the pacstrap will fail with 'marginal trust' errors
pacman -Sy archlinux-keyring
pacman-key --populate archlinux
pacman-key --refresh-keys
pacstrap -K ./packer base base-devel archlinux-keyring nano tmux htop
## And that's it: now those packages are accessible for you to use as the 'deck' user from within SteamOS. Doesn't work for every package, in particular those requiring a kernel module or services, but most normal shell tools work.
## To make future installations of additional packages simpler, add this to your ~/.bashrc:
alias pac='sudo pacstrap -K /home/deck/.local/packer'
## Then you can simply install stuff with 'pac packagename' e.g. 'pac mosh' to install mosh. Enjoy!
@sonofevil
Copy link

sonofevil commented Jul 15, 2023

I actually don't understand why ldconfig -r doesn't work. It creates the necessary symlinks in packer/usr/lib, but seemingly those are ignored by ld at runtime?

Edit: OOH you need to run ldconfig after ldconfig -r
Still doesn't create symlinks for the python folders tho.

Edit2: Setting PYTHONHOME does the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment