Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How do I fix this “E:Type ‘*’ is not known on line * in source list …” update error?

I type sudo sh -c 'echo "[some repository]" >> /etc/apt/sources.list, but, then I get this message:

bash: /etc/apt/sources.list: Permission denied` 

And it doesn't work.

And now, when I type sudo apt-get update or open the Update Manager, the system just shows me the error message:

E: Type '[some repository]' is not known on line 62 in source list /etc/apt/sources.list 
E: The list of sources could not be read.**

Or:

could not initialize the package information

How can I fix this?

share|improve this question
add comment

marked as duplicate by Eliah Kagan, Tom Brossman, Chris Wilson, fossfreedom Jan 31 '13 at 13:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Your problem is not bad so do not worry, simply do the following:

  1. Remove the file sources.list
    sudo rm -fr /etc/apt/sources.list

  2. Run the update process. It will create the file again
    sudo apt-get update

Now, if you really want to know what is wrong or why it happened then do the following:

sudo nano +62 /etc/apt/sources.list

This will take you to the line with the problem and should give you an idea of why it is failing if compared to other lines. In most cases like this, I simply delete the file and then update to recreate it. Saves me time. But if I want to know what really happened, I do the last line first.

share|improve this answer
    
Thank you!!! the problem is fixed!!! –  詠政 黃 Jan 30 '13 at 7:48
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.