How to fix 'The repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod jammy Release' does not have a Release file.'

Bashar Muhanna 40 Reputation points
2023-06-12T11:43:28.54+00:00

I am trying to publish a .NET 5.0 Web API to an Ubuntu Server with a 22.04 version, and when I want to install the .NET 7.0 since the 5.0 is no longer supported running the below command

sudo apt-get update && \   sudo apt-get install -y dotnet-sdk-7.0

I get this error message

root@ubuntu-4gb-hel1-1:~# sudo apt-get update &&   sudo apt-get install -y dotnet-sdk-7.0 Hit:1 https://mirror.hetzner.com/ubuntu/packages jammy InRelease Hit:2 https://mirror.hetzner.com/ubuntu/packages jammy-updates InRelease Hit:3 https://mirror.hetzner.com/ubuntu/packages jammy-backports InRelease Ign:4 https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod jammy InRelease Hit:5 https://mirror.hetzner.com/ubuntu/security jammy-security InRelease Err:6 https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod jammy Release   404  Not Found [IP: 40.114.136.21 443] Reading package lists... Done E: The repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod jammy Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

And when I visit the repo link is show 404 error.

https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-06-13T03:00:41.85+00:00

    Hi @Bashar Muhanna

    And when I visit the repo link is show 404 error. https://packages.microsoft.com/repos/microsoft-ubuntu-22.04-prod

    The issue occurs when the Microsoft repository is not configured correctly for your Ubuntu release. As you said, when visit the above link, it will show the 404 error. The correct url should be as below:

    https://packages.microsoft.com/ubuntu/22.04/prod/

    More detail information, see Linux Software Repository for Microsoft Products and Install the .NET SDK or the .NET Runtime on Ubuntu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Dillion

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.