Apply license key via script.

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_Dog
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_Dog

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!