dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.59k stars 1.03k forks source link

[NETE2ESDK][Azure Linux 3.0] Installing .NET 9 Preview SDK in Azure Linux X64 3.0 Preview should not depend on package netstandard-targeting-pack-2.1 #41898

Closed ChenhuiYuan01 closed 2 days ago

ChenhuiYuan01 commented 3 days ago

Repro steps:

  1. Prepare Azure Linux X64 3.0 Preview in Dokcer via running sudo docker run -it -v ~/tmp:/root/workspace azurelinuxpreview.azurecr.io/public/azurelinux/base/core:3.0 sh
  2. Try to install 9.0.100-preview.6.24328.19 SDK via installer *.cm.2-x64.rpm

Expected: SDK installed successfully.

Actual result: SDK install failed as depending on package netstandard-targeting-pack-2.1 Screenshot 2024-07-02 165536

Note:

  1. This SDK could be installed successfully in Azure Linux Arm64 3.0 Preview image

    1. This SDK could be installed successfully in Mariner 2 X64 2.0. image
leecow commented 2 days ago

azurelinuxpreview.azurecr.io/public/azurelinux/base/core:3.0 does not include feed registration for (ms-oss)[https://packages.microsoft.com/azurelinux/3.0/preview/ms-oss/x86_64/Packages/] packages. Running ls etc/yum.repos.d/ only shows azurelinux-ms-non-oss-preview.repo azurelinux-official-preview.repo. The easiest thing to do is copy the non-oss repo definition and update it to include the oss repo.

First install nano: tdnf install -y nano

cd /etc/yum.repos.d
cp azurelinux-ms-non-oss-preview.repo azurelinux-ms-oss-preview.repo
nano azurelinux-ms-oss-preview.repo

Update all references from 'non-oss' to 'oss'. Save the file and should be good to go. Should look like this ...

root [ /etc/yum.repos.d ]# cat azurelinux-ms-oss-preview.repo
[azurelinux-official-ms-oss-preview]
name=Azure Linux Official Microsoft Open-Source Preview $releasever $basearch
baseurl=https://packages.microsoft.com/azurelinux/$releasever/preview/ms-oss/$basearch
gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY file:///etc/pki/rpm-gpg/MICROSOFT-METADATA-GPG-KEY
gpgcheck=1
repo_gpgcheck=1
enabled=1
skip_if_unavailable=True
sslverify=1
NicoleWang001 commented 2 days ago

@leecow Thanks! This workaround works fine. image