APT sources.list corrupted
Hello,
I've only been using Xubuntu for a couple of weeks now, so I apologise if I'm not I'm having some problems opening the 'Add/Remove' package and 'Synaptic Package Manager'.
The error that comes up with is:
'E: Type ‘rm’ is not known on line 58 in source list /etc/apt/
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.
I've tried to type the command 'sudo apt-get -f install' as I've seen it in the other questions but the error that crops up is similiar to the above:
E: Type ‘rm’ is not known on line 58 in source list /etc/apt/
E: The list of sources could not be read.
Any help would be great!!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu apt Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- thgang
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Thanks for your question.
There is something wrong on line 58 of the file /etc/apt/
Probably something was inadvertently entered there. Edit the file with an editor of your choice, but make sure you start the editor with sudo.
If you like you can also paste the file here and we can tell you want to delete.
Thanks
Revision history for this message
|
#2 |
Hi Ralph,
Thanks for the reply.
To the best of my knowledge, I have not touched this file but I guess thats technology for you. I'm afraid I do not know how to edit the file and what editor to use, could you please elaborate on this and tell me how I can get to the file.
Thankyou
Revision history for this message
|
#3 |
an easy text editor to use is gedit. /etc/apt/
gksudo gedit /etc/apt/
Inspect the file, all lines should resemble something like
deb http://
deb-src http://
(these are from my sources.list)
Lines are off the form type of repository (deb OR deb-src (source)), URL, list of sections
Lines beginning with a # are comments.
Comment out line 58 and any other erratic lines.
Matt
Revision history for this message
|
#4 |
The text editor does not work, I've tried it several times. Is there any other way to get to the file.
Revision history for this message
|
#5 |
try to use
sudo nano /etc/apt/
Revision history for this message
|
#6 |
Yes, I've found the file. It seems very complicated, and I do not know which part to copy. I can see the comments at the start but after this, it becomes a blurb of coding which I don't know whether it is important or not.
Revision history for this message
|
#7 |
Paste it all. You can also use pastebin (http://
Revision history for this message
|
#8 |
I hope I've done this right!!
# See http://
# newer versions of the distribution.
deb http://
deb-src http://
## Major bug fix updates produced after the final release of the
## distribution.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://
deb-src http://
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://
# deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
#AUTOMATIX REPOS START
deb http://
deb http://
deb http://
deb http://
deb http://
deb http://
rm #we dont need it anymore, so conserve disk space
#
Revision history for this message
|
#9 |
Remove these lines:
rm #we dont need it anymore, so conserve disk space
#
I take the occasion to remind you that automatix is not supported by ubuntu.
Unfortunately it causes corruptions and may hinder updates/upgrades.
Revision history for this message
|
#10 |
Sorry, but I'm having some trouble removing the lines permanently. Could you just explain this.
Revision history for this message
|
#11 |
Open the file with
sudo nano /etc/apt/
Go down to the lines to be deleted. Delete them, save and exit with ctrl-x
Revision history for this message
|
#12 |
As Ralph told you, use:
sudo nano /etc/apt/
Make the changes.
Press CTRL-X, when asked to "Save modified buffer?" answer Y
Use the same file name (/etc/apt/
If asked to confirm the overwrite answer Y
Revision history for this message
|
#13 |
I made the changes and saved it. I tried to see if it worked by running the 'Add/Remove' Package, but it didn't work.
I restarted my PC, to see whether the changes would take effect, but no such luck.
Revision history for this message
|
#14 |
Do you mean you see the same error or is there a new one?
If you still see the same error then the file was either not edited or not save correctly. In this case paste it here again.
Revision history for this message
|
#15 |
Yes actually, it's a new one, the error showing up is:
E: Line 1 too long in source list /etc/apt/
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.
The /etc/apt/
OBOB# See http://
# newer versions of the distribution.
deb http://
deb-src http://
## Major bug fix updates produced after the final release of the
## distribution.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://
deb-src http://
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://
# deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
#AUTOMATIX REPOS START
deb http://
deb http://
deb http://
deb http://
deb http://
deb http://
Revision history for this message
|
#16 |
Yes, when you edited the file you have inserted these characters on the first line:
OBOB
Just delete them, check that there is no other mistake, and you should be ready to go.
Revision history for this message
|
#17 |
No, it still isn't working. I deleted that as well as checking I didn't make any other mistakes.
Revision history for this message
|
#18 |
Just telling us isn't working or I still have a problem is not helping.
Tell us what kind of error message you are getting, if any.
Revision history for this message
|
#19 |
Sorry for being vague. Basically, it still gives the same error code after I made the first set of changes. The error code is:
E: Line 1 too long in source list /etc/apt/
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.
Thanks
Revision history for this message
|
#20 |
Just delete the first couple of lines. They don't do anything anyway (everything starting with # is a comment)
Revision history for this message
|
#21 |
Then, again, the file is corrupted. If you open it you will see that the first line will not be ok.
Lets do it the other way around.
Copy the text here below (do NOT include the --- CUT HERE --- lines) and paste it in a new file (call it foo):
--- CUT HERE ---
# See http://
# newer versions of the distribution.
deb http://
deb-src http://
## Major bug fix updates produced after the final release of the
## distribution.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://
deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://
deb-src http://
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://
# deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
deb http://
deb-src http://
--- CUT HERE ---
Save the file. Check that the file content is equal to the text above (do it with a cat foo command).
If you are happy give this command: sudo mv -f foo /etc/apt/
Check again that /etc/apt/
sudo apt-get update
If you get an error check again the file and come back to me with the error.
Revision history for this message
|
#22 |
Ok, I'm a beginner, so don't know how to create the file, do I paste it into mousepad?, could you elaborate on this please. Sorry about this!!
Revision history for this message
|
#23 |
Don't be sorry.
Lets do it simpler. Open the file with the command:
sudo mousepad /etc/apt/
delete everything in that file. Killl them all, shred them to pieces (I don't know mousepad, so I don't know how exactly you would do it, try selecting all and then deleting with the DEL key).
Now copy the text I've given you and paste it in mousepad. Check everything is ok, save it.
Check again with a cat /etc/apt/
Revision history for this message
|
#24 |
I've done exactly what you said, I ran the command '/etc/apt/
E: Line 1 too long in source list /etc/apt/
Revision history for this message
|
#25 |
I'm afraid then that there is nothing we can do any further for you.
Unfortunately I believe that installing automatix broke your system, the only thing I can suggest you is to remove automatix:
sudo apt-get remove --purge automatix
I would encourage you to be careful in installing non-ubuntu packages in the future.
Revision history for this message
|
#26 |
I realise that automatix is a problem, and i will remove it as soon as possible, but at the moment I cannot remove or install anything because of the sorces.list.
The error message that is showing (whether I'm running the command to remove automatix 'sudo apt-get remove --purge automatix' or running the 'Add/Remove' application) is:
E: Line 1 too long in source list /etc/apt/
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.
Revision history for this message
|
#27 |
Is it the same if you give this command:
sudo dpkg -r --purge automatix
or even
dpkg -r --purge --force-all automatix
?
Revision history for this message
|
#28 |
Let's try something else. First make a copy of your sources.list:
sudo mv /etc/apt/
Then this command should repair your source list. Copy paste it in a terminal (all in one block without modifying anything). It will prompt you for your password. You can run it several times if not sure about what happened:
cat << EOF | sudo tee /etc/apt/
deb http://
deb http://
deb http://
EOF
Then to try to repair dpkg database, please run:
sudo apt-get update
sudo apt-get -f install
sudo apt-get --purge remove automatix
Hope this helps ! Let us know !
Marc
Revision history for this message
|
#29 |
Hi Marc,
Marc, you are my knight in shining armour. Thankyou very much, I have tried so hard to get this fixed and everybody that has replied (especially Cesare Tirabissi) have been very helpful.
Everything works fine now, and I know that I won't be installing Automatix or other software which might be dangerous again!!!
Thanks Again,
Andy
Revision history for this message
|
#31 |
thanks allot marc : ) had similair problem
Revision history for this message
|
#32 |
Hello I think you have solved my problem
Th alot
Revision history for this message
|
#33 |
Thanks alot guys your solution helped my problem as well. Though I could not undertand what it did,. but it worked . I did this :-
sudo mv /etc/apt/
Then this command should repair your source list. Copy paste it in a terminal (all in one block without modifying anything). It will prompt you for your password. You can run it several times if not sure about what happened:
cat << EOF | sudo tee /etc/apt/
deb http://
deb http://
deb http://
EOF
Then to try to repair dpkg database, please run:
sudo apt-get update
sudo apt-get -f install
sudo apt-get --purge remove automatix
thanks alot guys
Revision history for this message
|
#34 |
If the error is "no MPM package installed" when you restart your apache or type '' is not known on line 1 in /etc/apt/