JP Vossen on 27 Jan 2009 00:46:09 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] W: Duplicate sources.list entry

Short: when t-shooting "Duplicate sources.list entry" errors make sure 
you consider /etc/apt/source.list.d in addition to /etc/apt/source.list. 
  See grep command below.


I was switching from approx to http-replicator on my Intrepid system, 
and I suddenly started getting this error:

Reading package lists... Done
W: Duplicate sources.list entry 
intrepid/free Packages 
W: Duplicate sources.list entry 
intrepid/non-free Packages 
W: You may want to run apt-get update to correct these problems

My reading of that matches up with everything I can find in Google, 
which says to remove the duplicate entry in /etc/apt/sources.list.  The 
only problem is that there is no duplicate:

	# grep -i medi sources.list
	deb  intrepid  free non-free

Since I was goofing with APT proxy servers I tried deleting local 
/var/lib/apt/lists/*medi* and the appropriate files on the proxy but 
that doesn't help.

I finally remembered to check /etc/apt/source.list.d, and there it was: 
medibuntu.list.  I'm not quite sure how that got there, since AFAICT 
it's not owned by any package and I don't remember putting it there. 
But I deleted it and now the error is gone.

	# grep -R '^deb' sources.list sources.list.d | grep 'medi'
	sources.list:deb       intrepid 
   free non-free
intrepid free non-free

The confusing thing was that I only got the error when using 
http-replicator; not when using approx or no proxy.  That happened 
because approx requires re-written sources.list files, so there was the 
sources.list.d.medibuntu.list version and the re-written one so they 
were different.  I don't know why I did not get the error when not using 
the apt.conf "Acquire::http::Proxy" line though.

As I just said approx requires re-written sources.list lines like:
	deb http://aptproxy:9999/medibuntu/ intrepid  free non-free

In my particular circumstances that's very annoying for the following 
reasons, and is why I am trying http-replicator:

1) You need to totally re-write your source.list, the stock one won't work.
2) You need to totally re-write your source.list when switching between 
your LAN (with your proxy) and elsewhere (no proxy).
3) You must define each "source" in approx.conf on the proxy itself, you 
can't just add it to sources.list on your client and have it work.
4) One implication of #3 is that you can't have duplicate sources, so 
you need to re-write even more stuff in source.list.  For example, you 
can't do this in the proxy's approx.conf:
5) Approx sort-of works as a regular proxy, so you can use 
"http://aptproxy:9999/"; as the proxy server while doing a 'Net install 
of Debian, but another implication of #3/4 is that it will then not be 
able to find security updates, which defeats some of the purpose of 
doing a 'Net install in the first place.

http-replicator not only Just Works and solves all of the above, but it 
can be used by RPM and probably even Windows Update (not tested). 
However, it isn't perfect either.

1) It looks like it may be abandoned upstream.
2) The .deb packages are seriously broken, and only install it about 
half-way.  There area a bunch of manual steps required to make it 
actually work after that (
3) Its idea of cleaning up after itself is to only keep the most recent 
version of a package.  That's a good start, but will eventually leave 1 
of each package you cached from old versions, as you upgrade.  As far as 
I can tell there is no time-based cleanup.

Once installed, the key to using it is to add a line like this to 
	Acquire::http::Proxy "http://aptproxy:9998";;
(I have/had approx on :9999, so http-replicator is on :9998.  Its 
default is actually 8080.)

Finally, I want to say that I like approx quite a bit, it's just that my 
needs are evolving away from the problems it solves, a bit.

Hopefully this will be useful to someone...
JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --