Some while ago I may have accidentally added an apt repository with an invalid URL. Now, every time I run sudo apt update, the following error message shows at the bottom:

E: The repository 'http://archive.canonical.com (lsb_release 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.

I've tried using sudo add-apt-repository --remove 'http://archive.canonical.com (lsb_release Release', after running the command there was no difference. How can I remove this url from my apt repository list?

Edit: The url http://archive.canonical.com (lsb_release Release is not found in my /etc/apt/sources.list

The following gist contains both the contents of /etc/apt/sources.list as well as the output of sudo apt update https://gist.github.com/MrSiliconGuy/4ae2c649e5133f7edff012bfd6483d70

Edit: Turns out it was the line deb http://archive.canonical.com/ (lsb_release -sc) partner

You cannot have shell commands in your apt source file


The repositories are stored in a file located at /etc/apt/sources.list. You can edit that to suit your needs.

| improve this answer | |
  • 1
    Thanks for responding. However, I cannot find the faulty url (or any third-party repositories for that matter) in my sources.list file. Here are the contents of my /etc/apt/sources.list gist.github.com/MrSiliconGuy/4ae2c649e5133f7edff012bfd6483d70 – thesilican Apr 29 at 18:39
  • 3
    Look on line 52 of your sources.list. You cannot use shell commands in this file. "(lsb_release -sc)" is an attempt to put a shell command in the file. – user535733 Apr 29 at 18:52
  • Replace (lsb_release -sc) in the file by output of command lsb_release -sc. – jarno Apr 29 at 19:05
  1. Open a terminal

  2. Edit the sources.list file.

  3. Save your changes.

Here's an example using the terminal-based nano text editor:

  1. Open a terminal

  2. sudo nano /etc/apt/sources.list

    • sudo because the file is owned by root (not you)
    • nano is the name of the application (text editor)
    • /etc/apt/sources.list is the complete path and filename
  3. Use your arrow keys to move around the editor. Use your delete or backspace keys to delete the bad line.

  4. Use CTRL+O to save your changes.

  5. Use CTRL +X to exit the editor and return to a command prompt.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.