Debian: How to fix the warning “Duplicate sources.list” while running “apt-get update”

Hi there guys,

just to share an easy fix for the following situation:

Imagine that you want to execute APT to obtain the packages lists from the sources you specified (“/etc/apt/sources.list”), for that you would run:

sudo apt-get update

After executing the above command you got the following warning:

W: Duplicate sources.list entry stable/main amd64 Packages (/var/lib/apt/lists/
W: Duplicate sources.list entry stable/main i386 Packages (/var/lib/apt/lists/
W: You may want to run apt-get update to correct these problems

This means that there are duplicate entries on your sources list (“/etc/apt/sources.list”). In my case per the above warning I can see that there are duplicate entries for Google Chrome but this can happen on all kinds of software package lists.

To find out where they are run the following command (single line):

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


I did a recursive search for “chrome” on all files with the extension “.list” under each directory of “/etc/apt” and I got the following duplicates on the output:

/etc/apt/sources.list.d/google-chrome.list:deb stable main

/etc/apt/sources.list:deb stable main


Based on the above output I have duplicate entries for chrome on “/etc/apt/souces.list” and “/etc/apt/sources.list.d/google-chrome.list”, the last one has been automatically created during Chrome installation.

The “/etc/apt/sources.list.d” directory provides a way to add sources.list entries in separate files, I don’t want separate files to manage my sources and I prefer to manage all sources on a single file (“/etc/apt/souces.list”), so I will comment ( # ) the entry on “google-chrome.list”:

sudo nano /etc/apt/sources.list.d/google-chrome.list

Comment ( # ) the entry:

# stable main

Press [CONTROL]+[X] to exit and save the file.



Now rerun the “apt-get update” and everything should be ok.



That’s all folks.


R-Tape Loading error,
Luís Rato


~ por Luis Rato em 5 de Janeiro de 2014.

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da

Está a comentar usando a sua conta Terminar Sessão / Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão / Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão / Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão / Alterar )

Connecting to %s

%d bloggers like this: