- 在 Linux 上安装 PowerShell CoreInstalling PowerShell Core on Linux
- 本文内容
- 安装预览版本Installing Preview Releases
- Ubuntu 14.04Ubuntu 14.04
- Ubuntu 16.04Ubuntu 16.04
- Ubuntu 18.04Ubuntu 18.04
- Ubuntu 18.10Ubuntu 18.10
- Debian 8Debian 8
- Debian 9Debian 9
- CentOS 7CentOS 7
- Red Hat Enterprise Linux (RHEL) 7Red Hat Enterprise Linux (RHEL) 7
- 通过包存储库安装(首选)- Red Hat Enterprise Linux (RHEL) 7Installation via Package Repository (preferred) - Red Hat Enterprise Linux (RHEL) 7
- 通过直接下载进行安装 - Red Hat Enterprise Linux (RHEL) 7Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
- 卸载 - Red Hat Enterprise Linux (RHEL) 7Uninstallation - Red Hat Enterprise Linux (RHEL) 7
- OpenSUSEopenSUSE
- FedoraFedora
- Arch LinuxArch Linux
- Snap 包Snap Package
- KaliKali
- RaspbianRaspbian
- 二进制存档Binary Archives
- 路径Paths
在 Linux 上安装 PowerShell CoreInstalling PowerShell Core on Linux
本文内容
支持 Ubuntu 14.04、Ubuntu 16.04、Ubuntu 18.04、Ubuntu 18.10、Debian 8、Debian 9、CentOS 7、Red Hat Enterprise Linux (RHEL) 7、openSUSE 42.3、openSUSE Leap 15、Fedora 27、Fedora 28 和 Arch Linux。
对于未获得官方支持的 Linux 分发,可尝试使用 PowerShell Snap 包。还可以尝试直接使用 Linux tar.gz archive 部署 PowerShell 二进制文件,但是需要在各个步骤中基于 OS 设置所需的依赖项。
GitHub 版本页面上提供有所有可用包。安装包以后,从终端运行 pwsh。
安装预览版本Installing Preview Releases
通过包存储库安装适用于 Linux 的 PowerShell Core 预览版本时,包名称从 powershell 更改为 powershell-preview。
直接下载安装不会更改包名称(文件名除外)。
下面是使用各种包管理器安装稳定包和预览包的命令表:
| 分配 | 稳定包命令 | 预览包命令 |
|---|---|---|
| Ubuntu、Debian | sudo apt-get install -y powershell |
sudo apt-get install -y powershell-preview |
| CentOS、RedHat | sudo yum install -y powershell |
sudo yum install -y powershell-preview |
| Fedora | sudo dnf install -y powershell |
sudo dnf install -y powershell-preview |
Ubuntu 14.04Ubuntu 14.04
通过包存储库安装 - Ubuntu 14.04Installation via Package Repository - Ubuntu 14.04
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到包存储库。这是首选方法。
1. # Download the Microsoft repository GPG keys
2. wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb
4. # Register the Microsoft repository GPG keys
5. sudo dpkg -i packages-microsoft-prod.deb
7. # Update the list of products
8. sudo apt-get update
10. # Install PowerShell
11. sudo apt-get install -y powershell
13. # Start PowerShell
14. pwsh
以超级用户身份注册 Microsoft 存储库。此后,只需使用 sudo apt-get upgrade powershell 来更新安装。
通过直接下载进行安装 - Ubuntu 14.04Installation via Direct Download - Ubuntu 14.04
从以下位置将 Debian 包 powershell_6.1.0-1.ubuntu.14.04_amd64.deb 下载到 Debian 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dpkg -i powershell_6.1.0-1.ubuntu.14.04_amd64.deb
2. sudo apt-get install -f
备注
dpkg -i 命令失败,未满足依赖项。下一命令 apt-get install -f 解决此类问题,然后完成 PowerShell 包配置。
卸载 - Ubuntu 14.04Uninstallation - Ubuntu 14.04
1. sudo apt-get remove powershell
Ubuntu 16.04Ubuntu 16.04
通过包存储库安装 - Ubuntu 16.04Installation via Package Repository - Ubuntu 16.04
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到包存储库。这是首选方法。
1. # Download the Microsoft repository GPG keys
2. wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
4. # Register the Microsoft repository GPG keys
5. sudo dpkg -i packages-microsoft-prod.deb
7. # Update the list of products
8. sudo apt-get update
10. # Install PowerShell
11. sudo apt-get install -y powershell
13. # Start PowerShell
14. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo apt-get upgrade powershell 将其更新即可。
通过 Direct Download 的安装 - Ubuntu 16.04Installation via Direct Download - Ubuntu 16.04
从以下位置将 Debian 包 powershell_6.1.0-1.ubuntu.16.04_amd64.deb 下载到 Debian 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dpkg -i powershell_6.1.0-1.ubuntu.16.04_amd64.deb
2. sudo apt-get install -f
备注
dpkg -i 命令失败,未满足依赖项。下一命令 apt-get install -f 解决此类问题,然后完成 PowerShell 包配置。
卸载 - Ubuntu 16.04Uninstallation - Ubuntu 16.04
1. sudo apt-get remove powershell
Ubuntu 18.04Ubuntu 18.04
通过包存储库安装 - Ubuntu 18.04Installation via Package Repository - Ubuntu 18.04
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到包存储库。这是首选方法。
1. # Download the Microsoft repository GPG keys
2. wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
4. # Register the Microsoft repository GPG keys
5. sudo dpkg -i packages-microsoft-prod.deb
7. # Update the list of products
8. sudo apt-get update
10. # Install PowerShell
11. sudo apt-get install -y powershell
13. # Start PowerShell
14. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo apt-get upgrade powershell 将其更新即可。
通过直接下载安装 - Ubuntu 18.04Installation via Direct Download - Ubuntu 18.04
从以下位置将 Debian 包 powershell_6.1.0-1.ubuntu.18.04_amd64.deb 下载到 Debian 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dpkg -i powershell_6.1.0-1.ubuntu.18.04_amd64.deb
2. sudo apt-get install -f
备注
dpkg -i 命令失败,未满足依赖项。下一命令 apt-get install -f 解决此类问题,然后完成 PowerShell 包配置。
卸载 - Ubuntu 18.04Uninstallation - Ubuntu 18.04
1. sudo apt-get remove powershell
Ubuntu 18.10Ubuntu 18.10
备注
支持通过 snapd 按 18.10 版上进行安装。有关完整说明,请参阅 Snap 包;
Debian 8Debian 8
通过包存储库安装 - Debian 8Installation via Package Repository - Debian 8
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到包存储库。这是首选方法。
1. # Install system components
2. sudo apt-get update
3. sudo apt-get install curl apt-transport-https
5. # Import the public repository GPG keys
6. curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
8. # Register the Microsoft Product feed
9. sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/microsoft.list'
11. # Update the list of products
12. sudo apt-get update
14. # Install PowerShell
15. sudo apt-get install -y powershell
17. # Start PowerShell
18. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo apt-get upgrade powershell 将其更新即可。
通过直接下载进行安装 - Debian 8Installation via Direct Download - Debian 8
从以下位置将 Debian 包 powershell_6.1.0-1.debian.8_amd64.deb 下载到 Debian 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dpkg -i powershell_6.1.0-1.debian.8_amd64.deb
2. sudo apt-get install -f
备注
dpkg -i 命令失败,未满足依赖项。下一命令 apt-get install -f 解决此类问题,然后完成 PowerShell 包配置。
卸载 - Debian 8Uninstallation - Debian 8
1. sudo apt-get remove powershell
Debian 9Debian 9
通过包存储库安装 - Debian 9Installation via Package Repository - Debian 9
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到包存储库。这是首选方法。
1. # Install system components
2. sudo apt-get update
3. sudo apt-get install curl gnupg apt-transport-https
5. # Import the public repository GPG keys
6. curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
8. # Register the Microsoft Product feed
9. 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'
11. # Update the list of products
12. sudo apt-get update
14. # Install PowerShell
15. sudo apt-get install -y powershell
17. # Start PowerShell
18. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo apt-get upgrade powershell 将其更新即可。
通过直接下载进行安装 - Debian 9Installation via Direct Download - Debian 9
从以下位置将 Debian 包 powershell_6.1.0-1.debian.9_amd64.deb 下载到 Debian 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dpkg -i powershell_6.1.0-1.debian.9_amd64.deb
2. sudo apt-get install -f
卸载 - Debian 9Uninstallation - Debian 9
1. sudo apt-get remove powershell
CentOS 7CentOS 7
备注
此包也可以在 Oracle Linux 7 上运行。
通过包存储库安装(首选)- CentOS 7Installation via Package Repository (preferred) - CentOS 7
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到正式的 Microsoft 存储库。
1. # Register the Microsoft RedHat repository
2. curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
4. # Install PowerShell
5. sudo yum install -y powershell
7. # Start PowerShell
8. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo yum update powershell 更新 PowerShell 即可。
通过直接下载进行安装 - CentOS 7Installation via Direct Download - CentOS 7
使用 CentOS 7 从以下位置将 RPM 包 powershell-6.1.0-1.rhel.7.x86_64.rpm 下载到 CentOS 计算机:版本页。
然后在终端中执行以下命令:
1. sudo yum install powershell-6.1.0-1.rhel.7.x86_64.rpm
无需该中间下载步骤也可安装 RPM:
1. sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
卸载 - CentOS 7Uninstallation - CentOS 7
1. sudo yum remove powershell
Red Hat Enterprise Linux (RHEL) 7Red Hat Enterprise Linux (RHEL) 7
通过包存储库安装(首选)- Red Hat Enterprise Linux (RHEL) 7Installation via Package Repository (preferred) - Red Hat Enterprise Linux (RHEL) 7
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到正式的 Microsoft 存储库。
1. # Register the Microsoft RedHat repository
2. curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
4. # Install PowerShell
5. sudo yum install -y powershell
7. # Start PowerShell
8. pwsh
作为超级用户注册 Microsoft 存储库一次后,仅需使用 sudo yum update powershell 更新 PowerShell 即可。
通过直接下载进行安装 - Red Hat Enterprise Linux (RHEL) 7Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
从以下位置将 RPM 包 powershell-6.1.0-1.rhel.7.x86_64.rpm 下载到 Fedora 计算机:版本页。
然后在终端中执行以下命令:
1. sudo yum install powershell-6.1.0-1.rhel.7.x86_64.rpm
无需该中间下载步骤也可安装 RPM:
1. sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
卸载 - Red Hat Enterprise Linux (RHEL) 7Uninstallation - Red Hat Enterprise Linux (RHEL) 7
1. sudo yum remove powershell
OpenSUSEopenSUSE
安装 - openSUSE 42.3Installation - openSUSE 42.3
1. # Install dependencies
2. zypper update && zypper --non-interactive install curl tar libicu52_1
4. # Download the powershell '.tar.gz' archive
5. curl -L https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
7. # Create the target folder where powershell will be placed
8. mkdir -p /opt/microsoft/powershell/6.1.0
10. # Expand powershell to the target folder
11. tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.1.0
13. # Set execute permissions
14. chmod +x /opt/microsoft/powershell/6.1.0/pwsh
16. # Create the symbolic link that points to pwsh
17. ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh
19. # Start PowerShell
20. pwsh
安装 - openSUSE Leap 15Installation - openSUSE Leap 15
1. # Install dependencies
2. zypper update && zypper --non-interactive install curl tar gzip libopenssl1_0_0 libicu60_2
4. # Download the powershell '.tar.gz' archive
5. curl -L https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
7. # Create the target folder where powershell will be placed
8. mkdir -p /opt/microsoft/powershell/6.1.0
10. # Expand powershell to the target folder
11. tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.1.0
13. # Set execute permissions
14. chmod +x /opt/microsoft/powershell/6.1.0/pwsh
16. # Create the symbolic link that points to pwsh
17. ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh
19. # Start PowerShell
20. pwsh
卸载 - OpenSUSE 42.3、openSUSE Leap 15Uninstallation - openSUSE 42.3, openSUSE Leap 15
1. rm -rf /usr/bin/pwsh /opt/microsoft/powershell
FedoraFedora
备注
Fedora 28 仅在 PowerShell Core 6.1 以及更新版本中受到支持。
通过包存储库安装(首选)- Fedora 27、Fedora 28Installation via Package Repository (preferred) - Fedora 27, Fedora 28
为简化安装(和更新),已将适用于 Linux 的 PowerShell Core 发布到正式的 Microsoft 存储库。
1. # Register the Microsoft signature key
2. sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
4. # Register the Microsoft RedHat repository
5. curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
7. # Update the list of products
8. sudo dnf update
10. # Install a system component
11. sudo dnf install compat-openssl10
13. # Install PowerShell
14. sudo dnf install -y powershell
16. # Start PowerShell
17. pwsh
通过直接下载进行安装 - Fedora 27、Fedora 28Installation via Direct Download - Fedora 27, Fedora 28
从以下位置将 RPM 包 powershell-6.1.0-1.rhel.7.x86_64.rpm 下载到 Fedora 计算机:版本页。
然后在终端中执行以下命令:
1. sudo dnf install compat-openssl10
2. sudo dnf install powershell-6.1.0-1.rhel.7.x86_64.rpm
无需该中间下载步骤也可安装 RPM:
1. sudo dnf install compat-openssl10
2. sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm
卸载 - Fedora 27、Fedora 28Uninstallation - Fedora 27, Fedora 28
1. sudo dnf remove powershell
Arch LinuxArch Linux
备注
Arch 支持是实验性的。
Arch Linux 用户存储库 (AUR) 中提供有 PowerShell。
- 可使用最新标记版本对其进行编译
- 可使用最新 commit to master 对其进行编译
- 可以使用最新版本二进制文件进行安装 AUR 中的包由社区维护,并无正式支持。
有关从 AUR 安装包的详细信息,请参阅 Arch Linux wiki 或 DockerFile 社区。
Snap 包Snap Package
获取 snapdGetting snapd
需具备 snapd 才能运行 Snap。按照这些说明确保你已安装 snapd。
通过 Snap 进行安装Installation via Snap
为简化安装(和更新),已向 Snap 存储发布 PowerShell Core for Linux。这是首选方法。
1. # Install PowerShell
2. sudo snap install powershell --classic
4. # Start PowerShell
5. pwsh
如果想要安装预览版本,请使用以下方法。
1. # Install PowerShell
2. sudo snap install powershell-preview --classic
4. # Start PowerShell
5. pwsh-preview
安装 Snap 后将自动升级,但可以使用 sudo snap refresh powershell 或 sudo snap refresh powershell-preview 来触发升级。
卸载Uninstallation
1. sudo snap remove powershell
或
1. sudo snap remove powershell-preview
KaliKali
安装 - KaliInstallation - Kali
1. # Download & Install prerequisites
2. wget http://ftp.us.debian.org/debian/pool/main/i/icu/libicu57_57.1-9_amd64.deb
3. dpkg -i libicu57_57.1-9_amd64.deb
4. apt-get update && apt-get install -y curl gnupg apt-transport-https
6. # Add Microsoft public repository key to APT
7. curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
9. # Add Microsoft package repository to the source list
10. echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" | tee /etc/apt/sources.list.d/powershell.list
12. # Install PowerShell package
13. apt-get update && apt-get install -y powershell
15. # Start PowerShell
16. pwsh
卸载 - KaliUninstallation - Kali
1. # Uninstall PowerShell package
2. apt-get remove -y powershell
RaspbianRaspbian
备注
Raspbian 支持是实验性的。
当前仅 Raspbian Stretch 支持 PowerShell。
此外 CoreCLR(和 PowerShell Core)仅适用于 Pi 2 和 Pi 3 设备,因为其他设备(如 Pi 0)有不受支持的处理器。
下载 Raspbian Stretch 并按照安装说明操作,将其安装在你的 Pi 上。
安装 - RaspbianInstallation - Raspbian
1. # Install prerequisites
2. sudo apt-get install libunwind8
4. # Grab the latest tar.gz
5. wget https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-arm32.tar.gz
7. # Make folder to put powershell
8. mkdir ~/powershell
10. # Unpack the tar.gz file
11. tar -xvf ./powershell-6.1.0-linux-arm32.tar.gz -C ~/powershell
13. # Start PowerShell
14. ~/powershell/pwsh
或者可以创建能够启动 PowerShell 的符号链接,而无需指定到“pwsh”二进制文件的路径
1. # Start PowerShell from bash with sudo to create a symbolic link
2. sudo ~/powershell/pwsh -c New-Item -ItemType SymbolicLink -Path "/usr/bin/pwsh" -Target "\$PSHOME/pwsh" -Force
4. # alternatively you can run following to create a symbolic link
5. # sudo ln -s ~/powershell/pwsh /usr/bin/pwsh
7. # Now to start PowerShell you can just run "pwsh"
卸载 - RaspbianUninstallation - Raspbian
1. rm -rf ~/powershell
二进制存档Binary Archives
已对 Linux 平台提供 PowerShell 二进制 tar.gz 存档,以启用高级部署方案。
依赖关系Dependencies
PowerShell 为所有 Linux 分发版生成可移植二进制文件。但是对于不同的分发版,.NET Core 运行时需要不同的依赖项,因此 PowerShell 也有相同要求。
下表列出了在不同 Linux 分发版上正式支持的 .NET Core 2.0 依赖项。
| 操作系统 | 依赖关系 |
|---|---|
| Ubuntu 14.04 | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.0、libicu52 |
| Ubuntu 16.04 | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.0、libicu55 |
| Ubuntu 17.10 | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.0、libicu57 |
| Ubuntu 18.04 | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.0、libicu60 |
| Debian 8 (Jessie) | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.0、libicu52 |
| Debian 9 (Stretch) | libc6、libgcc1、libgssapi-krb5-2、liblttng-ust0、libstdc++6、libcurl3、libunwind8、libuuid1、zlib1g、libssl1.0.2、libicu57 |
| CentOS 7Oracle Linux 7RHEL 7 | libunwind、libcurl、openssl-libs、libicu |
| openSUSE 42.3 | libcurl4、libopenssl1_0_0、libicu52_1 |
| openSUSE Leap 15 | libcurl4、libopenssl1_0_0、libicu60_2 |
| Fedora 27Fedora 28 | libunwind、libcurl、openssl-libs、libicu、compat-openssl10 |
若要在不受正式支持的 Linux 分发版上部署 PowerShell 二进制文件,则需在各个步骤中安装目标 OS 的必要依赖项。例如,Amazon Linux dockerfile 应先安装依赖项,然后提取 Linux tar.gz 存档。
安装 - 二进制存档Installation - Binary Archives
LinuxLinux
1. # Download the powershell '.tar.gz' archive
2. curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz
4. # Create the target folder where powershell will be placed
5. sudo mkdir -p /opt/microsoft/powershell/6.1.0
7. # Expand powershell to the target folder
8. sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.1.0
10. # Set execute permissions
11. sudo chmod +x /opt/microsoft/powershell/6.1.0/pwsh
13. # Create the symbolic link that points to pwsh
14. sudo ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh
卸载二进制存档Uninstalling binary archives
1. sudo rm -rf /usr/bin/pwsh /opt/microsoft/powershell
路径Paths
$PSHOME是/opt/microsoft/powershell/6.1.0/- 将从
~/.config/powershell/profile.ps1中读取用户配置文件 - 将从
$PSHOME/profile.ps1中读取默认配置文件 - 将从
~/.local/share/powershell/Modules中读取用户模块 - 将从
/usr/local/share/powershell/Modules中读取共享模块 - 将从
$PSHOME/Modules中读取默认模块 - PSReadline 历史记录将记录到
~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt配置文件采用 PowerShell 的每个主机配置,所以默认主机特定配置文件位于相同位置下的Microsoft.PowerShell_profile.ps1中。
PowerShell 采用 Linux 上的 XDG Base Directory 规范。
