ubuntu linux 安装net8 net9 net 10方法

试了好多种方法,官网的最靠谱,也最省事。

1.先下载脚本,下面两种二选一:

第一种:

复制代码
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh

第二种:

复制代码
curl -L https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh

2.运行此脚本之前,请确保授予此脚本作为可执行文件运行的权限:

复制代码
chmod +x ./dotnet-install.sh

3.安装net

安装最新版,目前是.Net 10

复制代码
./dotnet-install.sh --version latest

安装指定版本,--channel 9.0就是安装.Net 9.0 ,安装.Net 8.0就是--channel 8.0.

复制代码
./dotnet-install.sh --channel 9.0

若要安装 .NET最新运行时用 --runtime 参数。

复制代码
./dotnet-install.sh --version latest --runtime aspnetcore

安装指定版本 .NET运行时,比如9.0就换下面的命令

复制代码
./dotnet-install.sh --channel 9.0 --runtime aspnetcore

4.永久环境变量

复制代码
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc

5.检查安装是否成功

复制代码
dotnet --version
相关推荐
invicinble1 小时前
对linux形成认识
linux·运维·服务器
小Pawn爷1 小时前
14.VMmare安装ubuntu
linux·运维·ubuntu
半桔2 小时前
【IO多路转接】高并发服务器实战:Reactor 框架与 Epoll 机制的封装与设计逻辑
linux·运维·服务器·c++·io
engchina2 小时前
WSL Ubuntu で Kubernetes v1.34.2 + Docker 環境を構築する
ubuntu·docker·kubernetes
HABuo2 小时前
【linux文件系统】磁盘结构&文件系统详谈
linux·运维·服务器·c语言·c++·ubuntu·centos
Howrun7773 小时前
关于Linux服务器的协作问题
linux·运维·服务器
小白同学_C4 小时前
Lab3-page tables && MIT6.1810操作系统工程【持续更新】
linux·c/c++·操作系统os
十年磨一剑~4 小时前
Linux程序接收到sigpipe信号崩溃处理
linux
geshifei4 小时前
Sched ext回调3——select_cpu(linux 6.15.7)
linux·ebpf
代码游侠5 小时前
C语言核心概念复习——网络协议与TCP/IP
linux·运维·服务器·网络·算法