首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在debian上安装.Net dotnet

在debian上安装.Net dotnet
EN

Unix & Linux用户
提问于 2021-09-20 07:01:19
回答 2查看 830关注 0票数 0

我下载了./dotnet-install.sh并成功安装:

代码语言:javascript
复制
$ ./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命令:

代码语言:javascript
复制
"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命令。

EN

回答 2

Unix & Linux用户

发布于 2021-09-20 08:48:14

您需要将路径添加到~/..profile或~/..bashrc文件中。

代码语言:javascript
复制
PATH=$PATH:/home/tesla/.dotnet

立即更新更改

代码语言:javascript
复制
source ~/.profile 
or
source ~/.bashrc
票数 0
EN

Unix & Linux用户

发布于 2021-09-20 09:05:23

您可以手动安装dotnet:

1-通过安装tarball:

代码语言:javascript
复制
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/dotnet

2-通过安装.deb文件

您可以下载.deb文件从这里开始,e,g:

代码语言:javascript
复制
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/669779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档