Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save uyjulian/105397c59e95f79f488297bb08c39146 to your computer and use it in GitHub Desktop.
Save uyjulian/105397c59e95f79f488297bb08c39146 to your computer and use it in GitHub Desktop.

How to install Homebrew package manager on Steam Deck

(See also installing Distroboxm, which is included in SteamOS 3.5 and newer: https://distrobox.it/ )
(See also installing Nix package manager: https://determinate.systems/posts/nix-on-the-steam-deck )

You can install Homebrew (a package manager for macOS and Linux) without disabling the read-only partition with sudo steamos-readonly disable.
The package manager can be used alongside Flatpaks. Some software is only available on Flathub, and some software is only available on Homebrew.

  1. Switch to desktop mode (hold power button until a menu appears, then select "Switch to desktop mode")
  2. Click the logo at the bottom left, go to System, then go to Konsole
  3. Set a password (needed for sudo access):
    passwd
  4. Install Homebrew using the steps here: https://brew.sh/
    Don't install any additional libraries from pacman or brew yet. Also, do not append to .bash_profile yet, otherwise it will break Steam.
  5. Add to .bash_profile with a check to make sure it is running in Konsole:
    echo 'if [ $(basename $(printf "%s" "$(ps -p $(ps -p $$ -o ppid=) -o cmd=)" | cut --delimiter " " --fields 1)) = konsole ] ; then '$'\n''eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'$'\n''fi'$'\n' >> ~/.bash_profile
  6. In Konsole's menu bar, go to Settings -> Manage Profile
  7. Press "New"
  8. Check "Default Profile"
  9. Set "Command" to /bin/bash -l (that is a lowercase l, not a number 1)
  10. Click OK twice
  11. Add brew environment to current context:
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
  12. Install glibc (the important thing is headers). This is needed in order to compile software.
    brew install glibc
  13. Install GCC:
    brew install gcc
@markstinson
Copy link

markstinson commented May 13, 2023

I made all of the steps and now Konsole does not opening up anymore...

You've a couple of options.

  1. Open up the Dolphin file manager and rename /home/linuxbrew to /home/linuxbrew.old. You'll likely need to open Dolphin as the root user/Admin. Then try your Konsole. You'd be moving your fresh linuxbrew out the way.

  2. You might try and install a terminal in the software Discovery app to start diving into via bash. IF a flathub terminal doesn't give you a working terminal, then it's likely the one of the following files is borked: /home/deck/{.bashrc,.bash_profile,.profile} OR their equivalent in /etc/ .

@ByToxX
Copy link

ByToxX commented May 13, 2023

I made all of the steps and now Konsole does not opening up anymore...

You've a couple of options.

  1. Open up the Dolphin file manager and rename /home/linuxbrew to /home/linuxbrew.old. You'll likely need to open Dolphin as the root user/Admin. Then try your Konsole. You'd be moving your fresh linuxbrew out the way.
  2. You might try and install a terminal in the software Discovery app to start di> > I made all of the steps and now Konsole does not opening up anymore...

You've a couple of options.

1. Open up the Dolphin file manager and rename `/home/linuxbrew` to `/home/linuxbrew.old`. You'll likely need to open Dolphin as the root user/Admin. Then try your Konsole. You'd be moving your fresh linuxbrew out the way.

2. You might try and install a [terminal](https://flathub.org/apps/search/terminal) in the software Discovery app to start diving into via bash. _IF_ a flathub terminal doesn't give you a working terminal, then it's likely the one of the following files is borked: `/home/deck/{.bashrc,.bash_profile,.profile}` OR their equivalent in /etc/ .

I've tried the first method and nothing. Konsole keeps closing out. As of the second solution, what do you mean by a: "working" terminal? Like, something like it doesn't recognize the: "brew" command? If you mean that then yes, the Terminal I downloaded from Discover doesn't recognize that command. And also, I tried to see what happens if I enter in the following path: "/home/deck/.local/share/konsole" and moving the: "Profile 1.profile" file to another location such as the Desktop, makes Konsole open without issue. What should I do?

EDIT: Nevermind. Was actually a mistake on my end. I've typed: "/bin/bash -1" instead of: "bin/bash -l". I will update the comment. Sorry for the misunderstanding.

@tony-sol
Copy link

@ThomasEricB sorry for necrobump, but have exactly the same issue
Did you solve the problem?

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