我下载了./dotnet-install.sh并成功安装:
$ ./dotnet-install.sh -c Current
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: .NET Core SDK version 5.0.207 is already installed.
dotnet-install: Adding to current process PATH: `/home/tesla/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.我增加了路径
└─$ export =$PATH:/home/tesla/..dotnet
dotnet -- 5.0.207版
我有两个问题:
首先,每次重新启动PC时,我都需要重新安装第二个vs代码终端,没有看到dotnet -version命令:
"Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk # version 5.0.401, or
sudo apt install dotnet-host
See 'snap info dotnet-sdk' for additional versions. "如果我在vscode终端上设置路径,在重新启动vscode之后,它将不识别dotnet命令。
发布于 2021-09-20 08:48:14
您需要将路径添加到~/..profile或~/..bashrc文件中。
PATH=$PATH:/home/tesla/.dotnet立即更新更改
source ~/.profile
or
source ~/.bashrc发布于 2021-09-20 09:05:23
您可以手动安装dotnet:
1-通过安装tarball:
wget https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.207/dotnet-sdk-5.0.207-linux-x64.tar.gz
sudo mkdir -p /usr/share/dotnet
sudo tar -zxf dotnet-sdk-5.0.207-linux-x64.tar.gz -C /usr/share/dotnet
sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet2-通过安装.deb文件
您可以下载.deb文件从这里开始,e,g:
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.debhttps://unix.stackexchange.com/questions/669779
复制相似问题