Deal with low level apt error messages

Bug #1063097 reported by Sebastian Heinlein
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Triaged
High
Sebastian Heinlein

Bug Description

There can be an exception from apt at several times. Unfortunately APT only shows a translated error message and no codes. Often it is unclear what the user should do.

Furthermore there can be a broken system, e.g. delted /var/lib/dpkg/updates (bug 791715) or failing to open TagSection

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

    <https://wiki.ubuntu.com/SoftwarePackageOperations#general>: "If a file needed by apt is missing or unparseable, the alert should have primary text “Software can’t be installed or removed because an essential file is unreadable.”, and secondary text “No changes were made. To fix the problem, restore the file from backup, or reinstall Ubuntu.”"

E:Write error - write (28: No space left on device), E:Can't mmap an empty file, E:The package lists or status file could not be parsed or opened.

    <https://wiki.ubuntu.com/SoftwarePackageOperations#general>: "If there is not enough disk space, the primary text should be “Software can’t be installed or removed because there is not enough disk space.”, and secondary text “No changes were made. Deleting other unwanted files may free up enough disk space.”"

E: The package google-chrome-stable needs to be reinstalled, but I can't find an archive for it.

E:Type 'http://ppa.launchpad.net/pdfmod-team/ppa/ubuntu' is not known on line 2 in source list /etc/apt/sources.list.d/pdfmod-team-ppa-maverick.list

    <https://wiki.ubuntu.com/SoftwarePackageOperations#general>: "For any other error, the primary text should be “Software can’t be installed or removed because of an unknown error. Sorry about that.” and secondary text “No changes were made.”."

SystemError: E:The package index files are corrupted. No Filename: field for package ubufox.

    <https://wiki.ubuntu.com/SoftwarePackageOperations#general>: "If a file needed by apt is missing or unparseable, the alert should have primary text “Software can’t be installed or removed because an essential file is unreadable.”, and secondary text “No changes were made. To fix the problem, restore the file from backup, or reinstall Ubuntu.”"

Tags: bot-comment
Changed in aptdaemon:
status: New → Triaged
importance: Undecided → Medium
description: updated
description: updated
description: updated
description: updated
description: updated
Changed in aptdaemon:
importance: Medium → High
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

So does this need fixing in apt, not just aptdaemon? If apt returned an error code, not just a translated error message, the aptdaemon GUI could offer ways of recovering from the error. For example, the "No space left on device" error might trigger an apt-get autoremove. The "The package lists or status file could not be parsed or opened" error (why isn't that two separate errors?) might trigger regenerating the package list or restoring it from backup. And so on.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

I plan to only send untranslated messages from apt and try to parse them.

Many problems could be handled by the RepairSystem() method.

But what should we do if the system seems to be seriously broken? The user removed e.g. essential system executables, e.g. dpkg itself? Things that we cannot repair anymore.

An automatic autoremove doesn't seem to be a good idea, since it could deinstall software the user is used to but that has been installed as a dependency. Computer janitor is still supported?

Changed in aptdaemon:
assignee: nobody → Matthew Paul Thomas (mpt)
Changed in aptdaemon:
status: Triaged → In Progress
Revision history for this message
John (j-p-m2005) wrote :

Hi,

I think I am getting a bug that may belong in this section.
Please see the screen shot attached.
I also have a recurring problem every time I use my computer which I have reported using the automated service on a many occasions without resolution, and which has been continuing for months now.
If mine are seperate problems to those in this section, I apologise - I am a relative newby on linux systems, so please forgive my ignorance!

Changed in aptdaemon:
status: In Progress → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Reviewing your bug report it seems that you are experiencing bug 346386. This issue happens when you have tried to update your package information when you are a network that didn't return the right files. This issue can be cleaned up by using the following commands in a terminal:

1.) sudo rm /var/lib/apt/lists/*
2.) sudo apt-get update

Thanks and good luck!

[This is an automated message. I apologize if it reached you inappropriately; please reopen the bug task if it was incorrect.]

tags: added: bot-comment
affects: aptdaemon → aptdaemon (Ubuntu)
Changed in aptdaemon (Ubuntu):
status: Fix Released → In Progress
no longer affects: ubuntu
description: updated
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Specification updated. <https://wiki.ubuntu.com/SoftwarePackageOperations?action=diff&rev2=39&rev1=38>

I've left the "...needs to be reinstalled but I can't find an archive" and "Type ... is not known" errors in the "unknown error" bucket, because I don't know what useful advice or recovery we could offer for those. If you provide more details, I can flesh those out more.

Changed in aptdaemon (Ubuntu):
assignee: Matthew Paul Thomas (mpt) → Sebastian Heinlein (glatzor)
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.