sources.list got corrupted and I can't edit it in text editor

Asked by Pabs

Hello. I'm using Ubuntu 8.04 and tried installing KDEnLive through the terminal from this site:

[link]http://linuxcrypt.net/?p=179[/link]

I got until No. 5 of the process. When I tried No. 6, the cursor in the terminal just went to the next line and nothing happened.

Now, I can't open the synaptic package as well as the Add/Remove feature.

It says the ff on the Add/Remove button:

This is a major failure of your software management system. Please check for broken packages with synaptic, check the file permissions and correctness of the file '/etc/apt/sources.list' and reload the software information with: 'sudo apt-get update' and 'sudo apt-get install -f'.

When I run synaptic package, this appears:

E: Type 'dep' is not known on line 62 in source list /etc/apt/sources.list
E: The list of sources could not be read.
Go to the repository dialog to correct the problem.
E: _cache->open() failed, please report.

I realized that the terminal bites when you're careless. :(

Tried editing the sources.list file, but I cannot save the edited file. Says 'you do not have permission'.

I had about 5 reinstalls just to get this running on dual boot and I'd really appreciate restoring the file to its default without having to reinstall, though it's not that hard.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Pabs
Solved:
Last query:
Last reply:
Revision history for this message
collinp (collinp) said :
#1

Open a terminal, type in
"sudo gedit /etc/apt/sources.list"
Edit, save, done.

The reason why you cannot edit is because the file belongs to the superuser, root. You can do things as root by appending "sudo" to a command.

Revision history for this message
Pabs (olbap3) said :
#2

Great! Thanks. Saved me from having to reinstall. :) Great advice, Collin.