How to fix the sources list

Sometimes the apt-get may not work, it is often caused by the misspelled sources list. In most cases, you can fix it by yourself.

In this guide, I will tell you where is sources list, and how to fix it.

Where  is sources list

Sources list is located at “/etc/apt/” (File System->etc->apt), the main sources list is “sources.list”. And there will be other sources list under /etc/apt/sources.list.d/, all valid list should be end with “.list”.

How does sources list look like

If you open your sources.list, a typical line will look like this:

deb http://archive.ubuntu.com/ubuntu natty main restricted

It is called an “Entry”, sources list is consists of a numbers of entries.

Every entry is made by four sections, these sections are separated by “space”. I used different color to distinguish difference sections.

The first section is represent the “Entry type”. “deb” means the list contains deb packages. Another value is “deb-src”, it means the deb packages’ source code.

The second section is the URL, it must be accessible.

The third is distribution code name, it depends on your current distribituion.

The forth section is the “components”, it can be several items.

So a complete and valid source entry will look like this:

  • Type: must be “deb” or “deb-src”
  • URL: must be an accessible url
  • Code name: “karmic”, “lucid”, “maverick” or ther Ubuntu code names.
  • Component name: if the entry is PPA, so it will always be “main”.

Now you know how to fix the sources list! Open your terminal, try to edit and correct it with root like this:

sudo gedit /etc/apt/sources.list (or other path)

If you have any other problem, please leave a comment to let me know.

