Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing net9.0 SDK on AWS Linux 2023 breaks net8.0 SDK and runtime #45440

Closed
jamesivie opened this issue Dec 12, 2024 · 5 comments
Closed
Labels
Area-Linux untriaged Request triage from a team member

Comments

@jamesivie
Copy link

Describe the bug

Using the standard installation process (dnf install -y dotnet-sdk-9.0) breaks net8.0 SDK and runtime on AWS Linux 2023 (and possibly other versions as well).

To Reproduce

Up until yesterday I was installing net8.0 on AWS Linux 2023 using the following bash script:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo
    sudo dnf install -y dotnet-sdk-8.0
    dotnet --list-sdks

net9.0 wouldn't install until I updated it to /fedora/38:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/38/prod.repo
    sudo dnf install -y dotnet-sdk-8.0
    dotnet --list-sdks
    sudo dnf install -y dotnet-sdk-9.0
    dotnet --list-sdks

However, running this process results in the second dotnet --list-sdks returning:

9.0.101 [/usr/share/dotnet/sdk]

and --list-runtimes shows:

Microsoft.AspNetCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

net8.0 is no longer available, and some operations that use net8.0 show errors indicating that it is not available.
 
Simply manually creating a symbolic link to net8.0 (whose files were still there) made the SDK show in --list-sdks, but not in --list-runtimes (another symbolic link may solve that as well?).

AWS Support came up with a process that seems to work, but it involves raw downloading, untarring, and environment variable setting, but a package-based installation is much-preferred.

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Linux untriaged Request triage from a team member labels Dec 12, 2024
@richlander
Copy link
Member

We don't publish .NET for Fedora anymore because it is available within Fedora repos. This policy is described at: dotnet/core#9556.

I'm not an expert on how to register Fedora feeds. Someone else can likely provide good instructions for that.

I used the script at amazonlinux/amazon-linux-2023#232 as a quick prototype.

This is the result:

bash-5.2# cat /etc/os-release | grep PRETTY
PRETTY_NAME="Amazon Linux 2023.4.20240416"
bash-5.2# dnf install dotnet-sdk-8.0 dotnet-sdk-9.0
bash-5.2# dotnet --list-sdks
8.0.111 [/usr/lib64/dotnet/sdk]
9.0.100 [/usr/lib64/dotnet/sdk]

@normj @leecow @omajid

@omajid
Copy link
Member

omajid commented Dec 13, 2024

The situation where installing .NET 9 makes .NET 8 disappear sounds like https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-redhat. Essentially, one set of packages is installed to /usr/lib64/dotnet, and the other is installed to /usr/share/dotnet and the two installations don't see each other.

I am not sure Fedora packages are compatible with AWS Linux either. They may work for now, but it's possible they will suddenly stop working.

To fix this properly in the long term, I see several options:

  • Use the non-package approach ( @jamesivie , you said this is not preferred, which is fair, but it's the only supported option at the moment)
  • Add .NET to AWS Linux itself. I don't know what the process for that looks like.
  • Add .NET to the official Microsoft AmazonLinux feed: https://packages.microsoft.com/amazonlinux/2023/prod/

@normj
Copy link
Contributor

normj commented Dec 13, 2024

I can repo that installing .NET 8 from the Amazon Linux repo puts it in /usr/lib64/dotnet and then installing .NET 9 from the Fedora repository puts in /usr/share/dotnet. I'm not sure on Amazon Linux timeframe for adding .NET 9 to its package repositories.

If you install both .NET 8 and 9 from the Microsoft Fedora feed I was able to get it to work. But because Amazon Linux doesn't have libicu installed by default and the Microsoft Fedora doesn't have you need to install libicu first from the Amazon Linux repository first. Here were my steps.

sudo dnf install -y libicu

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo

sudo dnf install -y --repo packages-microsoft-com-prod  dotnet-sdk-8.0
sudo dnf install -y --repo packages-microsoft-com-prod  dotnet-sdk-9.0

dotnet --list-sdks

@marcpopMSFT
Copy link
Member

Triage: It sounds like this came down to two installs ending up in different locations so closing for now as we are aware of feedback related to this experience.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2024
@phillip-haydon
Copy link

I can repo that installing .NET 8 from the Amazon Linux repo puts it in /usr/lib64/dotnet and then installing .NET 9 from the Fedora repository puts in /usr/share/dotnet. I'm not sure on Amazon Linux timeframe for adding .NET 9 to its package repositories.

If you install both .NET 8 and 9 from the Microsoft Fedora feed I was able to get it to work. But because Amazon Linux doesn't have libicu installed by default and the Microsoft Fedora doesn't have you need to install libicu first from the Amazon Linux repository first. Here were my steps.

sudo dnf install -y libicu

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo

sudo dnf install -y --repo packages-microsoft-com-prod  dotnet-sdk-8.0
sudo dnf install -y --repo packages-microsoft-com-prod  dotnet-sdk-9.0

dotnet --list-sdks

37 doesn't contain .NET 9.
38 does, but installing 9 removes 8...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Linux untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

6 participants