文章目录

  • linux 安装powershell
  • refereces
  • Ubuntu/Debian install powershell7+
  • 检查当前发行版
  • 运行安装脚本
  • verify installation
  • windwos msi包安装报错问题
  • msi包无法安装问题🎈


linux 安装powershell

refereces

Ubuntu/Debian install powershell7+

检查当前发行版

  • cat /etc/issue
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:        18.04
Codename:       bionic
Ubuntu 18.04.6 LTS \n \l

运行安装脚本

# Install system components
sudo apt update  && sudo apt install -y curl gnupg apt-transport-https

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

# Register the Microsoft Product feed
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list'

# Install PowerShell
sudo apt update && sudo apt install -y powershell

# Start PowerShell
pwsh

verify installation

  • cat /etc/shells|grep powershell
# cxxu @ cxxuAli in ~ [11:04:44]
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/bin/zsh
/usr/bin/zsh
/usr/bin/pwsh
/opt/microsoft/powershell/7/pwsh

windwos msi包安装报错问题

msi包无法安装问题🎈

  • 报错内容:
Windows Installer
    This installation package could not be
    opened.Contact the application vendor to
    verify that this is a valid Windows Installer
    package.
  • 然而,实际情况是包能够在虚拟机中安装,安装包没有问题.
  • 这种情况下,您可能无法安装wsl_update.msi内核更新程序
  • 办法1:😂
  • 可考虑将安装包复制一份到新建账户到桌面(可能和权限有关)
  • 办法2:
  • 尝试创建一个新的本地管理员账户
  • 在新账户中尝试运行安装包
  • 重启到原账户
  • 如果依然不可用,🎈,重复方法1中复制安装包再安装