Apply license key via script.

Nov 27, 2023
219
51
28
Netherlands
daniel-dog.com
Hello everyone,

I am currently finishing up my auto configure script for Proxmox VE. (Since I have a standardized configurations and want to have have it automaticly configured.)

Now I have in my script code to deal with installations that get licensed and hosts that do not.
If I provide a license key as the first argument, the script runs:
pvesubscription set $1
pvesubscription update -force

Now my question is:
Can I run "apt update && apt upgrade -y" right after "pvesubscription update -force" or should I wait for some time before updating the system after applying the license key? (And if I should wait, then for how long?)
 
Hi,

You have to check the `pvesubscription get` output and if you see the `status` is active you can issue `apt update && apt dist-upgrade` please don't use apt upgrade, as our recommend.
 
  • Like
Reactions: Daniel-Doggy
Thanks for the license info.
I am gonna check the pvesubscription get command and wait 30 sec if the status is not active.

And why is apt dist-upgrade recommended? (I use Proxmox VE for years but always did it via apt upgrade so some context would be appreciated.)
To my knowledge, apt update is for updating the installed apt packages and apt dist-upgrade will also upgrade the OS (Debian) itself. (And I would like to not do that via apt since I like to reinstall Proxmox VE when Debian gets a new major version to prevent legacy config from sticking around.)
apt update has never caused any issues for me but maybe I am just lucky.
 
And why is apt dist-upgrade recommended?
The apt dist-upgrade and apt full-upgrade is more aggressive. It will attempt to handle changes in package dependencies with new versions of packages and may remove packages if necessary to upgrade the system. This approach can resolve dependency issues that apt upgrade would not address, allowing for a more complete system update. See `man apt`
 
  • Like
Reactions: Daniel-Doggy