25 thoughts on “How to fix the sources list

  1. Could not initialize the Package Information

    An unresolvable problem occured while initializing the package information.

    Please report this bug against the ‘update manager’ package and include the following error message.

    ‘E:Type ‘.net/tualatrix/ppa/ubuntu’ is not known on line 1 in sources list etc/apt/sources.list.d/tualatrix-ppa-natty.list
    _______________________________________________________

    Please help me regarding this problem.

    Thank you

  2. To solve this, I tried to Remove the packages you recently installed and caused the problem. You could do so using Synaptic Package Manager -> Package -> Mark for removal. You might need to use Root privilege to modify /etc/apt/sources.list and sources.list.d files in case you have a problem. To open sources.list with Root privilige use:
    :~$ gksudo gedit /etc/apt/sources.list

    This is explained in details in the Ubuntu guide:
    http://ubuntuguide.org/wiki/Ubuntu:Natty

  3. When I wanted to get URLs of vlc software, I typed something like this
    #apt-get -qq –print-uris install vlc | awk -F ‘ ‘ ‘{ print $2}’ > get.lst
    but I couldn’t do that, because I did not update my Ubuntu 10.4
    The question is:
    “How to update package details for each software in Ubuntu 10.4 without an Internet connection ?”

  4. Thank u very very much for this! It was really great and it solved my prblm! My ubuntu couldnt even run software centre and all is fixed now! THANK YOU

  5. I am new to Ubuntu. i fresh installed the server i don’t have GUI. i am unable to install any ting from the terminal :(
    both sudo gedit /etc/apt/sources.list and gksudo gedit /etc/apt/sources.list are not working for me i get “command not found” error.
    Here’s my sources.list

    # deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/main/binary-i386/
    # deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ dists/precise/restricted/binary-i386/
    # deb cdrom:[Ubuntu-Server 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424.1)]/ precise main restricted

    i can’t copy or paste any command out put since i am no the Terminal only version (couldn’t install the GUI either)
    Please Help!

  6. I do not agree with hella. Ubuntu is not a waste of time, the system is not the same as windows, and there is a lot of work around some of the problems.
    My only gripe is that if ubuntu change APPS then they should remove the offending problem from the system. Not all computer users are computer literat, and some things are beyond some people to solve, which can result in crashes happening when they try to resolve the problems.

  7. i wanted to download my vlc but im gettin this error,Malformed line 1 in source list /etc/apt/sources.list.d/launchpad_vlc.list (dist parse)

  8. hi guyz please help me when i type commands for update on my backtrack 5 r1 example
    apt-get install most
    E: Type ‘”deb’ is not known on line 10 in source list /etc/apt/sources.list
    E: The list of sources could not be read.

  9. I am unable to edit my sources.list file, it says i don’t have the permissions as i’m not the owner, yet my account is an administrator and it was the first account created onto the pc. Also, when i try to edit terminal, after putting in a command/code, i get “[sudo] password for user:” and suddenly loose the ability to type in the document.

  10. When using sudo and you are asked for password you must use the root password, that is the first password you created when installing the operating system before you created your account and it’s password. Sudo temporarily runs the commands with root privileges then returns you to normal user privileges. If sudo still doesn’t work Google “setup sudo” for your distribution and also search how to update and install packages using apt.

  11. Hi,

    I have to install postfix and ftp service in my ubuntu-12.04.2-server-amd64. I think i got a problem with the source list. I install Webmin before and other stuff and it was fine, but now, i cannot use (sudo apt-get update, sudo apt-get install postfix). I already use the “ubuntu source list generator” and replace my sourcelist without success.

    I dont know what more to do. please HELP..

    Thanks..

    Pedro
    from: Puerto Rico

  12. Hello,I have a problem quite relationed with what you’re talkibg about.

    I have a trouble with my sources list.d And I can’t either use the comand apt-get or use de package installer..In bouth cases it turns out to be a mistake in the line 16 of my sourceslist,which is:
    deb http://oss.oracle.com/debian non-free main unstable

    How should I fix it?

  13. I have been surfing online more than 3 hours today, yet I never found any interesting
    article like yours. It’s pretty worth enough for me.
    Personally, if all website owners and bloggers made good content as you did, the web
    will be much more useful than ever before.|
    I couldn’t refrain from commenting. Very well written!|
    I’ll right away grab your rss feed as I can’t to find your
    e-mail subscription hyperlink or newsletter service.
    Do you’ve any? Kindly let me recognise in order that I
    could subscribe. Thanks.|
    It is appropriate time to make some plans for the future
    and it’s time to be happy. I’ve read this post
    and if I could I wish to suggest you some interesting things or suggestions.

    Maybe you can write next articles referring to this article.

    I want to read more things about it!|
    It is the best time to make a few plans for the longer term and it is time to be
    happy. I have read this submit and if I
    may I want to recommend you few attention-grabbing things
    or suggestions. Maybe you can write subsequent articles relating to
    this article. I wish to learn more issues about it!|
    I have been browsing on-line more than three hours today, yet I by no means found any interesting article
    like yours. It’s lovely worth sufficient for me.
    Personally, if all webmasters and bloggers made just
    right content as you probably did, the internet might be much
    more helpful than ever before.|
    Ahaa, its pleasant discussion on the topic of this post here at this website, I have read all that,
    so at this time me also commenting here.|
    I am sure this piece of writing has touched all the internet users, its really really pleasant article on building up
    new web site.|
    Wow, this post is good, my younger sister is analyzing such things, thus I am going to let know her.|
    Saved as a favorite, I like your site!|
    Way cool! Some very valid points! I appreciate
    you writing this write-up and the rest of the website is also very
    good.|
    Hi, I do believe this is a great site. I stumbledupon it ;
    ) I will return yet again since I book-marked it. Money and freedom is the best
    way to change, may you be rich and continue to help
    others.|
    Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between user friendliness and visual appeal.
    I must say you’ve done a great job with this. In addition, the blog loads super fast for me on Safari.
    Exceptional Blog!|
    These are in fact wonderful ideas in concerning blogging.
    You have touched some pleasant things here. Any way keep up wrinting.|
    I really like what you guys are usually up too. Such clever work and exposure!
    Keep up the fantastic works guys I’ve you guys to my blogroll.|
    Hi! Someone in my Facebook group shared this site with us so I came to look it over.
    I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers!

    Terrific blog and wonderful design and style.|
    I enjoy what you guys are up too. This sort of clever
    work and exposure! Keep up the great works guys
    I’ve added you guys to my personal blogroll.|
    Hi would you mind stating which blog platform you’re working with?
    I’m planning to start my own blog in the near future but I’m having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and
    I’m looking for something unique. P.S Sorry
    for getting off-topic but I had to ask!|
    Hi would you mind letting me know which webhost you’re using?

    I’ve loaded your blog in 3 completely different web
    browsers and I must say this blog loads a lot quicker then most.
    Can you suggest a good internet hosting provider at a reasonable
    price? Thanks a lot, I appreciate it!|
    I like it when folks get together and share opinions.

    Great website, stick with it!|
    Thank you for the auspicious writeup. It in fact was a amusement
    account it. Look advanced to more added agreeable from you!
    By the way, how can we communicate?|
    Howdy just wanted to give you a quick heads up. The text
    in your article seem to be running off the screen in Firefox.
    I’m not sure if this is a format issue or something to do
    with browser compatibility but I thought I’d post to let you know.
    The design look great though! Hope you get the
    problem solved soon. Many thanks|
    This is a topic which is near to my heart… Thank you!
    Where are your contact details though?|
    It’s very trouble-free to find out any matter on web as compared to textbooks, as I found this article at this web site.|
    Does your site have a contact page? I’m having problems locating it but,
    I’d like to shoot you an e-mail. I’ve got some creative ideas for your blog
    you might be interested in hearing. Either way, great website and I look forward
    to seeing it grow over time.|
    Hello! I’ve been reading your website for some time now and finally
    got the courage to go ahead and give you a shout out from New Caney
    Texas! Just wanted to mention keep up the excellent job!|
    Greetings from Ohio! I’m bored to death at work so I decided to browse your blog on my iphone during lunch
    break. I really like the information you provide here and can’t wait to take a look when I get home.
    I’m amazed at how fast your blog loaded on my mobile
    .. I’m not even using WIFI, just 3G .. Anyhow, superb blog!|
    Its such as you learn my mind! You seem to grasp
    so much about this, like you wrote the guide in it or something.
    I feel that you could do with a few percent to
    drive the message home a little bit, however
    other than that, that is excellent blog.
    A great read. I’ll certainly be back.|
    I visited various web sites except the audio quality for
    audio songs current at this site is in fact marvelous.|
    Hi, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam feedback?
    If so how do you stop it, any plugin or anything you can recommend?

    I get so much lately it’s driving me crazy so any support is very
    much appreciated.|
    Greetings! Very helpful advice in this particular article!

    It is the little changes which will make the biggest changes.
    Many thanks for sharing!|
    I really love your blog.. Pleasant colors & theme. Did you create this
    website yourself? Please reply back as I’m looking to create my
    own personal site and want to find out where you got
    this from or what the theme is named. Cheers!|
    Hello there! This post couldn’t be written any better!

    Looking at this post reminds me of my previous roommate! He continually kept talking about this.

    I most certainly will send this information to him.
    Pretty sure he will have a very good read. I appreciate you for sharing!|
    Wow! This blog looks just like my old one! It’s on a entirely different subject but it has pretty much the same layout and design.
    Excellent choice of colors!|
    There is definately a great deal to find out
    about this subject. I like all the points you made.|
    You have made some decent points there. I looked
    on the internet for more information about the issue and found most
    individuals will go along with your views on this web site.|
    Hello, I log on to your blogs on a regular basis. Your humoristic style is awesome, keep it up!|
    I just couldn’t go away your site prior to suggesting that
    I really enjoyed the usual information an individual provide to your visitors?
    Is gonna be back steadily in order to investigate cross-check
    new posts|
    I needed to thank you for this good read!! I certainly loved every little bit of it.
    I’ve got you book marked to check out new stuff you
    post…|
    Hello, just wanted to mention, I liked this blog post.

    It was inspiring. Keep on posting!|
    I comment when I like a article on a website or if I
    have something to contribute to the conversation.
    It’s a result of the fire displayed in the article I looked at.

    And after this article How to fix the sources list
    | Ubuntu Tweak Blog. I was actually moved enough to write a thought :-) I do have 2 questions for you if you don’t mind.
    Is it just me or does it look like like a few of
    the remarks come across like coming from brain dead individuals?
    :-P And, if you are writing on additional places, I would like to keep up with anything fresh you
    have to post. Would you make a list every one of
    your social pages like your Facebook page, twitter feed, or
    linkedin profile?|
    Hello, I enjoy reading through your article.

    I wanted to write a little comment to support you.|
    I constantly spent my half an hour to read this blog’s content daily along with a mug of coffee.|
    I for all time emailed this website post page to all my associates, since if like to read it next my links will too.|
    My programmer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using WordPress on numerous websites for about a year and am concerned about switching to
    another platform. I have heard excellent things about blogengine.net.

    Is there a way I can transfer all my wordpress posts into it?

    Any help would be really appreciated!|
    Good day! I could have sworn I’ve visited this website before but after browsing through
    a few of the posts I realized it’s new to me. Anyhow, I’m certainly pleased I
    found it and I’ll be book-marking it and checking back frequently!|
    Great article! That is the type of information that should be shared around the web.
    Shame on Google for now not positioning this publish higher!
    Come on over and discuss with my site . Thanks =)|
    Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and aid others like you helped
    me.|
    Hello there, There’s no doubt that your blog may be having internet browser compatibility issues.
    Whenever I look at your web site in Safari, it looks fine however, when opening in Internet Explorer, it’s got some overlapping
    issues. I merely wanted to provide you with a quick heads up!
    Aside from that, wonderful site!|
    Somebody essentially lend a hand to make seriously articles I would state.
    That is the very first time I frequented your website page and to this point?
    I amazed with the analysis you made to create this particular put up incredible.
    Great process!|
    Heya i am for the first time here. I found this board and I find It really helpful & it helped
    me out a lot. I hope to offer one thing back and aid others like you aided me.|
    Hello! I simply wish to offer you a huge thumbs up for your
    great information you have got here on this post. I am returning to your website for
    more soon.|
    I always used to study piece of writing in news papers but now as I am a user of net
    therefore from now I am using net for content,
    thanks to web.|
    Your mode of explaining the whole thing in this article
    is genuinely nice, every one can easily know it, Thanks a lot.|
    Hi there, I discovered your website by the use of Google at the same time as searching
    for a similar matter, your website got here up, it seems to be great.
    I have bookmarked it in my google bookmarks.
    Hello there, simply turned into aware of your weblog through Google, and found that it is truly informative.
    I’m gonna be careful for brussels. I will be grateful for those who proceed this in future.
    A lot of folks will be benefited out of your writing.
    Cheers!|
    I’m curious to find out what blog system you are using? I’m
    having some small security problems with my
    latest site and I’d like to find something more secure.
    Do you have any solutions?|
    I’m extremely impressed with your writing skills as well as with the layout on your blog.
    Is this a paid theme or did you modify it yourself?
    Either way keep up the excellent quality writing, it is rare to see a nice blog like this one nowadays.|
    I am extremely inspired with your writing skills as well as with
    the layout in your weblog. Is this a paid
    theme or did you modify it yourself? Either way stay up the nice high quality
    writing, it is uncommon to peer a nice blog like this one nowadays..|
    Hello, Neat post. There is a problem together with your site
    in internet explorer, may test this? IE still is the marketplace leader and a
    huge portion of folks will leave out your magnificent writing because of
    this problem.|
    I am not sure where you are getting your
    information, but good topic. I needs to spend some time learning more
    or understanding more. Thanks for excellent information I was looking for this info
    for my mission.|
    Hello, i think that i saw you visited my web site so i came to “return
    the favor”.I am attempting to find things to improve
    my website!I suppose its ok to use {some of|a few\

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>