Skip to content

Instantly share code, notes, and snippets.

@jhochwald
Last active October 17, 2023 14:44
Show Gist options
  • Save jhochwald/376ebc9ed3fa45bd27cec208fd0abb77 to your computer and use it in GitHub Desktop.
Save jhochwald/376ebc9ed3fa45bd27cec208fd0abb77 to your computer and use it in GitHub Desktop.
Install the PowerShell 7.3.8 binary release on a Debian ARM64 Linux box, or Debian ARM64 based WSL. There is no DEB package, yet!
# install the dependencies
apt install libc6 libgcc1 libgssapi-krb5-2 libicu72 libssl1.1 libstdc++6 zlib1g -y
# Get the .NET install script
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
# Make it executable
chmod +x ./dotnet-install.sh
# Install the .NET SDK 7.0 (STS) for ARM64
#./dotnet-install.sh --architecture arm64 --channel STS
# Install the .NET runtime 7.0 (STS) for ARM64
./dotnet-install.sh --architecture arm64 --channel STS --runtime dotnet --dry-run
# When 8.0 is released, we should change the channel to LTS
# Set environment variables system-wide
tee /etc/profile.d/dotnet.sh <<EOF
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
EOF
# Install system components
sudo apt update && sudo apt install -y curl gnupg apt-transport-https wget
# Download the Microsoft Repository package
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
# Install the Microsoft Repository package
sudo dpkg -i packages-microsoft-prod.deb
# Remove the Microsoft Repository package
rm packages-microsoft-prod.deb
# Update APT (optional)
sudo apt update
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.3.8/powershell-7.3.8-linux-arm64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/7
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7
# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/7/pwsh
# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment