apt-file update should *not* be run in postinst without any feedback (was: [Feisty->Gutsy] apt-file causing upgrade to fail)

Bug #154180 reported by Jingyu Zou
20
Affects Status Importance Assigned to Milestone
apt-file (Ubuntu)
Fix Released
High
Daniel Hahler

Bug Description

Binary package hint: update-manager

Upgrade from Feisty to Gutsy using update-manager failed.

The update-manager was freezing for like an hour at the package 'apt-file' setup stage. After I stopped it by pressing Ctrl+C, the upgrade continued to work for a short while but finally crashed because of the previous apt-file error.

My machine is a Thinkpad T43 with all the latest Feisty updates applied before the upgrade.

Revision history for this message
Jingyu Zou (jingyu-zou) wrote :
Revision history for this message
Jingyu Zou (jingyu-zou) wrote :
Revision history for this message
Jingyu Zou (jingyu-zou) wrote :
Revision history for this message
Jingyu Zou (jingyu-zou) wrote :
Jingyu Zou (jingyu-zou)
description: updated
Jingyu Zou (jingyu-zou)
description: updated
Revision history for this message
Michael Vogt (mvo) wrote : Re: [Feisty->Gutsy] apt-file causing upgrade to fail

From the logs:
"""
Setting up apt-file (2.0.8.2ubuntu2) ...
Installing new version of config file /etc/bash_completion.d/apt-file ...
q

dpkg: error processing apt-file (--configure):
 subprocess post-installation script killed by signal (Interrupt)
"""

It appears that apt-file runs the follow bits in its postinst:

                apt-file update || true

This means that one (or more) ~14Mb file(s) are fetched. This is something that should not be done in a postinst script without asking.

Changed in update-manager:
importance: Undecided → High
milestone: none → gutsy-updates
status: New → Confirmed
Revision history for this message
Daniel Hahler (blueyed) wrote :

I'll remove this postinst snippet completely.

Changed in apt-file:
status: Confirmed → In Progress
assignee: nobody → blueyed
Revision history for this message
era (era) wrote :

In that case I suppose bug #74097 will need to be reopened, or changed to "wontfix". Probably you noticed, but noting here just to be on the safe side.

I'd love to see a standard cron job which runs in the background every day? week? and once soon after installation.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Thanks for pointing this bug out, I wasn't aware of it.
I've just discussed this on IRC with persia:
<persia> blueyed: I think it requires a few things. 1) Dropping the automatic update, 2) Adding a notification, 3) checking at runtime, and suggesting an update if the cache is missing.

I will implement that for the next upload.

Revision history for this message
era (era) wrote :

Incidentally, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405927 is about setting up a cron job for periodically downloading the latest Contents files.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-file - 2.0.8.2ubuntu3

---------------
apt-file (2.0.8.2ubuntu3) hardy; urgency=low

  * Improved "need to run apt-file update" experience (LP: #154180)
    - debian/apt-file.postinst:
      - Do not call apt-file update anymore directly
      - install update-notifier hook
    - debian/control: Depend on "menu" for su-to-root
    - apt-file: test if the cache directory is empty for actions
      search/find and show/list.
  * apt-file: reverted removal of leading slash in pattern and implement
    logic to match both without slash at the beginning and with slash
    inside (LP: #181600). Apply the same logic to regexp patterns (-x).
  * debian/rules:
    - moved DH_COMPAT=3 to debian/compat (increased to 5)
    - Fixed debian-rules-ignores-make-clean-error
    - Dropped binary-arch target
  * Fix typos/wording in README
  * apt-file.conf: Add integrity check for fetched files (LP: #176753)
  * apt-file: find_command: remove leading spaces and open parentheses
    before looking for the command, so that the new defaults in
    apt-file.conf work
  * apt-file: print output from command after executing it, so that
    errors and notes from there get to the user
  * debian/apt-file.postrm: added DEBHELPER marker
  * debian/control:
    - Dropped Build-Depends-Indep: debhelper (>> 3.0.0)
    - Build-Depends: debhelper (>= 5), cdbs
    - Standards-Version: 3.7.3
    - Recommend "file", which gets used optionally for the integrity check
  * apt-file.bash_completion: filename/directory completion for "search",
    patch taken from Debian bug #448358
  * apt-file/do_grep: only search in all cache files once (LP: #174134)
  * apt-file: fix display of warning in purge_cache, if the file cannot be
    deleted
  * Applied patches from Kevin Glynn in a lot of places, see Debian bug
    #382312). Thanks!
  * Support files in /etc/apt/sources.list.d/ (LP: #190602) (Closes: #353275)
    Patches from Amos Shapira and Andrew Schulman.

 -- Daniel Hahler <email address hidden> Fri, 15 Feb 2008 00:18:52 +0100

Changed in apt-file:
status: In Progress → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

era, I don't think it makes sense to update the cache daily: it rarely changes.. at least as long as *-updates etc have no Contents file.

Please file new bugs for anything you may find, if there's not one already and link it to the existing Debian bug in Launchpad, if there is any. You can do so through the "Also affects..." link.
Thank you.

Revision history for this message
Ye (ye-yang) wrote :

I have the same problem as the first post, and then I downloaded and unzipped apt-file - 2.0.8.2ubuntu3 to my computer, and try to replace the apt-file - 2.0.8.2ubuntu2 with it. But either I used "sudo apt-get apt-file" or "sudo apt-get update", but the apt-file seems still apt-file - 2.0.8.2ubuntu2, thus my upgrade of Ubuntu still failed because of apt-file - 2.0.8.2ubuntu2's bug. I also tried to use "System->Administration->Synaptic Package Manager" but only - 2.0.8.2ubuntu2 is listed.

Can anyone tells me how I can update my apt-file - 2.0.8.2ubuntu2 to apt-file - 2.0.8.2ubuntu3? Thanks for the help in advance.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Ye, you may uninstall apt-file, do the upgrade and install it afterwards again.
Although I find it strange that the old bug would still happen during an upgrade, since the new postinst script should get used.

However, you can get the version used in Hardy at: https://edge.launchpad.net/ubuntu/+source/apt-file/2.1.0

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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