Fixed: Updating from such a repository can't be done securely

In this article, we cover how to fix an error: “Updating from such a repository can’t be done securely, and is therefore disabled by default.” The error mainly crops up when we try to update the repository. We update the repository to ensure that we get to install the latest version of the package.

The command we issue to update the repository is:

# apt update

What happened here?

The error itself shows that we can’t update the repository securely and it was disabled by our Linux distribution.

Note: Following operations require administrative privileges. In case you don’t have one then we advise you to contact your System Administrator for assistance.

How to resolve the issue

Though there are multiple ways to deal with when such an issue arises. Two methods we cover here.

Method I. The best way to deal with the issue is, just to disable the repository. Why do we advise so? The repository could be outdated and managing packages through the repository could be no longer supported. And, therefore would pose security issues. In the meantime, try and find alternatives that can help us get the required package updates.

We can disable the repository through /etc/apt/sources.list file. Use a text editor like Nano to edit the sources.list file.

# nano /etc/apt/sources.list

And, put a # in front of the repository entry. This would make the package manager ignore the repository while considering the updates.

Method II. One of the issues could be due to the unsigned repository. Therefore use the following option with the repository entry:

[trusted=yes]

Not the repository should be:

deb [trusted=yes] <repository-entry>

This should pretty much resolve the issue unless the repository itself is not maintained anymore.

In conclusion, we have covered how to fix an error: “Updating from such a repository can’t be done securely, and is therefore disabled by default.” here.

Similar Posts