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

This question already has an answer here:

I am having problems with the software center and typing Sudo into the terminal. I am a very new user, I'm not sure what is wrong. ubuntu 12.04

when I type in something like

sudo apt-get install software-center

I get a return with this

E: Type 'sudo' is not known on line 57 in source list /etc/apt/sources.list
E: The list of sources could not be read.
E: Unable to locate package software-manager

same for

sudo apt=get update
E: Type 'sudo' is not known on line 57 in source list /etc/apt/sources.list
E: The list of sources could not be read.

this is very frustrating as I can not find anything exactly like this problem..

now on to my second problem.

when I click on the software center, it doesn't open. and then I get errors that ubuntu isn't working. and I now have a red circle with a line through it on the top right of my screen next to the mail icon.

aidan@Aidan-PC:~$ sudo rm -fr /etc/apt/sources.list
[sudo] password for aidan: 
aidan@Aidan-PC:~$ sudo rm -fr /etc/apt/sources.list
aidan@Aidan-PC:~$ sudo apt-get update
Hit http://ppa.launchpad.net precise Release.gpg 
Hit http://ppa.launchpad.net precise Release   
Hit http://ppa.launchpad.net precise/main Sources
Hit http://ppa.launchpad.net precise/main i386 Packages
Ign http://ppa.launchpad.net precise/main TranslationIndex
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Reading package lists... Done
aidan@Aidan-PC:~$ cat /etc/apt/sources.list
cat: /etc/apt/sources.list: No such file or directory

It didn't work. I think I deleted it, and now it won't let me make a new one.

share|improve this question

marked as duplicate by Florian Diesch, karel, Nathan Osman, Kevin Bowen, qbi Oct 9 '13 at 12:32

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.

@FlorianDiesch he doesn't have a malformed line in the sources.list... he don't have sources.list right now! –  Braiam Oct 6 '13 at 20:41
@Braiam: He had one before he deleted it. The first error message is from a malformed sources.list. –  Florian Diesch Oct 6 '13 at 20:47

2 Answers 2

You don't have sources.list file, so you must create it!

sudo sh -c "cat > /etc/apt/sources.list"

Press Enter, introduce your password. Now the command line will be waiting for you to paste the following:

deb http://archive.ubuntu.com/ubuntu precise main restricted
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-security main restricted
deb http://archive.ubuntu.com/ubuntu precise-security universe
deb http://archive.ubuntu.com/ubuntu precise-security multiverse

Now press Ctrl + D. Once the file is placed, run sudo apt-get update. Now you can install software again.

Another way is using add-apt-repositories:

sudo add-apt-repository "http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse"
sudo add-apt-repository "http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse"
sudo add-apt-repository "http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse"

E: Type 'sudo' is not known on line 57 in source list /etc/apt/sources.list

The problem originally was that in your sources.list you mixed some sudo word that messed up the file. You shouldn't edit the file by hand, and verify twice what each command will do.

sudo apt=get update

I don't know any binary called apt=get. Next time, copy and paste the commands exactly as you ran them.

sudo rm -fr /etc/apt/sources.list

Never do this. Under almost any circumstance, the sources.list file should be deleted.

Please, sudo + rm is equal to DANGER! Unless you are 130% sure about what you are doing, don't!

share|improve this answer
He had a corrupted sources.list file originally, he only deleted it based on the misguided advice in another answer here. –  Steven Kath Oct 6 '13 at 20:41
@StevenKath well, lets fix what other broke ;). –  Braiam Oct 6 '13 at 20:42
Thanks, I didn't know that cat could be used in that way to write a file while taking input from the terminal. –  minerz029 Oct 6 '13 at 20:59

It seems like a problem inside the sources.list file. Try making a new one:

Remove the exiting list:
sudo rm -fr /etc/apt/sources.list

Generate a new one:
sudo apt-get update

If you don't want to make a new sources.list but you want to fix the existing one, just provide us the contents of the file, by adding the output of this command to your question:
cat /etc/apt/sources.list
Anyway, I suggest you to just make a new sources.list file following the instructions I wrote before.

share|improve this answer
aidan@Aidan:~$ sudo rm -fr /etc/apt/sources.list aidan@Aidan:~$ sudo apt-get update Hit ppa.launchpad.net precise Release.gpg Hit ppa.launchpad.net precise Release Hit ppa.launchpad.net precise/main Sources Hit ppa.launchpad.net precise/main i386 Packages Ign ppa.launchpad.net precise/main TranslationIndex Ign ppa.launchpad.net precise/main Translation-en_US Ign ppa.launchpad.net precise/main Translation-en Reading package lists... Done aidan@Aidan:~$ cat /etc/apt/sources.list cat: /etc/apt/sources.list: No such file or directory –  aidanklenk Oct 6 '13 at 20:24
sorry! i'm not sure how to reply back... –  aidanklenk Oct 6 '13 at 20:24
Try making the file first and then run the sudo apt-get update. I'm editing my answer –  PeppeDAlterio Oct 6 '13 at 20:32
apt-get update don't generate the sources.list! –  Braiam Oct 6 '13 at 20:33
Deleting /etc/apt/sources.list is a really bad idea. Never do that unless you really know what you are doing! See Cannot find softwares installed via synaptic manager after accidentally deleting sources.list for hwo to get a new one. –  Florian Diesch Oct 6 '13 at 20:40

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