修正
https://learn.microsoft.com/ja-jp/dotnet/core/install/linux-rhel
にあるように、
# sudo dnf install dotnet-runtime-8.0
等とやれば一発だったようです。
概要
.NET 8 が、リリースされたので、Oracle Linux 8.3 というマイナーな Redhat 系 OS に、インストールしてみました。
下記のパッケージマネージャーを使わないインストール方法を参考にインストールしています。
手順
ほぼリンク先のままで恐縮ですが、まずインストールスクリプトをダウンロードします。
# wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
次に、パーミッションの変更をします。
# chmod 500 dotnet-install.sh
そして、インストールをします。
# ./dotnet-install.sh --version latest
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.417/dotnet-sdk-6.0.417-linux-x64.tar.gz
^C
普通だったら、これでいいんだと思いますが、ログの最後で、.NET 6 をダウンロードしそうだったのでとりあえず中断して、.NET 8 を指定して実行します。
# ./dotnet-install.sh --channel 8.0
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-linux-x64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-linux-x64.tar.gz size is 214395068 bytes.
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-linux-x64.tar.gz
dotnet-install: Downloaded file size is 214395068 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 8.0.100
dotnet-install: Adding to current process PATH: `/root/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
https://learn.microsoft.com/dotnet/core/install から、使っている OS の依存関係を調べなさいと書いてありますが、当然 Oracle Linux に関する記載はないので、CentOS のページを見ると、下記が必要とのこと。
- krb5-libs
- libicu
- openssl-libs
- zlib
とりあえず、下記でパッケージリストを確認。
# yum list installed > yumlist
# grep krb5-libs yumlist
krb5-libs.x86_64 1.18.2-5.el8 @anaconda
# grep libicu yumlist
libicu.x86_64 60.3-2.el8_1 @anaconda
# grep openssl-libs yumlist
openssl-libs.x86_64 1:1.1.1k-4.el8 @ol8_baseos_latest
# grep zlib yumlist
zlib.x86_64 1.2.11-16.el8_2 @anaconda
どれもインストールされていたので無事終了しましたが、/root/.dotnet
にインストールされました。
# ./dotnet-install.sh --help
(中略)
Install Location:
Location is chosen in following order:
- --install-dir option
- Environmental variable DOTNET_INSTALL_DIR
- /root/.dotnet
他のユーザーでも使えるようにしたかったので、再度インストール。
# ./dotnet-install.sh --channel 8.0 --install-dir /usr/lib64/dotnet
(中略)
# ln -s /usr/lib64/dotnet/dotnet /usr/bin/dotnet
これで、無事他のユーザーでも使えました。
$ dotnet --version
8.0.100
$ which dotnet
/usr/bin/dotnet