-   Linux - Newbie (
-   -   Cant add repositories after ubuntu upgrade? (

meniscus 07-06-2007 06:00 AM

Cant add repositories after ubuntu upgrade?
I upgraded from ubuntu dapper to feisty there yesterday and every time i try an add the universe and multiverse repositories i get the following.


E: Could not get lock /var/lib/apt/lists/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the list directory

I get a similar error via the command line when i type


sudo aptitude update
Any suggestions on what i might do to fix this?


b0uncer 07-06-2007 06:39 AM

First make sure you don't have any apt/synaptic/aptitude/etc. running. Then simply remove the 'lock' file and re-try. The file is there to prevent the usage of multiple instances of those apps at the same time; if it's there while the program isn't running, you can safely remove it.

meniscus 07-06-2007 08:43 AM

That did it! Thank you.

It gave me these errors..


W: Duplicate sources.list entry edgy/main Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_edgy_main_binary-i386_Packages)
W: Duplicate sources.list entry edgy/restricted Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_edgy_restricted_binary-i386_Packages)
W: Duplicate sources.list entry edgy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_edgy_universe_binary-i386_Packages)
W: Duplicate sources.list entry edgy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_edgy_multiverse_binary-i386_Packages)

Should i worry about them?

b0uncer 07-06-2007 08:51 AM

No, I don't think so. "Duplicate entry" simply means that those lines it showed are written at least two times in the reposity files; apt-get doesn't do anything with identical duplicate lines, so it warns you that there are unneeded lines there (which just take up space from the file).

If you don't want to see the error message all the time, you can simply go trough the reposity files and remove all duplicate lines.

If you want that easily done, you can do it with uniq. It's a tool to remove duplicate lines; command works like

uniq infile outfile
where uniq reads 'infile' trough, removes duplicate lines and puts the output to 'outfile'. So just feed the reposity files to uniq (one by one, unless you want to script) and copy the output over the input. Probably just as easy is if you open Synaptic, reposity configuration and scroll trough the content, removing duplicate lines if you happen to see any.

meniscus 07-06-2007 09:26 AM

Thanks very much. You've been a great help to me:-)

All times are GMT -5. The time now is 03:35 AM.