0

When I try to make a simple Unit Test project with the following command (inside a project folder called test):

dotnet new xunit

It fails and this is the output I get:

/usr/share/dotnet/sdk/5.0.301/NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/user/Desktop/test/test.csproj]
/usr/share/dotnet/sdk/5.0.301/NuGet.targets(131,5): error :   The SSL connection could not be established, see inner exception. [/home/user/Desktop/test/test.csproj]
/usr/share/dotnet/sdk/5.0.301/NuGet.targets(131,5): error :   The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [/home/user/Desktop/test/test.csproj]

It also tells me to manually restore NuGet packages using dotnet restore which yields the same error messages as before. Thus I did some research to see what this is all about and how to fix it and there was an official article by Microsoft addressing the issue. In the article they mention how it got fixed in the SDK version that was released just prior to mine, so it should've still been the case given that I have the newer version. But just in case I also installed the previous version and the .NET 3.1 version of the SDK and runtime but got the same error messages as before.

Doing some further research I saw people suggesting that I update my ca-certificates which I did using:

update-ca-certificates (--fresh)

Which once again did not help. But there was a discussion about this issue here and how to resolve it on Debian. So I was wondering can the same fix be used on Ubuntu? And how do I update the package to use the newest version?

That's what I've tried thus far, but none of it had worked.

muru
  • 197,895
  • 55
  • 485
  • 740
  • Only Ubuntu and official flavors of Ubuntu (https://ubuntu.com/download/flavours) are on-topic here, refer to https://askubuntu.com/help/on-topic where you'll find other SE sites where you question will be welcome if you don't want to use a Mint forum. (One advantage of Ubuntu is it's many support options, you opted for Mint so take advantage of it's support options, or SE Unix & Linux) – guiverc Jun 29 '21 at 07:51
  • Right, but the same issue exists on the normal Ubuntu 20.04 as is stated in the article I've provided. So the fix would be the same. –  Jun 29 '21 at 07:54
  • @adadaae12313412
    1. Install the latest ca-certificates from here http://deb.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_20210119_all.deb
    2. Follow the first and second answers of this question: https://askubuntu.com/questions/645818/how-to-install-certificates-for-command-line
    – Muizz Mahdy Jun 30 '21 at 15:59

0 Answers0