Created
November 2, 2025 19:22
-
-
Save JohnnyVicious/b324ff20a38d5e59d99dd586ae3e97f5 to your computer and use it in GitHub Desktop.
Install PowerShell on Bazzite (ostree OS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Pick the version you want (match the one you tried if you like) | |
| VER=7.5.4 | |
| ARCH=x64 # use 'arm64' on Apple/ARM boxes | |
| # Create a versioned install dir under /usr/local | |
| sudo mkdir -p /usr/local/microsoft/powershell/$VER | |
| cd /usr/local/microsoft/powershell/$VER | |
| # Download the universal tarball from the official releases | |
| sudo curl -L -O https://github.com/PowerShell/PowerShell/releases/download/v$VER/powershell-$VER-linux-$ARCH.tar.gz | |
| # Extract and wire up a symlink into PATH | |
| sudo tar -xzf powershell-$VER-linux-$ARCH.tar.gz | |
| sudo ln -sf /usr/local/microsoft/powershell/$VER/pwsh /usr/local/bin/pwsh | |
| # Ensure the symlink target is executable | |
| sudo chmod +x /usr/local/microsoft/powershell/7.5.4/pwsh | |
| sudo install -d -m 0755 /usr/local/bin # make sure the dir exists | |
| # re-point the symlink just in case | |
| sudo ln -sf /usr/local/microsoft/powershell/7.5.4/pwsh /usr/local/bin/pwsh | |
| # Fix SELinux labels after extracting a tarball | |
| # (Fedora/Bazzite is enforcing; unlabeled files can cause 'Permission denied') | |
| sudo restorecon -RFv /usr/local /var/usrlocal | |
| # Test | |
| pwsh --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment