[pve-devel] Hack to circumvent the "apt-get upgrade" problem

Andreas Steinel a.steinel at gmail.com
Wed Mar 8 23:16:24 CET 2017


Hi,

on the forums, there are often problems regarding inproper upgrade of
Proxmox VE. Maybe this can be handled better by a small hack.
Unfortunately, I did not found any apt hook to fire in such a situation and
I don't think it's manageable to handle this in the apt-get source package,
so a simple proxy-script could do the trick.

Normally, you have this path environment in a default install:

    root at proxmox:~# echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

so you can write a really simple hack (yes, dead stupid simple and of
course error prone) but it will reduce the errors made by 'apt-get upgrade'
calls:

    root at proxmox:~# cat /usr/local/bin/apt-get
    #!/bin/sh

    if [ "$1" = "upgrade" ]
    then
        echo "Error: Please do not use 'apt-get upgrade' with Proxmox VE"
        echo "       use 'apt-get dist-upgrade' instead."
        echo ""
        echo "       Further information can be found here:"
        echo "
http://pve.proxmox.com/wiki/Downloads#Update_a_running_Proxmox_Virtual_Environment_4.x_to_latest_4.4
"
        exit 1
    fi

    /usr/bin/apt-get $*

Would it be acceptable to include this in PVE? What ideas do you guys have
to circumvent this?

Best,
LnxBil



More information about the pve-devel mailing list