How to remove duplicate sources.list entry on Ubuntu. Remove and resolve duplicate sources list entry var lib apt lists error on Linux Ubuntu Systems. The duplicate sources.list entry error means that you’ve got the same source defined twice in the system’s apt sources.
This is a warning message not an error, so you shouldn’t panic at all. There are many methods to resolve this error. Let us know about them:
GUI Method
Ubuntu users can use Ubuntu Software Centre to remove duplicate sources.list entry on Ubuntu. This is the GUI method and easier one also. To do so, open Ubuntu Software Centre, click on Edit > Software Sources > Other Software Tab. Under the list search for the duplicate entry and simply remove it. The same task can be done via the following command:
cat /etc/apt/sources.list | perl -ne '$H{$_}++ or print' > /tmp/sources.list && sudo mv /tmp/sources.list /etc/apt/sources.list
Commadline Method
There are many command line ways to resolve the duplicate sources.list entry on Ubuntu:
Solution 1
grep -R --include="*.list" chrome /etc/apt/
Solution 2
sudo awk '!a[$0]++' /etc/apt/sources.list