CentOS下 dotnet: command not found

CentOS 8,之前装的2.1是正常的,然后卸载了,再装了3.1的SDK就炸了,始终command not found

[root@iZwz9883ha8ul4wcjros0tZ /]# sudo dnf install dotnet-sdk-3.1 
Last metadata expiration check: 2:55:32 ago on Sat 29 Aug 2020 06:44:23 PM   CST. Package dotnet-sdk-3.1-3.1.401-1.x86_64 is already installed. 
Dependencies resolved. 
Nothing to do. 
Complete! 
[root@iZwz9883ha8ul4wcjros0tZ /]# dotnet --info
 -bash: dotnet: command not found 
[root@iZwz9883ha8ul4wcjros0tZ /]# whereis dotnet
 dotnet: /usr/bin/dotnet /usr/lib64/dotnet /etc/dotnet /usr/local/bin/dotnet /usr/share/dotnet /usr/share/man/man1/dotnet.1.gz 
[root@iZwz9883ha8ul4wcjros0tZ /]# ls /usr/bin/dotnet/sdk 
 3.1.401 
[root@iZwz9883ha8ul4wcjros0tZ /]# ls /usr/lib64/dotnet
 host packs shared 
[root@iZwz9883ha8ul4wcjros0tZ /]# ls /usr/local/bin/dotnet/sdk
 3.1.401 
[root@iZwz9883ha8ul4wcjros0tZ /]# ls /usr/share/dotnet/sdk
 3.1.401 
[root@iZwz9883ha8ul4wcjros0tZ /]#
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
.NET Core SDK
2023-09-04 13:47:18
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Potatoes先生

你这个是忘记卸载host了 所以dotnet命令无效。
正确做法 卸载全部netcore包 命令:【sudo yum remove dotnet-host】,(​​​https://docs.microsoft.com/zh-cn/dotnet/core/install/remove-runtime-sdk-versions?pivots=os-linux)里有写。​

然后重新安装
1,sudo rpm -Uvh ​​https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm​​2,sudo yum install dotnet-sdk-5.0 (这步骤SDK包已经包含了运行时)

安装完毕后 执行 dotnet --info 就可以了,如果出现info信息 就ok了,不用再添加软连接啥的

分享
微博
QQ
微信
回复
2023-09-04 15:26:25
相关问题
返回sdkmgr: command not found
4415浏览 • 1回复 待解决
linux dotnet--info无效
3715浏览 • 1回复 待解决
编译报错Found exception如下
2826浏览 • 1回复 待解决
centos服务器系统宕机
2893浏览 • 1回复 待解决
Task assembleHap not found in hvigor node: entry
3213浏览 • 1回复 待解决
CentOS7如何修改时区?
4132浏览 • 1回复 待解决
centos 7 升级 docker engine 问题
2422浏览 • 1回复 待解决
centos 6 安装 postgresql有知道的吗?
3227浏览 • 1回复 待解决
centos文件权限发生灵异事件。。。
2716浏览 • 1回复 待解决
CentOS 7.3 安装 Docker 的最简单方法
3257浏览 • 1回复 待解决
centos ssh 问题有懂的吗?
2704浏览 • 1回复 待解决
centos 无法卸载 wine怎么回事?
3433浏览 • 1回复 待解决
获取udid提示/system/bin/sh: bm: not found
15015浏览 • 2回复 待解决
关于centos 7中docker的镜像启动
3173浏览 • 1回复 待解决
centos无法连接外网,如何安装.net core?
3164浏览 • 1回复 待解决
No Hmos SDK found 请问这是什么问题
310浏览 • 0回复 待解决