Rocky Linux 8.4に.NET Core 5.0 をインストールする

1.AppStream から .NET Core 5.0をインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[root@localhost ~]# dnf -y install dotnet-runtime-5.0 dotnet-sdk-5.0 dotnet-targeting-pack-5.0 dotnet-templates-5.0 dotnet-hostfxr-5.0
インストール済み:
aspnetcore-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64
aspnetcore-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-apphost-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-host-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-hostfxr-5.0-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-sdk-5.0-5.0.208-1.el8_4.rocky.0.x86_64
dotnet-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
dotnet-templates-5.0-5.0.208-1.el8_4.rocky.0.x86_64
lttng-ust-2.8.1-11.el8.x86_64
netstandard-targeting-pack-2.1-5.0.208-1.el8_4.rocky.0.x86_64
[root@localhost ~]# dnf -y install dotnet-runtime-5.0 dotnet-sdk-5.0 dotnet-targeting-pack-5.0 dotnet-templates-5.0 dotnet-hostfxr-5.0 略 インストール済み: aspnetcore-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64 aspnetcore-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-apphost-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-host-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-hostfxr-5.0-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-sdk-5.0-5.0.208-1.el8_4.rocky.0.x86_64 dotnet-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64 dotnet-templates-5.0-5.0.208-1.el8_4.rocky.0.x86_64 lttng-ust-2.8.1-11.el8.x86_64 netstandard-targeting-pack-2.1-5.0.208-1.el8_4.rocky.0.x86_64
[root@localhost ~]# dnf -y install dotnet-runtime-5.0 dotnet-sdk-5.0 dotnet-targeting-pack-5.0 dotnet-templates-5.0 dotnet-hostfxr-5.0
略
インストール済み:
  aspnetcore-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  aspnetcore-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-apphost-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-host-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-hostfxr-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-runtime-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-sdk-5.0-5.0.208-1.el8_4.rocky.0.x86_64
  dotnet-targeting-pack-5.0-5.0.11-1.el8_4.rocky.0.x86_64
  dotnet-templates-5.0-5.0.208-1.el8_4.rocky.0.x86_64
  lttng-ust-2.8.1-11.el8.x86_64
  netstandard-targeting-pack-2.1-5.0.208-1.el8_4.rocky.0.x86_64

2.バージョンの確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[root@localhost ~]# dotnet --version
5.0.208
[root@localhost ~]# dotnet --version 5.0.208
[root@localhost ~]# dotnet --version
5.0.208

3.動作確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[root@localhost ~]# dotnet new console -o helloworld
.NET 5.0 へようこそ!
---------------------
SDK バージョン: 5.0.208
----------------
ASP.NET Core の HTTPS 開発証明書をインストールしました。
証明書を信頼するには、'dotnet dev-certs https --trust' (Windows および macOS の み) を実行します。
HTTPS の詳細については、https://aka.ms/dotnet-https を参照してください
----------------
最初のアプリを作成するには、https://aka.ms/dotnet-hello-world を参照してください
最新情報については、https://aka.ms/dotnet-whats-new を参照してください
ドキュメントを探索するには、https://aka.ms/dotnet-docs を参照してください
GitHub で問題の報告とソースの検索を行うには、https://github.com/dotnet/core を参照してください
'dotnet --help' を使用して使用可能なコマンドを確認するか、https://aka.ms/dotnet-cli にアクセスしてください
--------------------------------------------------------------------------------------
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on helloworld/helloworld.csproj...
Determining projects to restore...
Restored /root/helloworld/helloworld.csproj (in 167 ms).
Restore succeeded.
[root@localhost ~]# cd helloworld
[root@localhost helloworld]# dotnet run
Hello World!
[root@localhost ~]# dotnet new console -o helloworld .NET 5.0 へようこそ! --------------------- SDK バージョン: 5.0.208 ---------------- ASP.NET Core の HTTPS 開発証明書をインストールしました。 証明書を信頼するには、'dotnet dev-certs https --trust' (Windows および macOS の み) を実行します。 HTTPS の詳細については、https://aka.ms/dotnet-https を参照してください ---------------- 最初のアプリを作成するには、https://aka.ms/dotnet-hello-world を参照してください 最新情報については、https://aka.ms/dotnet-whats-new を参照してください ドキュメントを探索するには、https://aka.ms/dotnet-docs を参照してください GitHub で問題の報告とソースの検索を行うには、https://github.com/dotnet/core を参照してください 'dotnet --help' を使用して使用可能なコマンドを確認するか、https://aka.ms/dotnet-cli にアクセスしてください -------------------------------------------------------------------------------------- Getting ready... The template "Console Application" was created successfully. Processing post-creation actions... Running 'dotnet restore' on helloworld/helloworld.csproj... Determining projects to restore... Restored /root/helloworld/helloworld.csproj (in 167 ms). Restore succeeded. [root@localhost ~]# cd helloworld [root@localhost helloworld]# dotnet run Hello World!
[root@localhost ~]# dotnet new console -o helloworld

.NET 5.0 へようこそ!
---------------------
SDK バージョン: 5.0.208

----------------
ASP.NET Core の HTTPS 開発証明書をインストールしました。
証明書を信頼するには、'dotnet dev-certs https --trust' (Windows および macOS の み) を実行します。
HTTPS の詳細については、https://aka.ms/dotnet-https を参照してください
----------------
最初のアプリを作成するには、https://aka.ms/dotnet-hello-world を参照してください
最新情報については、https://aka.ms/dotnet-whats-new を参照してください
ドキュメントを探索するには、https://aka.ms/dotnet-docs を参照してください
GitHub で問題の報告とソースの検索を行うには、https://github.com/dotnet/core を参照してください
'dotnet --help' を使用して使用可能なコマンドを確認するか、https://aka.ms/dotnet-cli にアクセスしてください
--------------------------------------------------------------------------------------
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on helloworld/helloworld.csproj...
  Determining projects to restore...
  Restored /root/helloworld/helloworld.csproj (in 167 ms).
Restore succeeded.

[root@localhost ~]# cd helloworld
[root@localhost helloworld]# dotnet run
Hello World!

 

Rocky Linux 8

Posted by arkgame