0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu 24.04 に .NET 6 と .NET 8 をインストールしてみた

Posted at

ある案件の開発環境は Ubuntu 22.04 LTS を使用しています。現在の開発環境から Ubuntu 24.04 LTS に乗り換えたく環境整備をしていましたが、単純に .NET 6 がインストールできなかったので、調べてインストールできるようにしてみました。

OS 情報確認

bash
$ cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="Ubuntu 24.04 LTS"

.NET 6 がインストールできない状態

bash
$ sudo apt-get install -y dotnet-sdk-6.0 dotnet-sdk-8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package dotnet-sdk-6.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'dotnet-sdk-6.0' has no installation candidate

Ubuntu の .NET バックポートリポジトリを登録

bash
$ sudo add-apt-repository ppa:dotnet/backports

Microsoft パッケージリポジトリを登録

bash
$ source /etc/os-release

$ wget https://packages.microsoft.com/config/$ID/$VERSION_ID/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

$ sudo dpkg -i packages-microsoft-prod.deb

$ rm packages-microsoft-prod.deb

$ sudo apt update

.NET 6 と .NET 8 をインストール

bash
$ sudo apt-get install -y dotnet-sdk-6.0 dotnet-sdk-8.0

.NET SDK を確認

bash
$ dotnet --list-sdks
6.0.133 [/usr/lib/dotnet/sdk]
8.0.108 [/usr/lib/dotnet/sdk]

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?