Ubuntu – How to remove a malformed line from the sources.list

apt

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.

I just tried to upload a screen shot but since I'm new it won't allow me to. I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:

COULD NOT INTITIALIZE THE PACKAGE INFORMATION
An unresolvable problem occured while initializing the package information
Please report t:his bug against the 'update-manager' package and include the
following error message:
'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse) 
E: The list of sources could not be read., 
E: The package list of status file could not be parsed or opened.

How do I report bugs? What can be done about this. I have searched and everything everyone says to do leads me back to the same line error message.

So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.

Best Answer

Some lines are broken in your sources.list file (or another *.list file in sources.list.d/).

Edit the file mentioned in the error to fix the broken lines.

  1. To do this, run this command (press Ctrl+Alt+T to open a Terminal):

    sudo -H gedit /etc/apt/sources.list
    

    Or, instead of Gedit (which not all Ubuntu systems have), you might prefer to open the file an a terminal-based text editor:

    sudoedit /etc/apt/sources.list
    

    If necessary, replace /etc/apt/sources.list with another file name, i.e., the path to some file inside /etc/apt/sources.list.d/.

  2. Find the lines which are incorrectly formatted (refer to the error for a line number, then look around that point). These are examples of correctly formatted lines:

    # Comment, marked by a line starting with '#'
    deb http://site.example.com/debian distribution component1 component2 component3
    deb-src http://site.example.com/debian distribution component1 component2 component3
    

    The URL, distribution and components will be different. It does not necessarily have to have 3 components.

    Anything which doesn't fit this format is incorrect.

  3. Save the file and quit the text editor. Then run this command in a Terminal window:

    sudo apt-get update
    

Assuming there are no errors, the problem is now fixed. You should be able to run the Sofware Center.

However, while some problems with the Software Center can be solved by reinstalling the software-center package, most cannot, so it's possible your original problem will remain. If that is the case, you can post a new question to get help with it.