Duplicate sources.list entry

Duplicate sources.list entry can be a pain to fix. It usually occurs while you are trying to install some new software and try to to install it by adding multiple sources and trying and trying. This fix is mainly fore Ubuntu 14.04 trusty version, but I will update it on every LTS version to come.

After a while you notice that you have successfully made complete mess out of your APT package management. And you start to get weird warnings or errors just like this one:

This tells us that there are sources lists that are duplicate or clones or each other and APT is doing a lot of work to figure out how to work this through.

Fix by reset

The easiest way to fix the problem is to reset the whole apt-get sources lists. Type in these commands to have the sources lists first deleted.

After you have deleted the old lists you can paste in a new one.

This is a default file for sources.lists, if you need more specific one  (for example you might need Google Chrome repositories), please use the following generator https://repogen.simplylinux.ch/.

After this run the following command to fetch new repository lists.

Now you should have the new correctly working lists on your Linux. Also all duplicate sources.list entries should be gone.