12.04 - Ubuntu Software Centre and Update Manager is not working

19
2014-04
  • Answers
  • Marvin Püthe

    I would check if sources.list can be opened. Look into /etc/apt and see if there is a file named sources.list. I would then rename it in sources.list.bak. And then go into Ubuntu Software Center and to Software-Sources. Check the boxes you would like to have in your sources.

    Try it again and it should work correctly.

  • Eric Carvalho
    sudo nano /etc/apt/sources.list
    

    remove the " " marks on the lines that have been added recently. save and exit then restart software updater it should run normally

    I got it up and running again like that.


  • Related Question

    apt - How do I fix a "Problem with MergeList" or "status file could not be parsed" error when trying to do an update?
  • Questioner

    The computer gave me this output in a window:

    E: Encountered a section with no Package: header
    E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
    E: The package lists or status file could not be parsed or opened.
    

    How can I fix this?


  • Related Answers
  • Gediminas Jeremiah Gudelis

    These terminal commands should solve your problem:

    First remove the Merge List by opening a terminal (Press Ctrl+Alt+T to launch) and run this command:

    sudo rm /var/lib/apt/lists/* -vf
    

    Next, generate a new one by running a simple update:

    sudo apt-get update
    

    Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.

  • Jorge Castro

    Open a Terminal and run the following commands one at a time:

    sudo rm /var/lib/apt/lists/* -vf
    sudo apt-get update
    

    See also:

  • Gilles

    You screwed up when you edited /var/lib/dpkg/status. Restore it from the backup that you made before editing it. Of course, you made a backup, right?

    Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.

    You can use /var/lib/dpkg/status.old as a reference point. This is a backup of the status file from before the last time dpkg was run. Run

    diff /var/lib/dpkg/status.old /var/lib/dpkg/status
    

    to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg run.

    If you really can't manage to repair the file, copy /var/lib/dpkg/status.old over /var/lib/dpkg/status. You will get a well-formed, but out-of-date package database.

    You never need to edit /var/lib/dpkg/status in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status is not something that tends to require administrator intervention. Whatever your problems with crossplatformui were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status was when an upstream Packages file was broken.

  • Peachy

    I did

    sudo apt-get clean
    sudo apt-get update
    

    and it worked.

  • Eliah Kagan

    Following steps 2-5 in the Package Manager Troubleshooting Procedure usually solves this problem.

    For step 2, disable all your PPAs. You can uncheck all of them in Software Sources the same way you'd uncheck just one; see How to disable a particular PPA?. You can re-enable them later.

    For step 3, close any open programs you can. It's probably safe to keep your web browser open so you have your instructions in front of you. But it's particularly important to make sure any package managers are not running. This include the Software Center, the Software Updater (Update Manager in older versions of Ubuntu), Synaptic, and Gdebi. It also includes command-line package management utilities like apt-get, dpkg, and aptitude.

    Note that if other users are logged on at the same time, they should log off if possible.

    For step 4, open a terminal window. One way to do this that works no matter what desktop environment you use, is to press Ctrl+Alt+T.

    For step 5, run these commands in the terminal window:

    ubuntu-support-status
    sudo grep -R proxy /etc/apt/*
    grep proxy  /etc/environment
    echo $http_proxy
    echo $ftp_proxy
    grep proxy /etc/bash.bashrc
    grep proxy ~/.bashrc
    cat /etc/apt/apt.conf
    sudo fuser -vvv /var/lib/dpkg/lock
    sudo fuser -vvv /var/cache/apt/archives/lock
    cat /etc/lsb-release
    uname -a
    sudo rm /var/lib/apt/lists/lock 
    sudo rm  /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock
    sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
    sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
    sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status  ||  sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
    sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
    sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
    sudo rm -rf /var/lib/dpkg/updates/*
    sudo rm -rf /var/lib/apt/lists
    sudo rm /var/cache/apt/*.bin
    sudo mkdir /var/lib/apt/lists
    sudo mkdir /var/lib/apt/lists/partial
    LANG=C;sudo apt-get clean
    LANG=C;sudo apt-get autoclean
    LANG=C;sudo apt-get --purge autoremove
    LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
    sudo dpkg --configure -a
    sudo dpkg --clear-avail
    LANG=C;sudo apt-get -f install
    LANG=C;sudo apt-get --fix-missing install
    LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
    find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
    

    I copied that verbatim from PackageManagementTroubleshoootingProcedure on 2 March 2014. Those commands have evolved in the past and the recommended commands in that article may be changed or expanded on again in the future. So you may want to work from step 5 there. (That article, created/edited by "Contributors to the Ubuntu documentation wiki"--especially Mark Rijckenberg--is licensed CC-BY-SA 3.0, which allows inclusion here with proper attribution.)

    Some of those commands attempt to fix the problem (and also may show diagnostic information); others display valuable information about the problem that you can include in your question or otherwise provide to someone helping you. (Or, depending on your skills, may enable you to diagnose and solve it.)

    Often this fixes it but when it doesn't it often gives enough information to fix it.

    You don't have to manually type those commands; you can copy and paste them. I recommend pasting and running each one separately, though. This makes it clearer what output is from which commands.

  • Marco Ceppi

    I have also seen this problem occur when you have too many sources in your repos.

    Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:

    sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
    sudo mkdir -p /var/lib/apt/lists/partial
    sudo apt-get update
    

    Let us know how you get on.

  • Braiam

    After your update, the way to solve this is running:

    sudo rm -r /var/lib/apt/lists
    sudo mkdir -p /var/lib/apt/lists/partial
    sudo apt-get update
    

    Now you have the error gone and can use the USC again.


    How do I find out what the dependencies were, and how do I fix them?

    Open the terminal using Ctrl + Alt + T, then type:

    sudo apt-get clean
    sudo apt-get update
    sudo apt-get -f install
    sudo dpkg --configure -a
    sudo apt-get upgrade
    

    You can also use sudo apt-get check to check for dependencies issues.