How to fix N: Updating from such a repository can't be done securely, and is therefore disabled by default in APT

APTBEGINNERMEDIUMUpdated Sep 28, 2026ยท 379 views

This APT error occurs when the package manager detects that a repository lacks proper security credentials (GPG signatures or Release files). APT disables the repository by default to prevent installing unsigned or unverified packages, protecting your system from potentially compromised software.

Quick fix

Fixes N: Updating from such a repository can't be done securely, and is therefore disabled by default

sudo apt update
  1. Identify the problematic repository
  2. Remove the problematic repository (recommended)
  3. Or mark the repository as trusted (if you need to keep it)
  4. Import the GPG key for the repository (advanced)
apt โ€” error
sudo apt update
N: Updating from such a repository can't be done securely, and is therefore disabled by default

What this error means

When you add a repository to your system, APT requires it to have cryptographic signatures that verify the authenticity and integrity of packages. This error means APT found a repository without proper signatures or without a valid Release file that confirms the repository is trustworthy. APT prevents you from updating from this source to avoid installing potentially malicious or compromised packages. This is a security-first approach to protect your Linux system.

Typical symptoms

  • apt update command fails when checking specific PPA repositories
  • Error message lists a specific repository URL that is considered insecure
  • apt-get install and apt upgrade commands fail when that repository is enabled
  • Repository was recently added or the repository server configuration changed

Common causes

  1. The repository does not have a valid Release file with GPG signatures
  2. The repository's GPG public key is missing or not installed on your system
  3. You added a PPA or third-party repository that uses HTTP instead of HTTPS
  4. The repository server configuration changed and no longer provides signatures
  5. The repository is deprecated or was discontinued by its maintainer
  6. Network issues prevent downloading the Release file or GPG key verification

How to fix "N: Updating from such a repository can't be done securely, and is therefore disabled by default"

1Identify the problematic repository

Run the following command to see which repository is causing the issue:

bash
sudo apt update

Look for the error message which will show the repository URL. For example:

bash
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.

Note the repository URL mentioned in the output.

2Remove the problematic repository (recommended)

The safest approach is to remove the repository entirely if you don't need it. First, list the contents of the sources directory:

bash
ls -la /etc/apt/sources.list.d/

Find the file containing the problematic repository and remove it:

bash
sudo rm /etc/apt/sources.list.d/repository-name.list

For example, if the problematic repository is in a file called example.list:

bash
sudo rm /etc/apt/sources.list.d/example.list

Then run sudo apt update again to verify the error is gone.

3Or mark the repository as trusted (if you need to keep it)

If you need to keep the repository, you can mark it as trusted by editing its configuration. Edit the file in /etc/apt/sources.list.d/ or /etc/apt/sources.list:

bash
sudo nano /etc/apt/sources.list

Find the problematic repository line (starting with deb) and add [trusted=yes] after deb. For example, change:

bash
deb http://ppa.launchpad.net/example/ppa/ubuntu focal main

To:

bash
deb [trusted=yes] http://ppa.launchpad.net/example/ppa/ubuntu focal main

Save the file (Ctrl+O, Enter, Ctrl+X in nano) and run:

bash
sudo apt update

WARNING: Only use [trusted=yes] for repositories you trust. This bypasses GPG signature verification.

4Import the GPG key for the repository (advanced)

If the repository is legitimate, the repository maintainer should provide a GPG key. Once you have the key URL, import it:

bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY_ID

Or import from a URL:

bash
wget -qO - https://example.com/KEY.gpg | sudo apt-key add -

After importing the key, run:

bash
sudo apt update

The repository should now work without the security warning.

Advanced notes

This error represents APT's secure-by-default behavior introduced to prevent package tampering attacks. Unsigned repositories are disabled to protect against man-in-the-middle (MITM) attacks where an attacker could intercept package downloads and replace them with malicious versions. On Ubuntu/Debian systems with apt version 2.1+, this behavior is stricter. If you're using a legitimate but unsigned repository, prefer option 3 (removing it entirely) or working with the maintainer to add GPG signatures. Using [trusted=yes] should only be done for repositories you have verified are legitimate. For custom or internal repositories, generate your own GPG keypair and sign your packages properly.

Frequently asked questions

What does "N: Updating from such a repository can't be done securely, and is ther" mean?
When you add a repository to your system, APT requires it to have cryptographic signatures that verify the authenticity and integrity of packages. This error means APT found a repository without proper signatures or without a valid Release file that confirms the repository is trustworthy. APT prevents you from updating from this source to avoid installing potentially malicious or compromised packages.
How do I fix "N: Updating from such a repository can't be done securely, and is ther"?
This APT error occurs when the package manager detects that a repository lacks proper security credentials (GPG signatures or Release files). APT disables the repository by default to prevent installing unsigned or unverified packages, protecting your system from potentially compromised software.
What causes "N: Updating from such a repository can't be done securely, and is ther"?
The repository does not have a valid Release file with GPG signatures The repository's GPG public key is missing or not installed on your system You added a PPA or third-party repository that uses HTTP instead of HTTPS
Is the "N: Updating from such a repository can't be done securely, and is ther" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading