Gandi Wiki


Questions

Fixing error when updating Gandi .deb package

Problem

When updating .deb package shipped by Gandi from an older version and if your system is running a Debian Lenny, you could have errors disabling the correct package update process.

Example of error message

Preparing to replace gandi-hosting-agent-plugins-internal-unix 1.0.0-r1623 (using .../gandi-hosting-agent-plugins-internal-unix_1.0.0-r2429_all.deb) ...
Unpacking replacement gandi-hosting-agent-plugins-internal-unix ...
Usage: update-python-modules [-v] [-c] package_directory [...]
             update-python-modules [-v] [-c] package.dirs [...]
             update-python-modules [-v] [-a|-f|-p]
 
update-python-modules: error: Trying to overwrite gandi/hosting/agent/AgentConfig.py which is already provided by /usr/share/python-support/gandi-hosting-agent
dpkg: warning - old post-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
dpkg: error processing /var/cache/apt/archives/gandi-hosting-agent-plugins-internal-unix_1.0.0-r2429_all.deb (--unpack):
 there is no script in the new version of the package - giving up

Solution

Due to method changing in Python file managment, the update-python-modules command fail when updating. To fix the problem, simply add an echo in the correct place (see below) in the postrm files.

        cd /var/lib/dpkg/info
        vim gandi-hosting-agent-plugins-internal-unix.postrm

Change :

        if [ -d /usr/share/python-support/gandi-hosting-agent/ ] && \
            which update-python-modules >/dev/null 2>&1; then
            update-python-modules -c -i /usr/share/python-support/gandi-hosting-agent/
            update-python-modules -i /usr/share/python-support/gandi-hosting-agent/
        fi

with : (just add echo in front of the call of update-python-modules)

        if [ -d /usr/share/python-support/gandi-hosting-agent/ ] && \
            which update-python-modules >/dev/null 2>&1; then
            echo update-python-modules -c -i /usr/share/python-support/gandi-hosting-agent/
            echo update-python-modules -i /usr/share/python-support/gandi-hosting-agent/
        fi

Packages should be in incomplete installation state. You will be able to configure them correctly with :

        aptitude safe-upgrade

And then resune the previous update process with your previous command which trigger the error.

Questions

No question on this page and its children.

RSS feed for questions matching this filter (Help)

Last modified: 06 Oct 2009 at 10:54 by Nicolas C. (Gandi)