実現したいこと
.NET SDK をインストールすること
発生している問題・分からないこと
Microsot公式の情報をもとに、インストールしようとしましたが、
依存関係が解決できないので、インストールに失敗してしまいます。
[実行したコマンド]
(base) dic1980@dic1980-FMVU14003:~/code/code-C#/C# sample project/MyMauiApp_2025_07_18_test$ sudo add-apt-repository ppa:dotnet/backports
[返答]
PPA publishes dbgsym, you may need to include 'main/debug' component
リポジトリ: 'Types: deb
URIs: https://ppa.launchpadcontent.net/dotnet/backports/ubuntu/
Suites: noble
Components: main
'
概要:
The backports archive provides source-built .NET packages in cases where a version of .NET is not available in the archive for an Ubuntu release.
Currently available Ubuntu releases and .NET backports:
Ubuntu 24.04 LTS (Noble Numbat)
├── .NET 6.0 (End of Life on November 12th, 2024) [amd64 arm64]
├── .NET 7.0 (End of Life on May 14th, 2024) [amd64 arm64]
└── .NET 9.0 (End of Life on May 11th, 2026) [amd64 arm64 s390x ppc64el]
Ubuntu 22.04 LTS (Jammy Jellyfish)
└── .NET 9.0 (End of Life on May 11th, 2026) [amd64 arm64 s390x ppc64el]
Canonical provides best-effort support for packages contained in this archive, which is limited to the upstream lifespan or the support period of the particular Ubuntu version. See the upstream support policy [1] for more information about the upstream support lifespan of .NET releases or the Ubuntu Releases Wiki entry [2] for more information about the support period of any Ubuntu version.
[1] https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
[2] https://wiki.ubuntu.com/Releases
より詳しい情報: https://launchpad.net/~dotnet/+archive/ubuntu/backports
リポジトリを追加しています。
続けるには「Enter」キーを、中止するにはCtrl-cを押してください。
すでにdebは/etc/apt/sources.list.d/dotnet-ubuntu-backports-noble.sourcesにあります
ヒット:1 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
ヒット:2 https://dl.google.com/linux/chrome/deb stable InRelease
ヒット:3 https://packages.microsoft.com/repos/code stable InRelease
ヒット:4 http://security.ubuntu.com/ubuntu noble-security InRelease
ヒット:5 http://jp.archive.ubuntu.com/ubuntu noble InRelease
ヒット:6 http://jp.archive.ubuntu.com/ubuntu noble-updates InRelease
ヒット:7 http://jp.archive.ubuntu.com/ubuntu noble-backports InRelease
ヒット:8 https://ppa.launchpadcontent.net/dotnet/backports/ubuntu noble InRelease
パッケージリストを読み込んでいます... 完了
[実行したコマンド]
(base) dic1980@dic1980-FMVU14003:~/code/code-C#/C# sample project/MyMauiApp_2025_07_18_test$ sudo apt-get update &&
sudo apt-get install -y dotnet-sdk-9.0
[返答]
ヒット:1 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
ヒット:2 https://packages.microsoft.com/repos/code stable InRelease
ヒット:3 https://dl.google.com/linux/chrome/deb stable InRelease
ヒット:4 http://jp.archive.ubuntu.com/ubuntu noble InRelease
ヒット:5 http://security.ubuntu.com/ubuntu noble-security InRelease
ヒット:6 https://ppa.launchpadcontent.net/dotnet/backports/ubuntu noble InRelease
ヒット:7 http://jp.archive.ubuntu.com/ubuntu noble-updates InRelease
ヒット:8 http://jp.archive.ubuntu.com/ubuntu noble-backports InRelease
パッケージリストを読み込んでいます... 完了
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了
状態情報を読み取っています... 完了
インストールすることができないパッケージがありました。おそらく、あり得
ない状況を要求したか、(不安定版ディストリビューションを使用しているの
であれば) 必要なパッケージがまだ作成されていなかったり Incoming から移
動されていないことが考えられます。
以下の情報がこの問題を解決するために役立つかもしれません:
以下のパッケージには満たせない依存関係があります:
netstandard-targeting-pack-2.1-9.0 : 競合: netstandard-targeting-pack-2.1
E: エラー、pkgProblemResolver::Resolve は停止しました。おそらく変更禁止パッケージが原因です。
とでて、インストールに失敗します。
エラーメッセージ
error
1インストールすることができないパッケージがありました。おそらく、あり得 2ない状況を要求したか、(不安定版ディストリビューションを使用しているの 3であれば) 必要なパッケージがまだ作成されていなかったり Incoming から移 4動されていないことが考えられます。 5以下の情報がこの問題を解決するために役立つかもしれません: 6 7以下のパッケージには満たせない依存関係があります: 8 netstandard-targeting-pack-2.1-9.0 : 競合: netstandard-targeting-pack-2.1 9E: エラー、pkgProblemResolver::Resolve は停止しました。おそらく変更禁止パッケージが原因です。 10
該当のソースコード
特になし
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
AIに聞いたところ
-
依存関係の修正
sudo apt --fix-broken install -
不要なパッケージの削除
sudo apt remove --purge dotnet-sdk-* -
パッケージリストの更新
sudo apt update -
.NET SDKの再インストール
sudo apt install dotnet-sdk-9.0 -
依存関係の確認 以下すべて手動にて実行
sudo apt install libc6
sudo apt install libgcc-s1
sudo apt install libicu74
sudo apt install liblttng-ust1
sudo apt install libssl3
sudo apt install libstdc++6
sudo apt install zlib1g
と言われたので、すべて実行しましたが、dotnet build で失敗します。
(base) dic1980@dic1980-FMVU14003:~/code/code-C#/C# sample project/MyMauiApp_2025_07_18_test$ dotnet build
The command could not be loaded, possibly because:
- You intended to execute a .NET application:
The application 'build' does not exist. - You intended to execute a .NET SDK command:
No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet/download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
おそらく
以下のパッケージには満たせない依存関係があります:
netstandard-targeting-pack-2.1-9.0 : 競合: netstandard-targeting-pack-2.1
E: エラー、pkgProblemResolver::Resolve は停止しました。おそらく変更禁止パッケージが原因です。
の部分だと思うのですが、ubuntu は初心者なので、まったくわかりません。
どうすれば解決できるでしょうか?
補足
Ubuntu 24.04
インストールしようとしている .NET SDK 9
code のバージョン
(base) dic1980@dic1980-FMVU14003:~/code/code-C#/C# sample project/MyMauiApp_2025_07_18_test$ code -v
1.102.0
cb0c47c0cfaad0757385834bd89d410c78a856c0
x64

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2025/07/18 09:02
2025/07/18 10:51 編集