.net - 如何在基于 linux 的 ec2 实例中安装 .net core 3.1
问题描述
我正在尝试使用 aws 实例配置。
因为我是新手。我试图安装 .net 3.1 核心。
遵循以下代码
sudo su -
yum install -y libunwind libicu
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=835019
mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
ln -s /opt/dotnet/dotnet /usr/local/bin/dotnet
但没有任何效果。不完全了解上述代码的工作原理,想知道它。
并且还想在我的 ec2 实例上安装 .net3.1 核心。
你能帮我解决这个问题吗?
解决方案
最好以原生 Linux 方式安装软件包。
由于 Amazon Linux 基于 RHEL,您可以参考以下命令。
SDK
sudo yum install scl-utils
subscription-manager repos --enable=rhel-7-server-dotnet-rpms
yum install rh-dotnet31 -y
scl enable rh-dotnet31 bash
source scl_source enable rh-dotnet31
运行
subscription-manager repos --enable=rhel-7-server-dotnet-rpms
yum install rh-dotnet31-aspnetcore-runtime-3.1 -y
scl enable rh-dotnet31-aspnetcore-runtime-3.1 bash
source scl_source enable rh-dotnet31-aspnetcore-runtime-3.1
参考: https ://docs.microsoft.com/en-us/dotnet/core/install/linux-rhel#rhel-7-
推荐阅读
- json - 如何使用 POSTMAN 读取名称中带有句号的 JSON 对象?
- html - 将文本从 Excel 添加到 HTML 文件
- azure - 如何避免在重新启动 Azure VM 时清理临时文件夹?
- flutter - 使用flutter create app运行时会抛出错误
- ios - 重置 box-sizing 对 iOS Safari 网络有什么害处吗?
- react-native-android - Gradlew bundleRelease 不会在 react-native 中生成发布 apk
- kubernetes - DNS 服务如何在 Kubernetes 中工作?
- webpack - 如何覆盖 HtmlWebpackPlugin 生成的 src 标签?
- excel - Range.Find 函数
- python - 带集合的二元运算符的运行时