/usr/bin/dotnet: 没有那个文件或目录

今天在服务器上更新了dotnet后想查看下已安装的所有版本

dotnet --info
-bash: /usr/bin/dotnet: 没有那个文件或目录

瞬间懵逼了,经过查阅资料后发现,早期版本的dotnet安装的是/usr/local/bin/下,因此环境变量也就在该目录,后期的版本则安装到了/usr/share/下,于是尝试了下

/usr/share/dotnet/dotnet --info
.NET SDK (反映任何 global.json):
 Version:   5.0.403
 Commit:    bf9d168ac2

运行时环境:
 OS Name:     centos
 OS Version:  7
 OS Platform: Linux
 RID:         centos.7-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.403/

Host (useful for support):
  Version: 5.0.12
  Commit:  7211aa01b3

.NET SDKs installed:
  3.1.415 [/usr/share/dotnet/sdk]
  5.0.403 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

问题找到了,但这是线上环境,如果改环境变量的话,可能会导致直接使用早期版本的绝对路径的服务炸锅,因此我选择了软连接的方式

sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet

此时再运行dotnet便没有错误了

echo $CLANG140_BIN /home/chen-docker/bin:/home/chen-docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/chen-docker/dotnet:/usr/local/llvm/bin chen-docker@chen-docker-virtual-machine:~/bin$ clang -v clang version 14.0.0 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/llvm/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9 Candidate multilib: .;@m64 Selected multilib: .;@m64 已经安装且添加变量了,怎么编译还是报错?[buildex.py] ERROR: Tool path /pkg/qct/software/llvm/release/arm/14.0.0/bin/ does not exist! Traceback (most recent call last): File "boot_images/boot_tools/buildex.py", line 1833, in <module> main() File "boot_images/boot_tools/buildex.py", line 539, in main create_image(options,variant_flavor,build_config,tools_config) File "boot_images/boot_tools/buildex.py", line 616, in create_image dll_paths=process_components(options,variant_flavor,process_action,build_config,tools_config,merge_dict) File "boot_images/boot_tools/buildex.py", line 708, in process_components bin_path=process_component(options,variant_flavor,component,process_config,build_config,tools_config,merge_dict) File "boot_images/boot_tools/buildex.py", line 773, in process_component set_compiler_path(tool_config,component_config['Process'][i]['ToolChain']) File "boot_images/boot_tools/buildex.py", line 1307, in set_compiler_path "Expected location " + os.environ[COMPILER_BIN_NAME]) File "/usr/lib/python3.8/os.py", line 675, in getitem raise KeyError(key) from None KeyError: 'CLANG140_BIN' build failed!
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值