How do I remove a malformed line from my sources.list?How to search for specific lines in Linux?“apt-get update” fails with “Malformed entry in list file” errorMalformed entry 63 in list file after upgrading to Gnome 16.04.01“E:Malformed line 1 in source list /etc/apt/sources.list.d/medibuntu.list (type),”how to edit (or delete) sources list in commandline (no text editor, cannot install any new packages on limeted install)Unable to find expected entry 'restricted/binary-amd64/Packages' in Release fileMalformed line in the source list /etc/apt/sources.list (dist parse), don't let me use update manager?Unable to find expected entry 'main/source/Sources' in Release fileHow do I remove virtualbox.list from etc/apt/sources.list.d/virtualbox.listHow to solve the E:Malformed entry 55 in list file /etc/apt/sources.list (Component), problem
How to understand quality of Google Maps transport info in advance?
Definition of NMR peak
Doing chemistry under water?
Getting data from Seagate ST-238R drive
white marks on garage ceiling
Now I realize I used too many GFCI outlets. How can I reclaim them?
Am I being run backwards?
Are humans superior to machines in chess?
Vertical equivalent of mathclap?
Average Two Letters
What´s the purpose of this diode?
How does Facebook track your browsing without third party cookies?
How do you deal with someone who is nosy, projects their feelings about career, and gives unsolicited advice in that area?
Why didn't Abraham ask the single best question?
Should I report a security vulnerability?
Why do airline tickets have titles in addition to names?
The lecturer supposed to grade my presentation fell asleep while I held it. Should I complain?
I'm from Mumbai, India. I want to travel to Europe as a tourist but my salary is low ( €190/month)
The quietest classical orchestra instrument to play at home
Are we really moving at the speed of light in the time dimension?
What is the purpose of R1 in this circuit?
Why does the media continue to hide the identity of the Trump-Ukraine whistle blower when they have already been outed?
Paint Exterior Door that is in Sun
Joining elements of a list if those elements are in between two whitespaces
How do I remove a malformed line from my sources.list?
How to search for specific lines in Linux?“apt-get update” fails with “Malformed entry in list file” errorMalformed entry 63 in list file after upgrading to Gnome 16.04.01“E:Malformed line 1 in source list /etc/apt/sources.list.d/medibuntu.list (type),”how to edit (or delete) sources list in commandline (no text editor, cannot install any new packages on limeted install)Unable to find expected entry 'restricted/binary-amd64/Packages' in Release fileMalformed line in the source list /etc/apt/sources.list (dist parse), don't let me use update manager?Unable to find expected entry 'main/source/Sources' in Release fileHow do I remove virtualbox.list from etc/apt/sources.list.d/virtualbox.listHow to solve the E:Malformed entry 55 in list file /etc/apt/sources.list (Component), problem
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
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.
apt
add a comment
|
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.
apt
8
Can you add the content of your/etc/apt/sources.list
between lines 67 and 69???
– Bruno Pereira
Jun 17 '12 at 17:10
2
Edit your question to include the output of the commandcat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)
– Anwar
Jun 17 '12 at 17:14
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40
add a comment
|
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.
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.
apt
apt
edited Jun 9 '14 at 15:10
Braiam
54.9k21 gold badges147 silver badges230 bronze badges
54.9k21 gold badges147 silver badges230 bronze badges
asked Nov 13 '11 at 20:43
eminencejaeeminencejae
3441 gold badge3 silver badges3 bronze badges
3441 gold badge3 silver badges3 bronze badges
8
Can you add the content of your/etc/apt/sources.list
between lines 67 and 69???
– Bruno Pereira
Jun 17 '12 at 17:10
2
Edit your question to include the output of the commandcat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)
– Anwar
Jun 17 '12 at 17:14
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40
add a comment
|
8
Can you add the content of your/etc/apt/sources.list
between lines 67 and 69???
– Bruno Pereira
Jun 17 '12 at 17:10
2
Edit your question to include the output of the commandcat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)
– Anwar
Jun 17 '12 at 17:14
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40
8
8
Can you add the content of your
/etc/apt/sources.list
between lines 67 and 69???– Bruno Pereira
Jun 17 '12 at 17:10
Can you add the content of your
/etc/apt/sources.list
between lines 67 and 69???– Bruno Pereira
Jun 17 '12 at 17:10
2
2
Edit your question to include the output of the command
cat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)– Anwar
Jun 17 '12 at 17:14
Edit your question to include the output of the command
cat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)– Anwar
Jun 17 '12 at 17:14
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40
add a comment
|
9 Answers
9
active
oldest
votes
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.
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/
.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 component3The 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.
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.
I think that sometimes for Debian based distros you need./
at the end of the line as in this example
– user10089632
Mar 14 '18 at 16:17
add a comment
|
Quick Method
A workaround for this problem can be building the sources.list
entry from scratch.
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted
deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
Copy the above content (in grey box) and open the
sources.list
file as root.Typing
sudo -H gedit /etc/apt/sources.list
this in a terminal and hitting Enter will do the job.Then paste the copied content in the
sources.list
- note you probably will need to replaceprecise
with the codename representing your Ubuntu version - e.g.trusty
for 14.04. Then save and close gedit.Then do
sudo apt-get update
and you will see that the repository list is updated.
Explanation: Here we are completely replacing the content with another sources.list file with repository entry from Main Server. If you want to use your local server for sources.list
see the method below.
Recommended Method
Go to the Ubuntu sources list generator site.
- Select your country.
- Select your desired branches, such as Main, Restricted, Multiverse, Universe.
- Select desired update list, -
- Select any third party repository list if you wish.
- Click Generate list at the bottom of the page, you will be given a list with repositories.
- Copy that list and replace with
sources.list
file you have.
You are done. (I hope this will help.)
5
Strange that this was not accepted!! A quick fix, comment the problematic line in/etc/apt/sources.list
by adding##
as first characters in the line. Then trysudo apt-get update
.
– Noble P. Abraham
Sep 12 '12 at 7:32
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
add a comment
|
As you can see from the error, it says that your sources.list file has a wrong entry. This wrong entry could not be parsed. This error is not related to Software Center as such but mostly to do with apt(The package manager)
The way to solve this would be to fix the malformed line 91
entry.
If you cannot understand what is wrong with line 91, please post line 91 and I will help you out
add a comment
|
Please paste file /etc/apt/sources.list
so we can troubleshoot this problem for you. See this short tutorial answer for how to do that:
How can I easily share the output of a command or a text file with others?
This can sometimes be a very easy fix, but you must backup sources.list
first since it's a critical file.
- Open the terminal with Ctrl+Alt+T.
- Type/paste:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(this creates a backup copy) sudo sed -i -e '68d' /etc/apt/sources.list
(this deletes the problematic line)sudo apt-get update
(this updates the database with the hopefully-fixed file)
If you see no errors appear when you try step 4, the problem is hopefully fixed. You can exit the terminal and go back to Software Center/Update Manager and it should work.
If there is still a problem, you can restore the original file from the terminal with sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
. In that case, please paste the problematic lines or even the entire file to a pastebin and then we can help out further.
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.
– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if-i.backup
is passed tosed
instead of just-i
thensed
will make the backup file itself.
– Eliah Kagan
Sep 6 '17 at 14:03
add a comment
|
The file /etc/apt/sources.list
contains the URLs of webservers and location of other sources form (e.g. cds), from which you retrieve your software and updates. It basically tells Ubuntu where to look for new Software and updates to already installed programs. The error message you got means, that somehow the file got compromised. Without knowing what the content of your file is, it is hard to know what exactly is wrong with it. So you should post the output of sudo more /etc/apt/sources.list
for us to help you better.
If the file is messed up beyond repair, you can use the Ubuntu Source List Generator to generate a sources.list
anew. But you should backup your old one beforehand. Also this will cause you to lose all changes you have made for your Software Sources, e.g. in Sofware Center.
The better way to fix this is letting us see whats wrong with your sources.list
Edit after you posted your sources.list
:
I believe the file you posted should look like this (note the last to lines and the missing /etc/apt/sources.list
in the end):
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu partner
deb-src http://archive.canonical.com/ubuntu partner
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file calledsources.list
.
– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
|
show 2 more comments
Please try to edit your sources.list
file by dropping sudo gedit /etc/apt/sources.list
in a terminal (your password may be asked), after which you will have the options to enable "Line Numbers" in the Menu Edit/Preferences of gEdit and clicking the "Display line numbers" checkbox, then manually go to the Line in your error e.g. 91 or by using "Search/Go to line" (Ctrl+I does the trick).
At the beginning of the Line 91 drop two # symbols (##
) to comment on that line and this way remove it from the update process (you can also delete that line at your own risk, I suggest you a backup).
When you finish, save the file and close it down. Then open a terminal and run sudo apt-get update
and see if the error still appears. If not, then try opening your update manager.
Somehow it seems that the text in the Line 91 of your sources.list
file is corrupted or there is some kind of an error, which means that some software is unable to be installed/updated/upgraded.
By commenting/removing the erroneous line the software won't be installed (if not already) or won't be updated/upgraded if that's what you try. Of which I suggest you to check where is that line coming from (which software requires it) and do the proper modifications as required in order to everything run fine.
add a comment
|
If you face any malformed line error like below, i strongly recommend you to comment out(adding #
before the line) the line rather than deleting it in /etc/apt/sources.list
file.
E: Malformed line 91 in source list /etc/apt/sources.list (dist parse)
From the above error, the line number 91
in /etc/apt/sources.list
file is corrupted. To comment out the line number 91, you have to run the below command on terminal.
sudo sed -i '91s/(.*)/#1/' /etc/apt/sources.list
91
in the above code represents the line number. Replace the number 91 in the above code with your's if you got any malformed line error.
In some cases malformed line error will also occur in a list file that was actually present inside /etc/apt/sources.list.d
directory. For example,
E: Malformed line 1 in source list /etc/apt/sources.list.d/google.list (dist parse)
In this case i strongly recommend you to delete the google.list
file by running sudo rm /etc/apt/sources.list.d/google.list
and then add the corresponding PPA again.
Finally update all the repositories by running sudo apt-get update
command on terminal. Now the error won't appears.
add a comment
|
You have to delete the last line of this file (not the file itself, of course):
/etc/apt/sources.list
Your sources.list
file has to look something like this:
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ partner
deb-src http://archive.canonical.com/ partner
Of course, just replacing your sources.list
file with that text could be a very bad thing, especially if it looked quite different before. The key point is that each line starts with deb
or deb-src
(except for comments, which start with #
).
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
add a comment
|
Open a terminal using CTRL+Alt+T and execute the below command to remove line 6, which is not correct form of repository source line, thus apt giving you an error about malformed line.
WARNING: Don't execute this command without reading the question first, this command will delete the line 68 of /etc/apt/sources.list
file. Check whether your problem is similar and, even if it is, replace 68
with the number of the line that you need to delete.
sudo sed -i.old '68d' /etc/apt/sources.list
This command will delete the line using sed
in place. It makes a backup called /etc/apt/sources.list.old
. If you don't want the backup then you can use plain -i
instead of -i.old
.
Alternatively, you can manually delete the line with Gedit.
- Press Alt + F2 and type
gksu gedit /etc/apt/sources.list
.
(If you don't havegksu
you can usesudo -H gedit
.) - Find the corrupted
/etc/apt/sources.list
and remove it. - Save and exit Gedit.
Correct form of repository source line:
The correct format of repository source line is:
<type of repository> <location i.e URI> <dist-name> <components i.e main, universe>
For example:
deb http://archive.ubuntu.com/ubuntu precise main
Type:deb
is the type of repo, it indicates it is a binary repository, not a source repository, which has typedeb-scr
.
Location:http://archive.ubuntu.com/ubuntu
location of the repositoryDist-name:
precise
is the distribution name of Ubuntu release. for Ubuntu 12.04 it isprecise
, 11.10 isoneiric
Component:
main
is indicating the component of repository. Ubuntu repository are divided into four parts.
Main - Which contains free and open source software, officially supported
Universe - These softwares are not supported by Canonical, but those are maintained by the community.
Restricted - These softwares are supported by Canonical, but aren't free. These are supported to provide some essential drivers
Multiverse - These are also non-free softwares, and not supported by Canonical.
See this page for more information.
You can now understand that /etc/apt/sources.list
is not a repository source line and hence apt-get
complaining about it.
For more information about Adding and Removing repositories and the format of repository source line, See this Ubuntu Help page.
See the Sed manual page here.
1
Hi, Anwar, this is a good answer, but it is very risk to just have asudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck theirsources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.
– Jjed
Sep 1 '12 at 14:12
add a comment
|
protected by Community♦ Jan 16 '13 at 20:38
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
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/
.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 component3The 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.
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.
I think that sometimes for Debian based distros you need./
at the end of the line as in this example
– user10089632
Mar 14 '18 at 16:17
add a comment
|
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.
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/
.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 component3The 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.
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.
I think that sometimes for Debian based distros you need./
at the end of the line as in this example
– user10089632
Mar 14 '18 at 16:17
add a comment
|
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.
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/
.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 component3The 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.
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.
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.
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/
.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 component3The 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.
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.
edited Oct 12 at 14:35
Kulfy
8,60811 gold badges34 silver badges60 bronze badges
8,60811 gold badges34 silver badges60 bronze badges
answered Aug 21 '12 at 13:06
Eliah KaganEliah Kagan
93k25 gold badges255 silver badges409 bronze badges
93k25 gold badges255 silver badges409 bronze badges
I think that sometimes for Debian based distros you need./
at the end of the line as in this example
– user10089632
Mar 14 '18 at 16:17
add a comment
|
I think that sometimes for Debian based distros you need./
at the end of the line as in this example
– user10089632
Mar 14 '18 at 16:17
I think that sometimes for Debian based distros you need
./
at the end of the line as in this example– user10089632
Mar 14 '18 at 16:17
I think that sometimes for Debian based distros you need
./
at the end of the line as in this example– user10089632
Mar 14 '18 at 16:17
add a comment
|
Quick Method
A workaround for this problem can be building the sources.list
entry from scratch.
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted
deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
Copy the above content (in grey box) and open the
sources.list
file as root.Typing
sudo -H gedit /etc/apt/sources.list
this in a terminal and hitting Enter will do the job.Then paste the copied content in the
sources.list
- note you probably will need to replaceprecise
with the codename representing your Ubuntu version - e.g.trusty
for 14.04. Then save and close gedit.Then do
sudo apt-get update
and you will see that the repository list is updated.
Explanation: Here we are completely replacing the content with another sources.list file with repository entry from Main Server. If you want to use your local server for sources.list
see the method below.
Recommended Method
Go to the Ubuntu sources list generator site.
- Select your country.
- Select your desired branches, such as Main, Restricted, Multiverse, Universe.
- Select desired update list, -
- Select any third party repository list if you wish.
- Click Generate list at the bottom of the page, you will be given a list with repositories.
- Copy that list and replace with
sources.list
file you have.
You are done. (I hope this will help.)
5
Strange that this was not accepted!! A quick fix, comment the problematic line in/etc/apt/sources.list
by adding##
as first characters in the line. Then trysudo apt-get update
.
– Noble P. Abraham
Sep 12 '12 at 7:32
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
add a comment
|
Quick Method
A workaround for this problem can be building the sources.list
entry from scratch.
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted
deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
Copy the above content (in grey box) and open the
sources.list
file as root.Typing
sudo -H gedit /etc/apt/sources.list
this in a terminal and hitting Enter will do the job.Then paste the copied content in the
sources.list
- note you probably will need to replaceprecise
with the codename representing your Ubuntu version - e.g.trusty
for 14.04. Then save and close gedit.Then do
sudo apt-get update
and you will see that the repository list is updated.
Explanation: Here we are completely replacing the content with another sources.list file with repository entry from Main Server. If you want to use your local server for sources.list
see the method below.
Recommended Method
Go to the Ubuntu sources list generator site.
- Select your country.
- Select your desired branches, such as Main, Restricted, Multiverse, Universe.
- Select desired update list, -
- Select any third party repository list if you wish.
- Click Generate list at the bottom of the page, you will be given a list with repositories.
- Copy that list and replace with
sources.list
file you have.
You are done. (I hope this will help.)
5
Strange that this was not accepted!! A quick fix, comment the problematic line in/etc/apt/sources.list
by adding##
as first characters in the line. Then trysudo apt-get update
.
– Noble P. Abraham
Sep 12 '12 at 7:32
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
add a comment
|
Quick Method
A workaround for this problem can be building the sources.list
entry from scratch.
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted
deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
Copy the above content (in grey box) and open the
sources.list
file as root.Typing
sudo -H gedit /etc/apt/sources.list
this in a terminal and hitting Enter will do the job.Then paste the copied content in the
sources.list
- note you probably will need to replaceprecise
with the codename representing your Ubuntu version - e.g.trusty
for 14.04. Then save and close gedit.Then do
sudo apt-get update
and you will see that the repository list is updated.
Explanation: Here we are completely replacing the content with another sources.list file with repository entry from Main Server. If you want to use your local server for sources.list
see the method below.
Recommended Method
Go to the Ubuntu sources list generator site.
- Select your country.
- Select your desired branches, such as Main, Restricted, Multiverse, Universe.
- Select desired update list, -
- Select any third party repository list if you wish.
- Click Generate list at the bottom of the page, you will be given a list with repositories.
- Copy that list and replace with
sources.list
file you have.
You are done. (I hope this will help.)
Quick Method
A workaround for this problem can be building the sources.list
entry from scratch.
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted
deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
Copy the above content (in grey box) and open the
sources.list
file as root.Typing
sudo -H gedit /etc/apt/sources.list
this in a terminal and hitting Enter will do the job.Then paste the copied content in the
sources.list
- note you probably will need to replaceprecise
with the codename representing your Ubuntu version - e.g.trusty
for 14.04. Then save and close gedit.Then do
sudo apt-get update
and you will see that the repository list is updated.
Explanation: Here we are completely replacing the content with another sources.list file with repository entry from Main Server. If you want to use your local server for sources.list
see the method below.
Recommended Method
Go to the Ubuntu sources list generator site.
- Select your country.
- Select your desired branches, such as Main, Restricted, Multiverse, Universe.
- Select desired update list, -
- Select any third party repository list if you wish.
- Click Generate list at the bottom of the page, you will be given a list with repositories.
- Copy that list and replace with
sources.list
file you have.
You are done. (I hope this will help.)
edited Jul 17 '15 at 15:00
Wilf
23.1k11 gold badges75 silver badges137 bronze badges
23.1k11 gold badges75 silver badges137 bronze badges
answered Jun 18 '12 at 5:24
AnwarAnwar
59.9k26 gold badges162 silver badges269 bronze badges
59.9k26 gold badges162 silver badges269 bronze badges
5
Strange that this was not accepted!! A quick fix, comment the problematic line in/etc/apt/sources.list
by adding##
as first characters in the line. Then trysudo apt-get update
.
– Noble P. Abraham
Sep 12 '12 at 7:32
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
add a comment
|
5
Strange that this was not accepted!! A quick fix, comment the problematic line in/etc/apt/sources.list
by adding##
as first characters in the line. Then trysudo apt-get update
.
– Noble P. Abraham
Sep 12 '12 at 7:32
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
5
5
Strange that this was not accepted!! A quick fix, comment the problematic line in
/etc/apt/sources.list
by adding ##
as first characters in the line. Then try sudo apt-get update
.– Noble P. Abraham
Sep 12 '12 at 7:32
Strange that this was not accepted!! A quick fix, comment the problematic line in
/etc/apt/sources.list
by adding ##
as first characters in the line. Then try sudo apt-get update
.– Noble P. Abraham
Sep 12 '12 at 7:32
3
3
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
Maybe it wasn't accepted because the user may have other repos enabled and they would lose them if they did this. For example, most users of VirtualBox get it from Oracle's repo. Also, Oracle uses different package names in there repos than Ubuntu does in theirs. Therefore, if I installed VirtualBox with Oracle's repo and followed this guide, I would sit at the same version of VirtualBox all of the time and never get an update. Never.
– John Scott
Jan 3 '15 at 18:30
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
@FuzzyToothpaste they will not lose them if they did this. It only removes the duplicate entries. Your example scenario has nothing to do with this problem
– Anwar
Jan 4 '15 at 2:36
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
When using Ubuntu source list generator site to generate new sources.list file do not forget to update GPG keys. Otherwise issue may persist
– Tushar Goswami
Oct 10 '17 at 18:22
add a comment
|
As you can see from the error, it says that your sources.list file has a wrong entry. This wrong entry could not be parsed. This error is not related to Software Center as such but mostly to do with apt(The package manager)
The way to solve this would be to fix the malformed line 91
entry.
If you cannot understand what is wrong with line 91, please post line 91 and I will help you out
add a comment
|
As you can see from the error, it says that your sources.list file has a wrong entry. This wrong entry could not be parsed. This error is not related to Software Center as such but mostly to do with apt(The package manager)
The way to solve this would be to fix the malformed line 91
entry.
If you cannot understand what is wrong with line 91, please post line 91 and I will help you out
add a comment
|
As you can see from the error, it says that your sources.list file has a wrong entry. This wrong entry could not be parsed. This error is not related to Software Center as such but mostly to do with apt(The package manager)
The way to solve this would be to fix the malformed line 91
entry.
If you cannot understand what is wrong with line 91, please post line 91 and I will help you out
As you can see from the error, it says that your sources.list file has a wrong entry. This wrong entry could not be parsed. This error is not related to Software Center as such but mostly to do with apt(The package manager)
The way to solve this would be to fix the malformed line 91
entry.
If you cannot understand what is wrong with line 91, please post line 91 and I will help you out
answered Nov 13 '11 at 20:50
Manish SinhaManish Sinha
10.5k2 gold badges42 silver badges62 bronze badges
10.5k2 gold badges42 silver badges62 bronze badges
add a comment
|
add a comment
|
Please paste file /etc/apt/sources.list
so we can troubleshoot this problem for you. See this short tutorial answer for how to do that:
How can I easily share the output of a command or a text file with others?
This can sometimes be a very easy fix, but you must backup sources.list
first since it's a critical file.
- Open the terminal with Ctrl+Alt+T.
- Type/paste:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(this creates a backup copy) sudo sed -i -e '68d' /etc/apt/sources.list
(this deletes the problematic line)sudo apt-get update
(this updates the database with the hopefully-fixed file)
If you see no errors appear when you try step 4, the problem is hopefully fixed. You can exit the terminal and go back to Software Center/Update Manager and it should work.
If there is still a problem, you can restore the original file from the terminal with sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
. In that case, please paste the problematic lines or even the entire file to a pastebin and then we can help out further.
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.
– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if-i.backup
is passed tosed
instead of just-i
thensed
will make the backup file itself.
– Eliah Kagan
Sep 6 '17 at 14:03
add a comment
|
Please paste file /etc/apt/sources.list
so we can troubleshoot this problem for you. See this short tutorial answer for how to do that:
How can I easily share the output of a command or a text file with others?
This can sometimes be a very easy fix, but you must backup sources.list
first since it's a critical file.
- Open the terminal with Ctrl+Alt+T.
- Type/paste:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(this creates a backup copy) sudo sed -i -e '68d' /etc/apt/sources.list
(this deletes the problematic line)sudo apt-get update
(this updates the database with the hopefully-fixed file)
If you see no errors appear when you try step 4, the problem is hopefully fixed. You can exit the terminal and go back to Software Center/Update Manager and it should work.
If there is still a problem, you can restore the original file from the terminal with sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
. In that case, please paste the problematic lines or even the entire file to a pastebin and then we can help out further.
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.
– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if-i.backup
is passed tosed
instead of just-i
thensed
will make the backup file itself.
– Eliah Kagan
Sep 6 '17 at 14:03
add a comment
|
Please paste file /etc/apt/sources.list
so we can troubleshoot this problem for you. See this short tutorial answer for how to do that:
How can I easily share the output of a command or a text file with others?
This can sometimes be a very easy fix, but you must backup sources.list
first since it's a critical file.
- Open the terminal with Ctrl+Alt+T.
- Type/paste:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(this creates a backup copy) sudo sed -i -e '68d' /etc/apt/sources.list
(this deletes the problematic line)sudo apt-get update
(this updates the database with the hopefully-fixed file)
If you see no errors appear when you try step 4, the problem is hopefully fixed. You can exit the terminal and go back to Software Center/Update Manager and it should work.
If there is still a problem, you can restore the original file from the terminal with sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
. In that case, please paste the problematic lines or even the entire file to a pastebin and then we can help out further.
Please paste file /etc/apt/sources.list
so we can troubleshoot this problem for you. See this short tutorial answer for how to do that:
How can I easily share the output of a command or a text file with others?
This can sometimes be a very easy fix, but you must backup sources.list
first since it's a critical file.
- Open the terminal with Ctrl+Alt+T.
- Type/paste:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
(this creates a backup copy) sudo sed -i -e '68d' /etc/apt/sources.list
(this deletes the problematic line)sudo apt-get update
(this updates the database with the hopefully-fixed file)
If you see no errors appear when you try step 4, the problem is hopefully fixed. You can exit the terminal and go back to Software Center/Update Manager and it should work.
If there is still a problem, you can restore the original file from the terminal with sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
. In that case, please paste the problematic lines or even the entire file to a pastebin and then we can help out further.
edited Sep 6 '17 at 14:03
Eliah Kagan
93k25 gold badges255 silver badges409 bronze badges
93k25 gold badges255 silver badges409 bronze badges
answered Jun 17 '12 at 23:50
ishish
121k35 gold badges279 silver badges298 bronze badges
121k35 gold badges279 silver badges298 bronze badges
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.
– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if-i.backup
is passed tosed
instead of just-i
thensed
will make the backup file itself.
– Eliah Kagan
Sep 6 '17 at 14:03
add a comment
|
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.
– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if-i.backup
is passed tosed
instead of just-i
thensed
will make the backup file itself.
– Eliah Kagan
Sep 6 '17 at 14:03
3
3
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).
man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.– roadmr
Jun 18 '12 at 0:04
Deleting the offending line may not be a good idea (but kudos on the advice to back things up before doing this). What if it's a repository the user needs? Also, if a long line was somehow split into two lines, you will have two malformed lines (and the procedure has to be repeated).
man sources.list
has a section with examples and it may be useful to ask the user to compare his lines with the examples, maybe he can determine what's wrong and fix it himself. Personally I'd wait until he posts his sources.list file.– roadmr
Jun 18 '12 at 0:04
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr: Thanks, I agree completely with all of the scenarios you posit. I just felt that newbies may not even know how to post a file, let alone specific lines from that file, unless advised how. That inspired me to write this self-QA-howto :-)
– ish
Jun 18 '12 at 7:45
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
@roadmr I believe you would get an error message about two malformed lines if one long line were split into two lines.
– mchid
Sep 3 '15 at 7:36
Note that if
-i.backup
is passed to sed
instead of just -i
then sed
will make the backup file itself.– Eliah Kagan
Sep 6 '17 at 14:03
Note that if
-i.backup
is passed to sed
instead of just -i
then sed
will make the backup file itself.– Eliah Kagan
Sep 6 '17 at 14:03
add a comment
|
The file /etc/apt/sources.list
contains the URLs of webservers and location of other sources form (e.g. cds), from which you retrieve your software and updates. It basically tells Ubuntu where to look for new Software and updates to already installed programs. The error message you got means, that somehow the file got compromised. Without knowing what the content of your file is, it is hard to know what exactly is wrong with it. So you should post the output of sudo more /etc/apt/sources.list
for us to help you better.
If the file is messed up beyond repair, you can use the Ubuntu Source List Generator to generate a sources.list
anew. But you should backup your old one beforehand. Also this will cause you to lose all changes you have made for your Software Sources, e.g. in Sofware Center.
The better way to fix this is letting us see whats wrong with your sources.list
Edit after you posted your sources.list
:
I believe the file you posted should look like this (note the last to lines and the missing /etc/apt/sources.list
in the end):
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu partner
deb-src http://archive.canonical.com/ubuntu partner
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file calledsources.list
.
– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
|
show 2 more comments
The file /etc/apt/sources.list
contains the URLs of webservers and location of other sources form (e.g. cds), from which you retrieve your software and updates. It basically tells Ubuntu where to look for new Software and updates to already installed programs. The error message you got means, that somehow the file got compromised. Without knowing what the content of your file is, it is hard to know what exactly is wrong with it. So you should post the output of sudo more /etc/apt/sources.list
for us to help you better.
If the file is messed up beyond repair, you can use the Ubuntu Source List Generator to generate a sources.list
anew. But you should backup your old one beforehand. Also this will cause you to lose all changes you have made for your Software Sources, e.g. in Sofware Center.
The better way to fix this is letting us see whats wrong with your sources.list
Edit after you posted your sources.list
:
I believe the file you posted should look like this (note the last to lines and the missing /etc/apt/sources.list
in the end):
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu partner
deb-src http://archive.canonical.com/ubuntu partner
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file calledsources.list
.
– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
|
show 2 more comments
The file /etc/apt/sources.list
contains the URLs of webservers and location of other sources form (e.g. cds), from which you retrieve your software and updates. It basically tells Ubuntu where to look for new Software and updates to already installed programs. The error message you got means, that somehow the file got compromised. Without knowing what the content of your file is, it is hard to know what exactly is wrong with it. So you should post the output of sudo more /etc/apt/sources.list
for us to help you better.
If the file is messed up beyond repair, you can use the Ubuntu Source List Generator to generate a sources.list
anew. But you should backup your old one beforehand. Also this will cause you to lose all changes you have made for your Software Sources, e.g. in Sofware Center.
The better way to fix this is letting us see whats wrong with your sources.list
Edit after you posted your sources.list
:
I believe the file you posted should look like this (note the last to lines and the missing /etc/apt/sources.list
in the end):
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu partner
deb-src http://archive.canonical.com/ubuntu partner
The file /etc/apt/sources.list
contains the URLs of webservers and location of other sources form (e.g. cds), from which you retrieve your software and updates. It basically tells Ubuntu where to look for new Software and updates to already installed programs. The error message you got means, that somehow the file got compromised. Without knowing what the content of your file is, it is hard to know what exactly is wrong with it. So you should post the output of sudo more /etc/apt/sources.list
for us to help you better.
If the file is messed up beyond repair, you can use the Ubuntu Source List Generator to generate a sources.list
anew. But you should backup your old one beforehand. Also this will cause you to lose all changes you have made for your Software Sources, e.g. in Sofware Center.
The better way to fix this is letting us see whats wrong with your sources.list
Edit after you posted your sources.list
:
I believe the file you posted should look like this (note the last to lines and the missing /etc/apt/sources.list
in the end):
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu partner
deb-src http://archive.canonical.com/ubuntu partner
edited Aug 3 '12 at 16:14
Thomas Ward♦
49k24 gold badges132 silver badges190 bronze badges
49k24 gold badges132 silver badges190 bronze badges
answered Jul 31 '12 at 17:23
con-f-usecon-f-use
13.7k17 gold badges79 silver badges139 bronze badges
13.7k17 gold badges79 silver badges139 bronze badges
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file calledsources.list
.
– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
|
show 2 more comments
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file calledsources.list
.
– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
I'll try the source list generator after I backed up my files but it would really take a while. My laptop is still on HDD so it's not that quick yet. I added my source.list to the message above.
– Odi1215
Aug 1 '12 at 13:30
It is sufficient to back up just the one file called
sources.list
.– con-f-use
Aug 1 '12 at 13:32
It is sufficient to back up just the one file called
sources.list
.– con-f-use
Aug 1 '12 at 13:32
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Okay, will do. Then I'll try the source list generator?
– Odi1215
Aug 1 '12 at 13:35
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
Positive. That's a Yes.
– con-f-use
Aug 1 '12 at 13:38
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
I typed in sudo more /etc/apt/sources.list but nothing happened.
– Odi1215
Aug 1 '12 at 16:58
|
show 2 more comments
Please try to edit your sources.list
file by dropping sudo gedit /etc/apt/sources.list
in a terminal (your password may be asked), after which you will have the options to enable "Line Numbers" in the Menu Edit/Preferences of gEdit and clicking the "Display line numbers" checkbox, then manually go to the Line in your error e.g. 91 or by using "Search/Go to line" (Ctrl+I does the trick).
At the beginning of the Line 91 drop two # symbols (##
) to comment on that line and this way remove it from the update process (you can also delete that line at your own risk, I suggest you a backup).
When you finish, save the file and close it down. Then open a terminal and run sudo apt-get update
and see if the error still appears. If not, then try opening your update manager.
Somehow it seems that the text in the Line 91 of your sources.list
file is corrupted or there is some kind of an error, which means that some software is unable to be installed/updated/upgraded.
By commenting/removing the erroneous line the software won't be installed (if not already) or won't be updated/upgraded if that's what you try. Of which I suggest you to check where is that line coming from (which software requires it) and do the proper modifications as required in order to everything run fine.
add a comment
|
Please try to edit your sources.list
file by dropping sudo gedit /etc/apt/sources.list
in a terminal (your password may be asked), after which you will have the options to enable "Line Numbers" in the Menu Edit/Preferences of gEdit and clicking the "Display line numbers" checkbox, then manually go to the Line in your error e.g. 91 or by using "Search/Go to line" (Ctrl+I does the trick).
At the beginning of the Line 91 drop two # symbols (##
) to comment on that line and this way remove it from the update process (you can also delete that line at your own risk, I suggest you a backup).
When you finish, save the file and close it down. Then open a terminal and run sudo apt-get update
and see if the error still appears. If not, then try opening your update manager.
Somehow it seems that the text in the Line 91 of your sources.list
file is corrupted or there is some kind of an error, which means that some software is unable to be installed/updated/upgraded.
By commenting/removing the erroneous line the software won't be installed (if not already) or won't be updated/upgraded if that's what you try. Of which I suggest you to check where is that line coming from (which software requires it) and do the proper modifications as required in order to everything run fine.
add a comment
|
Please try to edit your sources.list
file by dropping sudo gedit /etc/apt/sources.list
in a terminal (your password may be asked), after which you will have the options to enable "Line Numbers" in the Menu Edit/Preferences of gEdit and clicking the "Display line numbers" checkbox, then manually go to the Line in your error e.g. 91 or by using "Search/Go to line" (Ctrl+I does the trick).
At the beginning of the Line 91 drop two # symbols (##
) to comment on that line and this way remove it from the update process (you can also delete that line at your own risk, I suggest you a backup).
When you finish, save the file and close it down. Then open a terminal and run sudo apt-get update
and see if the error still appears. If not, then try opening your update manager.
Somehow it seems that the text in the Line 91 of your sources.list
file is corrupted or there is some kind of an error, which means that some software is unable to be installed/updated/upgraded.
By commenting/removing the erroneous line the software won't be installed (if not already) or won't be updated/upgraded if that's what you try. Of which I suggest you to check where is that line coming from (which software requires it) and do the proper modifications as required in order to everything run fine.
Please try to edit your sources.list
file by dropping sudo gedit /etc/apt/sources.list
in a terminal (your password may be asked), after which you will have the options to enable "Line Numbers" in the Menu Edit/Preferences of gEdit and clicking the "Display line numbers" checkbox, then manually go to the Line in your error e.g. 91 or by using "Search/Go to line" (Ctrl+I does the trick).
At the beginning of the Line 91 drop two # symbols (##
) to comment on that line and this way remove it from the update process (you can also delete that line at your own risk, I suggest you a backup).
When you finish, save the file and close it down. Then open a terminal and run sudo apt-get update
and see if the error still appears. If not, then try opening your update manager.
Somehow it seems that the text in the Line 91 of your sources.list
file is corrupted or there is some kind of an error, which means that some software is unable to be installed/updated/upgraded.
By commenting/removing the erroneous line the software won't be installed (if not already) or won't be updated/upgraded if that's what you try. Of which I suggest you to check where is that line coming from (which software requires it) and do the proper modifications as required in order to everything run fine.
edited Jun 10 '14 at 11:34
fossfreedom♦
154k39 gold badges341 silver badges384 bronze badges
154k39 gold badges341 silver badges384 bronze badges
answered Apr 24 '13 at 16:48
Geppettvs D'ConstanzoGeppettvs D'Constanzo
16.7k4 gold badges35 silver badges84 bronze badges
16.7k4 gold badges35 silver badges84 bronze badges
add a comment
|
add a comment
|
If you face any malformed line error like below, i strongly recommend you to comment out(adding #
before the line) the line rather than deleting it in /etc/apt/sources.list
file.
E: Malformed line 91 in source list /etc/apt/sources.list (dist parse)
From the above error, the line number 91
in /etc/apt/sources.list
file is corrupted. To comment out the line number 91, you have to run the below command on terminal.
sudo sed -i '91s/(.*)/#1/' /etc/apt/sources.list
91
in the above code represents the line number. Replace the number 91 in the above code with your's if you got any malformed line error.
In some cases malformed line error will also occur in a list file that was actually present inside /etc/apt/sources.list.d
directory. For example,
E: Malformed line 1 in source list /etc/apt/sources.list.d/google.list (dist parse)
In this case i strongly recommend you to delete the google.list
file by running sudo rm /etc/apt/sources.list.d/google.list
and then add the corresponding PPA again.
Finally update all the repositories by running sudo apt-get update
command on terminal. Now the error won't appears.
add a comment
|
If you face any malformed line error like below, i strongly recommend you to comment out(adding #
before the line) the line rather than deleting it in /etc/apt/sources.list
file.
E: Malformed line 91 in source list /etc/apt/sources.list (dist parse)
From the above error, the line number 91
in /etc/apt/sources.list
file is corrupted. To comment out the line number 91, you have to run the below command on terminal.
sudo sed -i '91s/(.*)/#1/' /etc/apt/sources.list
91
in the above code represents the line number. Replace the number 91 in the above code with your's if you got any malformed line error.
In some cases malformed line error will also occur in a list file that was actually present inside /etc/apt/sources.list.d
directory. For example,
E: Malformed line 1 in source list /etc/apt/sources.list.d/google.list (dist parse)
In this case i strongly recommend you to delete the google.list
file by running sudo rm /etc/apt/sources.list.d/google.list
and then add the corresponding PPA again.
Finally update all the repositories by running sudo apt-get update
command on terminal. Now the error won't appears.
add a comment
|
If you face any malformed line error like below, i strongly recommend you to comment out(adding #
before the line) the line rather than deleting it in /etc/apt/sources.list
file.
E: Malformed line 91 in source list /etc/apt/sources.list (dist parse)
From the above error, the line number 91
in /etc/apt/sources.list
file is corrupted. To comment out the line number 91, you have to run the below command on terminal.
sudo sed -i '91s/(.*)/#1/' /etc/apt/sources.list
91
in the above code represents the line number. Replace the number 91 in the above code with your's if you got any malformed line error.
In some cases malformed line error will also occur in a list file that was actually present inside /etc/apt/sources.list.d
directory. For example,
E: Malformed line 1 in source list /etc/apt/sources.list.d/google.list (dist parse)
In this case i strongly recommend you to delete the google.list
file by running sudo rm /etc/apt/sources.list.d/google.list
and then add the corresponding PPA again.
Finally update all the repositories by running sudo apt-get update
command on terminal. Now the error won't appears.
If you face any malformed line error like below, i strongly recommend you to comment out(adding #
before the line) the line rather than deleting it in /etc/apt/sources.list
file.
E: Malformed line 91 in source list /etc/apt/sources.list (dist parse)
From the above error, the line number 91
in /etc/apt/sources.list
file is corrupted. To comment out the line number 91, you have to run the below command on terminal.
sudo sed -i '91s/(.*)/#1/' /etc/apt/sources.list
91
in the above code represents the line number. Replace the number 91 in the above code with your's if you got any malformed line error.
In some cases malformed line error will also occur in a list file that was actually present inside /etc/apt/sources.list.d
directory. For example,
E: Malformed line 1 in source list /etc/apt/sources.list.d/google.list (dist parse)
In this case i strongly recommend you to delete the google.list
file by running sudo rm /etc/apt/sources.list.d/google.list
and then add the corresponding PPA again.
Finally update all the repositories by running sudo apt-get update
command on terminal. Now the error won't appears.
edited May 29 '14 at 4:55
answered May 6 '14 at 8:42
Avinash RajAvinash Raj
56.1k44 gold badges178 silver badges229 bronze badges
56.1k44 gold badges178 silver badges229 bronze badges
add a comment
|
add a comment
|
You have to delete the last line of this file (not the file itself, of course):
/etc/apt/sources.list
Your sources.list
file has to look something like this:
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ partner
deb-src http://archive.canonical.com/ partner
Of course, just replacing your sources.list
file with that text could be a very bad thing, especially if it looked quite different before. The key point is that each line starts with deb
or deb-src
(except for comments, which start with #
).
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
add a comment
|
You have to delete the last line of this file (not the file itself, of course):
/etc/apt/sources.list
Your sources.list
file has to look something like this:
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ partner
deb-src http://archive.canonical.com/ partner
Of course, just replacing your sources.list
file with that text could be a very bad thing, especially if it looked quite different before. The key point is that each line starts with deb
or deb-src
(except for comments, which start with #
).
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
add a comment
|
You have to delete the last line of this file (not the file itself, of course):
/etc/apt/sources.list
Your sources.list
file has to look something like this:
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ partner
deb-src http://archive.canonical.com/ partner
Of course, just replacing your sources.list
file with that text could be a very bad thing, especially if it looked quite different before. The key point is that each line starts with deb
or deb-src
(except for comments, which start with #
).
You have to delete the last line of this file (not the file itself, of course):
/etc/apt/sources.list
Your sources.list
file has to look something like this:
# /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.canonical.com/ partner
deb-src http://archive.canonical.com/ partner
Of course, just replacing your sources.list
file with that text could be a very bad thing, especially if it looked quite different before. The key point is that each line starts with deb
or deb-src
(except for comments, which start with #
).
edited Sep 1 '12 at 17:15
Eliah Kagan
93k25 gold badges255 silver badges409 bronze badges
93k25 gold badges255 silver badges409 bronze badges
answered Aug 1 '12 at 14:07
Malika QueenMalika Queen
3291 silver badge3 bronze badges
3291 silver badge3 bronze badges
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
add a comment
|
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
1
1
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@Malika Hello, I'm glad this fixed the problem. But please try to answer questions not only for the asker, but also for people who Google this question and have slight variations of the asker's problem. This probably needs a little more explanation to make it a good "general" answer. :)
– Jjed
Sep 1 '12 at 14:08
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
@JacobJohanEdwards I can't agree with you, because we really can't help those people who execute commands before reading the question, IMO
– Anwar
Sep 1 '12 at 16:20
2
2
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
@Anwar In my opinion, it is the responsibility of the answerer to (a) not answer in a way that only helps the original asker [that's too localized], (b) does not does not appropriately warn of the potential side effects of a command. A disclaimer helps.
– Jjed
Sep 1 '12 at 17:07
add a comment
|
Open a terminal using CTRL+Alt+T and execute the below command to remove line 6, which is not correct form of repository source line, thus apt giving you an error about malformed line.
WARNING: Don't execute this command without reading the question first, this command will delete the line 68 of /etc/apt/sources.list
file. Check whether your problem is similar and, even if it is, replace 68
with the number of the line that you need to delete.
sudo sed -i.old '68d' /etc/apt/sources.list
This command will delete the line using sed
in place. It makes a backup called /etc/apt/sources.list.old
. If you don't want the backup then you can use plain -i
instead of -i.old
.
Alternatively, you can manually delete the line with Gedit.
- Press Alt + F2 and type
gksu gedit /etc/apt/sources.list
.
(If you don't havegksu
you can usesudo -H gedit
.) - Find the corrupted
/etc/apt/sources.list
and remove it. - Save and exit Gedit.
Correct form of repository source line:
The correct format of repository source line is:
<type of repository> <location i.e URI> <dist-name> <components i.e main, universe>
For example:
deb http://archive.ubuntu.com/ubuntu precise main
Type:deb
is the type of repo, it indicates it is a binary repository, not a source repository, which has typedeb-scr
.
Location:http://archive.ubuntu.com/ubuntu
location of the repositoryDist-name:
precise
is the distribution name of Ubuntu release. for Ubuntu 12.04 it isprecise
, 11.10 isoneiric
Component:
main
is indicating the component of repository. Ubuntu repository are divided into four parts.
Main - Which contains free and open source software, officially supported
Universe - These softwares are not supported by Canonical, but those are maintained by the community.
Restricted - These softwares are supported by Canonical, but aren't free. These are supported to provide some essential drivers
Multiverse - These are also non-free softwares, and not supported by Canonical.
See this page for more information.
You can now understand that /etc/apt/sources.list
is not a repository source line and hence apt-get
complaining about it.
For more information about Adding and Removing repositories and the format of repository source line, See this Ubuntu Help page.
See the Sed manual page here.
1
Hi, Anwar, this is a good answer, but it is very risk to just have asudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck theirsources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.
– Jjed
Sep 1 '12 at 14:12
add a comment
|
Open a terminal using CTRL+Alt+T and execute the below command to remove line 6, which is not correct form of repository source line, thus apt giving you an error about malformed line.
WARNING: Don't execute this command without reading the question first, this command will delete the line 68 of /etc/apt/sources.list
file. Check whether your problem is similar and, even if it is, replace 68
with the number of the line that you need to delete.
sudo sed -i.old '68d' /etc/apt/sources.list
This command will delete the line using sed
in place. It makes a backup called /etc/apt/sources.list.old
. If you don't want the backup then you can use plain -i
instead of -i.old
.
Alternatively, you can manually delete the line with Gedit.
- Press Alt + F2 and type
gksu gedit /etc/apt/sources.list
.
(If you don't havegksu
you can usesudo -H gedit
.) - Find the corrupted
/etc/apt/sources.list
and remove it. - Save and exit Gedit.
Correct form of repository source line:
The correct format of repository source line is:
<type of repository> <location i.e URI> <dist-name> <components i.e main, universe>
For example:
deb http://archive.ubuntu.com/ubuntu precise main
Type:deb
is the type of repo, it indicates it is a binary repository, not a source repository, which has typedeb-scr
.
Location:http://archive.ubuntu.com/ubuntu
location of the repositoryDist-name:
precise
is the distribution name of Ubuntu release. for Ubuntu 12.04 it isprecise
, 11.10 isoneiric
Component:
main
is indicating the component of repository. Ubuntu repository are divided into four parts.
Main - Which contains free and open source software, officially supported
Universe - These softwares are not supported by Canonical, but those are maintained by the community.
Restricted - These softwares are supported by Canonical, but aren't free. These are supported to provide some essential drivers
Multiverse - These are also non-free softwares, and not supported by Canonical.
See this page for more information.
You can now understand that /etc/apt/sources.list
is not a repository source line and hence apt-get
complaining about it.
For more information about Adding and Removing repositories and the format of repository source line, See this Ubuntu Help page.
See the Sed manual page here.
1
Hi, Anwar, this is a good answer, but it is very risk to just have asudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck theirsources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.
– Jjed
Sep 1 '12 at 14:12
add a comment
|
Open a terminal using CTRL+Alt+T and execute the below command to remove line 6, which is not correct form of repository source line, thus apt giving you an error about malformed line.
WARNING: Don't execute this command without reading the question first, this command will delete the line 68 of /etc/apt/sources.list
file. Check whether your problem is similar and, even if it is, replace 68
with the number of the line that you need to delete.
sudo sed -i.old '68d' /etc/apt/sources.list
This command will delete the line using sed
in place. It makes a backup called /etc/apt/sources.list.old
. If you don't want the backup then you can use plain -i
instead of -i.old
.
Alternatively, you can manually delete the line with Gedit.
- Press Alt + F2 and type
gksu gedit /etc/apt/sources.list
.
(If you don't havegksu
you can usesudo -H gedit
.) - Find the corrupted
/etc/apt/sources.list
and remove it. - Save and exit Gedit.
Correct form of repository source line:
The correct format of repository source line is:
<type of repository> <location i.e URI> <dist-name> <components i.e main, universe>
For example:
deb http://archive.ubuntu.com/ubuntu precise main
Type:deb
is the type of repo, it indicates it is a binary repository, not a source repository, which has typedeb-scr
.
Location:http://archive.ubuntu.com/ubuntu
location of the repositoryDist-name:
precise
is the distribution name of Ubuntu release. for Ubuntu 12.04 it isprecise
, 11.10 isoneiric
Component:
main
is indicating the component of repository. Ubuntu repository are divided into four parts.
Main - Which contains free and open source software, officially supported
Universe - These softwares are not supported by Canonical, but those are maintained by the community.
Restricted - These softwares are supported by Canonical, but aren't free. These are supported to provide some essential drivers
Multiverse - These are also non-free softwares, and not supported by Canonical.
See this page for more information.
You can now understand that /etc/apt/sources.list
is not a repository source line and hence apt-get
complaining about it.
For more information about Adding and Removing repositories and the format of repository source line, See this Ubuntu Help page.
See the Sed manual page here.
Open a terminal using CTRL+Alt+T and execute the below command to remove line 6, which is not correct form of repository source line, thus apt giving you an error about malformed line.
WARNING: Don't execute this command without reading the question first, this command will delete the line 68 of /etc/apt/sources.list
file. Check whether your problem is similar and, even if it is, replace 68
with the number of the line that you need to delete.
sudo sed -i.old '68d' /etc/apt/sources.list
This command will delete the line using sed
in place. It makes a backup called /etc/apt/sources.list.old
. If you don't want the backup then you can use plain -i
instead of -i.old
.
Alternatively, you can manually delete the line with Gedit.
- Press Alt + F2 and type
gksu gedit /etc/apt/sources.list
.
(If you don't havegksu
you can usesudo -H gedit
.) - Find the corrupted
/etc/apt/sources.list
and remove it. - Save and exit Gedit.
Correct form of repository source line:
The correct format of repository source line is:
<type of repository> <location i.e URI> <dist-name> <components i.e main, universe>
For example:
deb http://archive.ubuntu.com/ubuntu precise main
Type:deb
is the type of repo, it indicates it is a binary repository, not a source repository, which has typedeb-scr
.
Location:http://archive.ubuntu.com/ubuntu
location of the repositoryDist-name:
precise
is the distribution name of Ubuntu release. for Ubuntu 12.04 it isprecise
, 11.10 isoneiric
Component:
main
is indicating the component of repository. Ubuntu repository are divided into four parts.
Main - Which contains free and open source software, officially supported
Universe - These softwares are not supported by Canonical, but those are maintained by the community.
Restricted - These softwares are supported by Canonical, but aren't free. These are supported to provide some essential drivers
Multiverse - These are also non-free softwares, and not supported by Canonical.
See this page for more information.
You can now understand that /etc/apt/sources.list
is not a repository source line and hence apt-get
complaining about it.
For more information about Adding and Removing repositories and the format of repository source line, See this Ubuntu Help page.
See the Sed manual page here.
edited Sep 6 '17 at 13:38
Eliah Kagan
93k25 gold badges255 silver badges409 bronze badges
93k25 gold badges255 silver badges409 bronze badges
answered Aug 1 '12 at 13:44
AnwarAnwar
59.9k26 gold badges162 silver badges269 bronze badges
59.9k26 gold badges162 silver badges269 bronze badges
1
Hi, Anwar, this is a good answer, but it is very risk to just have asudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck theirsources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.
– Jjed
Sep 1 '12 at 14:12
add a comment
|
1
Hi, Anwar, this is a good answer, but it is very risk to just have asudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck theirsources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.
– Jjed
Sep 1 '12 at 14:12
1
1
Hi, Anwar, this is a good answer, but it is very risk to just have a
sudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck their sources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.– Jjed
Sep 1 '12 at 14:12
Hi, Anwar, this is a good answer, but it is very risk to just have a
sudo sed
command at the top of it. Many people with the same problem (but slightly different circumstances) will see this answer and willy-nilly run it, and potentially wreck their sources.list
beyond repair. In this case a more general approach (with a text editor) might be in order.– Jjed
Sep 1 '12 at 14:12
add a comment
|
protected by Community♦ Jan 16 '13 at 20:38
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
8
Can you add the content of your
/etc/apt/sources.list
between lines 67 and 69???– Bruno Pereira
Jun 17 '12 at 17:10
2
Edit your question to include the output of the command
cat /etc/apt/sources.list
. And no you don't need to wipe out everything. It is very easy problem (from my experience)– Anwar
Jun 17 '12 at 17:14
You don't need rep points to post the output. However, you do need to format the output as code or it will not let you post the output because you don't have enough rep points to post multiple links. Edit the question and paste the output and then highlight the output and then press CTRL+K to format the output as code and then save the changes.
– mchid
Feb 6 at 16:40