Duplicate sources.list entry Warning after apt-get update

Today I got a duplicate sources.list entry warning when update local package index using apt-get update. As you can see from the screenshot below, I was notified that they are two entries for Google Chrome.

Duplicate sources.list entry Warning after apt-get update

I looked at /etc/apt/sources.list file and I only saw one entry for Google Chrome in this file.

#Google Chrome
deb http://dl.google.com/linux/chrome/deb/ stable main

So why apt-get said duplicate souces.list entry?

Many users are not aware that they can define software sources under /etc/apt/sources.list.d/ directory. As a matter of fact, when you add PPAs on Ubuntu, there will a new source list file for each PPA under this directory. And some programs can automatically configure a source list file under /etc/apt/sources.list.d/ directory. Google Chrome for example automatically generate a google-chrome.list file under /etc/apt/sources.list.d/ directory.

So if you followed the method metioned in this post to install Google Chrome on Debian, then in addition to the following entry you added in /etc/apt/sources.list file.

deb http://dl.google.com/linux/chrome/deb/ stable main

You will have another source list file under /etc/apt/sources.list.d/ directory. Let’s take a look with this command:

cat /etc/apt/sources.list.d/google-chrome.list

source list file

As you can see, this file is automatically configured. So that’s the problem. There’s another entry in this file.

To get rid of the duplicate sources.list entry warning, you can either comment out the entry in /etc/apt/sources.list file or comment out the entry in /etc/apt/sources.list.d/google-chrome.list file.

Another way to see duplicate entry is to use this command:

 grep -R --include="*.list" chrome /etc/apt/

Duplicate sources.list entry

The duplicate sources.list entry warning should be gone by following the above method.

Rate this tutorial
[Total: 0 Average: 0]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here