Skip to content

Instantly share code, notes, and snippets.

@JohnnyVicious
Created November 2, 2025 19:22
Show Gist options
  • Select an option

  • Save JohnnyVicious/b324ff20a38d5e59d99dd586ae3e97f5 to your computer and use it in GitHub Desktop.

Select an option

Save JohnnyVicious/b324ff20a38d5e59d99dd586ae3e97f5 to your computer and use it in GitHub Desktop.
Install PowerShell on Bazzite (ostree OS)
# 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