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
相关推荐
大鱼>9 分钟前
eBPF内核编程:从TC到XDP的全栈可观测性
linux·服务器·php
sxstj27 分钟前
老旧电脑 Linux 系统完整推荐(按内存分档,新手友好)
linux
Lyra_Infra1 小时前
OpenClaw 服务异常故障分析报告
linux·人工智能
冷莫溪3 小时前
Zabbix——认识及部署Zabbix(基于Rocky9.7)
linux·运维·php·zabbix
风曦Kisaki3 小时前
Kubernetes(K8s)笔记Day03: Pod命名空间,标签,Pod 的调度,污点与容忍度,Pod 常见状态和重启策略,Pod 生命周期
linux·运维·笔记·docker·云原生·容器·kubernetes
xuhe23 小时前
一劳永逸!解决 AutoDL 系统盘(30GB)爆满与 pip 缓存迁移
linux·python·ai·jupyter
学无止境_永不停歇4 小时前
9. 缓冲区
linux·服务器·c++
dok124 小时前
Johannes 《Linux内核模块与设备驱动开发:编写Linux驱动程序》(4) devicefile 设备号相关
linux·运维·服务器
Fu2067214 小时前
结课项目考试
linux·运维·服务器
LSG_Dawn4 小时前
XBOX360 kinect + ROS2_humble
ubuntu·深度相机