1
2
3
4
5
6
7
8
9
10
11
12
13
14
post_remove() {
    EXTRAMODULES='extramodules-3.0-lts'
    depmod $(cat /lib/modules/$EXTRAMODULES/version)
}

post_install() {
        post_remove
    echo 'In order to use nvidia module, reboot the system.'
}

post_upgrade() {
        post_remove
        rmmod nvidia || echo 'In order to use the new nvidia module, exit Xserver and unload it manually.'
}