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

Whenever I try to open Ubuntu Software Center, it closes automatically within a few seconds. When I try to run an update from the command prompt this happens:

anujsharma@anuj-sharma:~$ sudo apt-get update
E: Malformed line 59 in source list /etc/apt/sources.list (dist parse)
E: The list of sources could not be read.

The line 59 in source list /etc/apt/sources.list is:

deb http://archive.canonical.com/ $(lsb_release-sc)partenr

My sources.list file is as follows:

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

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise universe
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb http://archive.canonical.com/ $(lsb_release-sc)partenr
deb-src http://archive.canonical.com/ $(lsb_release-sc)partenr
deb-src http://extras.ubuntu.com/ubuntu precise main

Now it is very frustrating to me. Please help me to get rid of this error. I am not even able to install anything or even update either from the terminal, Update Manager or even from the Ubuntu Software Center.

share|improve this question
    
See this, remove the corrupt line. –  Alex Aug 9 '13 at 1:49
add comment

3 Answers

Are you sure that the line deb http://archive.canonical.com/ $(lsb_release-sc)partenr isn't supposed to be deb http://archive.canonical.com/ $(lsb_release-sc)partner?

My guess would be that the 'malformed line' error is as a result of a typo in the word 'partner'

EDIT: And it would appear that the next line (line 60) also has the same error, assuming it is one.

You may also need a space before the word 'partner' for this to work (haven't tested it, so I can't say for sure). As a comparison, a similar line in my sources file is:

deb http://extras.ubuntu.com/ubuntu raring main

share|improve this answer
add comment

You've got two typo errors, in lines 58 and 59 of your /etc/apt/sources.list file. These two lines are for the Canonical Partner Repository for Skype. What you currently have in lines 58 and 59 is as follows:

deb http://archive.canonical.com/ $(lsb_release-sc)partenr
deb-src http://archive.canonical.com/ $(lsb_release-sc)partenr

You should edit these two lines so that they are as follows:

deb http://archive.canonical.com/ $(lsb_release -sc) partner
deb-src http://archive.canonical.com/ $(lsb_release -sc) partner

By "as follows" in the above mentioned line I mean "exactly as follows", spaces are important too. In order to edit the sources.list file, open the terminal and run:

sudo nano '/etc/apt/sources.list'

If you've never used nano before, it's quite easy - the instructions for saving the file and closing nano are always located at the bottom of the page in nano. To save a file in nano, use the keyboard combination Ctrl + O and after that press Enter. To exit nano, use the keyboard combination Ctrl + X.

Now, as a one-off, you should tell your system to pull down the latest list of software from each archive it knows about, including the Canonical Partner Repository for Skype you just changed by editing sources.list:

sudo apt-get update 
share|improve this answer
add comment

Replace the old sources.list with the new one

Run the following commands in a Terminal.

sudo mv /etc/apt/sources.list /etc/apt/sources.list.old

gksudo gedit /etc/apt/sources.list

Copy/paste all the text from the newly generated sources.list to this file. Save it and close Gedit.

Now, update apt.

sudo apt-get update
share|improve this answer
    
he on using this command...2. command returns a blank sources.list file. –  anujsharma9196 Aug 10 '13 at 1:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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