I get "W: Duplicate sources.list entry" messages when using the ~$ sudo apt install
or ~$ sudo apt update
commands. These are caused by duplicate sources listed in /etc/apt/sources.list
and in the /etc/apt/sources.list.d/*.list
files.
Does anybody know of a CLI or GUI utility that makes it easier to clean up these duplicates? It is very tedious to open and close each file in sources.list.d/
looking for and fixing duplicate entries. Searches in AskUbuntu and on the web have so far produced nothing.
The utility
add-apt-repository
is aimed at adding or removing repositories into/etc/apt/sources.list
or/etc/apt/sources.list.d
. Besides, Ubuntu has a graphical tool, "Software and updates", that allows adding/removing a repository.The file
/etc/apt/sources.list
and the contents in/etc/apt/sources.list.d
may also be edited manually.