Nuget is not available on Ubuntu 24.04
Description
Currently Ubuntu is not present in the 24.04 Ubuntu deb repo's. Is there an alternative like using the 22.04 repo's?
Platforms affected
- [X] Azure DevOps
- [ ] GitHub Actions - Standard Runners
- [ ] GitHub Actions - Larger Runners
Runner images affected
- [ ] Ubuntu 20.04
- [ ] Ubuntu 22.04
- [X] Ubuntu 24.04
- [ ] macOS 12
- [ ] macOS 13
- [ ] macOS 13 Arm64
- [ ] macOS 14
- [ ] macOS 14 Arm64
- [ ] Windows Server 2019
- [ ] Windows Server 2022
Image version and build link
Custom image build
Is it regression?
Yes
Expected behavior
Nuget to be present
Actual behavior
Nuget is not present on ubuntu 24.04:
azure-arm.build_image: E: Package 'nuget' has no installation candidate
Repro steps
- Run the 24.04 packr install script.
- Investigate the build output
Thank you for bringing this issue to us. We are looking into this issue and will update you on this issue after investigating.
Hi @ThibaultLesuisse- For the above issue, I am providing you workaround step:-
You can use the 22.04 Repository (Workaround) If you still prefer to use the Ubuntu repositories, you can temporarily use the 22.04 repositories.
-
You can try adding the 22.04 repository to your sources list: sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" > /etc/apt/sources.list.d/jammy.list'
-
Also you can once try to Update and install NuGet by using below command.
sudo apt-get update sudo apt-get install nuget
Please Let me know if you need further assistance after trying above steps!
Won't this add 22.04 packages? This could have some consequences right?
Hi @ThibaultLesuisse - we will check on this and will update you shortly. Thanks!
Hi @ThibaultLesuisse - You can use ubuntu 22.04 as a workaround and log/create a 'feature request' to add Nuget to ubuntu 24.04 image.
Hi @ThibaultLesuisse - You can create a 'feature request' to add Nuget to ubuntu 24.04 image. Since we haven't heard back, we will close this issue for now. Feel free to reach out to us for any other queries. Thanks.
I tried this workaround because I need to pack a nuget package using a nuspec file which doesn't seem to be supported by DotNetCoreCLI@2 (https://github.com/microsoft/azure-pipelines-tasks/issues/20903)
This workaround resulted in the following error when using NuGetCommand@2
Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Also installing mono-complete resolved this:
sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" > /etc/apt/sources.list.d/jammy.list'
sudo apt-get update
sudo apt-get install mono-complete
sudo apt-get install nuget
Hopefully DotNetCoreCLI@2 will be updated or Nuget will be added to Ubuntu 24.04.
@Prabhatkumar59 & @sclarke81
Your solutions worked! Thank you for this