centos8,debian10,需要安装 powershell-preview。然后把 pwsh-preview,改名成 pwsh。1 个月后,ps7 正式版出了后,就不需要这样做了。
centos7,centos8,安装 powershell:
curl -o /etc/yum.repos.d/microsoft.repo
https://packages.microsoft.com/config/rhel/7/prod.repo sudo yum remove -y powershell #删除旧版
sudo yum install -y powershell
pwsh -c 'mkdir -p "$env:HOME/.config/powershell" '
pwsh -c 'Add-Content -Value "Set-PSReadlineOption -EditMode Windows" -LiteralPath $profile '
pwsh -c 'Add-Content -Value "`nSubsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile" -LiteralPath /etc/ssh/sshd_config '
ubuntu1604:
sudo curl
https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo curl -o /etc/apt/sources.list.d/microsoft.list
https://packages.microsoft.com/config/ubuntu/16.04/prod.listsudo apt-get update
sudo apt-get remove -y powershell #删除旧版
sudo apt-get install -y powershell
pwsh -c 'mkdir -p "$env:HOME/.config/powershell" '
pwsh -c 'Add-Content -Value "Set-PSReadlineOption -EditMode Windows" -LiteralPath $profile '
pwsh -c 'Add-Content -Value "`nSubsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile" -LiteralPath /etc/ssh/sshd_config '
ubuntu1804:
sudo curl
https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo curl -o /etc/apt/sources.list.d/microsoft.list
https://packages.microsoft.com/config/ubuntu/18.04/prod.listsudo apt-get update
sudo apt-get remove -y powershell #删除旧版
sudo apt-get install -y powershell
pwsh -c 'mkdir -p "$env:HOME/.config/powershell" '
pwsh -c 'Add-Content -Value "Set-PSReadlineOption -EditMode Windows" -LiteralPath $profile '
pwsh -c 'Add-Content -Value "`nSubsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile" -LiteralPath /etc/ssh/sshd_config '
debian9:
sudo apt-get update
sudo apt-get install curl gnupg apt-transport-https
curl
https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64]
https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list'
sudo apt-get update
sudo apt-get remove -y powershell #删除旧版
sudo apt-get install -y powershell
pwsh -c 'mkdir -p "$env:HOME/.config/powershell" '
pwsh -c 'Add-Content -Value "Set-PSReadlineOption -EditMode Windows" -LiteralPath $profile '
pwsh -c 'Add-Content -Value "`nSubsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile" -LiteralPath /etc/ssh/sshd_config '
debian10:
sudo apt-get update
sudo apt-get install curl gnupg apt-transport-https
curl
https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
echo "deb [arch=amd64]
https://packages.microsoft.com/repos/microsoft-debian-buster-prod buster main" > /etc/apt/sources.list.d/microsoft.list
sudo apt-get update
sudo apt-get remove -y powershell #删除旧版
sudo apt-get install -y powershell
pwsh -c 'mkdir -p "$env:HOME/.config/powershell" '
pwsh -c 'Add-Content -Value "Set-PSReadlineOption -EditMode Windows" -LiteralPath $profile '
pwsh -c 'Add-Content -Value "`nSubsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile" -LiteralPath /etc/ssh/sshd_config '