Unofficial updater script for Proxmox VE (HOST / LXC / VM )

BassT

Member
Jan 3, 2023
55
9
8
Hi all,

I made an Update Script, with it you can update all LXC Containers within an Host or within your hole Cluster.

https://github.com/BassT23/Proxmox

The Script will run headless, so you can run it with a cron job or similar, if you want.

If the script detect a Cluster, it automatically run in "Cluster Mode". Otherwise it run the "Host Mode"
You also can run the "Host Mode" in your Cluster with "update -1". For more info type "update -h"

In later version, there will come an option, to run extra commands for specific Containers, like a pihole need update with "pihole -up".

The hole Update will be logged, so you can check, if there are any errors.
Also the is an exit code implemented, with this it is possible, to inform you about errors during the update.

If anybody want to help, to make the script better, you're welcome.

CU @ll
BassT
 
Last edited:
  • Like
Reactions: esi_y and Dunuin
Proxmox® is a registered trademark of Proxmox Server Solutions GmbH.

I am no member of the Proxmox Server Solutions GmbH. This is not an official programm from Proxmox!

This is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.


Screenshot_20230321_055444.png

Features:

- Update Proxmox (the host / all cluster nodes / all included LXCs and VMs)
- Normal run is "Interactive" / Headless Mode can be run with `update -s`
- Logging
- Exit tracking, so you can send additional commands for finish or failure (edit files in `/root/Proxmox-Updater/exit`)
- Config file

Info can be found with update -h


Installation:

In Proxmox GUI Host Shell or as root on proxmox host terminal:
bash <(curl -s https://raw.githubusercontent.com/BassT23/Proxmox/master/install.sh)

If you want to update the VMs also, please install and run `qemu-guest-agent` on VM.
check out here: https://pve.proxmox.com/wiki/Qemu-guest-agent for more infos.


Update the script:

update -up

If update run into issue, please remove first with:
bash <(curl -s https://raw.githubusercontent.com/BassT23/Proxmox/master/install.sh) uninstall
and install new


Extra Updates:

If updater detects Installation: (disable, if you wand in /root/Proxmox-Updater/update.conf)
- PiHole
- ioBroker
- Pterodactyl
- Octoprint
- Docker Container Images


Config File:

The config file is stored under /root/Proxmox-Updater/update.conf

With this file, you can manage the updater. For example; if you don't want to update PiHole, comment the line out with #, or change "true" to "false".

- Host / LXC / VM
- Headless Mode
- Extra updates
- "stopped" or "running" LXC/VM
- "only" or "exclude" LXC/VM by ID


Welcome Screen:

The Welcome Screen is an extra for you. Its optional!

Can be installed or uninstalled with:
bash <(curl -s https://raw.githubusercontent.com/BassT23/Proxmox/master/install.sh) welcome

- The Welcome-Screen brings an update-checker with it. It check on 07am and 07pm for updates via crontab. The result will show up in Welcome-Screen (Only if updates are available).
- The update-checker also use the config file!
- To force the check, you can run `/root/Proxmox-Updater/check-updates.sh` in Terminal.
- Need neofetch to be installed (if not installed, script will make it automatically)


Beta Testing:

If anybody want to help with failure search, please test our beta (if available).
Install beta update with:
bash <(curl -s https://raw.githubusercontent.com/BassT23/Proxmox/beta/install.sh) update


Credits:

@Uruk - for help with the code
 
Last edited:
Release v3.7
Proxmox-Updater


Added:

  • Welcome Screen with update check (via cron)
  • support "only" for LXC/VM

Fixed:

  • VM-Update show now errors
  • Docker-Compose update
  • LXC/VM Updates
 
@BassT

Please do not use the word "Proxmox" in the name of your script.

=> read more on https://www.proxmox.com/en/news/media-kit
Ok, please give me some time for changing.

EDIT:
I made an issue for name changing:
https://github.com/BassT23/Proxmox/issues/56

I also contacted office@proxmox.com for more support

EDIT2:
I had answer from office.
"You can also, for example, mention this sentence somewhere: Proxmox® is a registered trademark of Proxmox Server Solutions GmbH."

So, I will add the R Logo with Info, shortely

EDIT3:
@tom Why I can't edit the first post?
 
Last edited:
Release v3.8
Proxmox-Updater

Add:​

  • SSH Connection for VM - with extra update support
  • "Global Extra" in config file, for disable/enable Extra Updates
  • Add "Status/Version" Info
  • Info, if you are on beta/development version
  • Welcome Screen:
    • Ask for Welcome-Screen during install
    • Make update check during update now - not at the end
    • Add "reboot required"

Fixed:​

  • Bug fixing
  • Welcome Screen:
    • Time calculation

Extras:​

  • Cleaning code
 
I am really not a big fan of such scripts, so I highly recommend not to use third party tools unless you are able to understand the script in full.

@BassT: Proxmox is our company name and trademark, not a product name.

So it seems you are talking about Proxmox VE here, I suggest you use the correct naming in your script/docs.
 
  • Like
Reactions: BassT
@BassT: Proxmox is our company name and trademark, not a product name.
I am fully respect these, so I add an info about the leagal rights on github and here on secound post, after talking with office@proxmox.

Have a nice day
BassT
 
I am fully respect these, so I add an info about the leagal rights on github and here on secound post, after talking with office@proxmox.

Have a nice day
BassT
I mean your docs on - https://github.com/BassT23/Proxmox- you still talk about:

"Update Proxmox" ...

=> should be: Update Promxox VE

Anyways, I cannot recommend using scripts like this (big warning for non experts!)
 
I mean your docs on - https://github.com/BassT23/Proxmox- you still talk about:

"Update Proxmox" ...

=> should be: Update Promxox VE

Anyways, I cannot recommend using scripts like this (big warning for non experts!)
OK , its changed ;)

Because of the warning, I also warn on several points, that an update always could make strange things. Because of knowing this, the script is made save as I can.

On the first error, the script stop directly, to not run in an total crash.
At no time, the script try to skip or try to fix crashes by itself.

Also, I build in an logfile and and option, to send message, if the script run in an error, or finished with exit code 0.

But you are totally right, to don't run such an script without had in mind, that something could go wrong.

Feel free to have a look on it. ;)
 
I'll just say that I like the script very much. Cluster wide updating is something Proxmox VE does not provide at all, and I've never seen in a roadmap.

In various scenarios having something (script or other) to manage security updates en masse is useful. Just an opinion.
 
  • Like
Reactions: BassT
2018/11 Idea
2019/10 more idea
2023/02 hope

I made something, and a lot of user, like me, like it ;)
 
Doing apt-get -o APT::Get::Always-Include-Phased-Updates=true dist-upgrade -y + apt-get --purge autoremove -y blindly sounds like a disaster in the making, depending on the repo config it will just remove various packages and then even remove all configs (i.e. user data) automatically, pulling in bash code straight from the internet directly to the shell, no code signing what's over, that then probably our support needs to bathe out.
2018/11 Idea
2019/10 more idea
2023/02 hope
Yeah sure, if we did not care for safety of our (especially newer/inexperienced) users we wouldn't have required to put some ideas together at all, a lot of things would be easy by just yolo'ing them in; but there's a reason Proxmox VE exist since well over a decade and not exposes their user to automated breakage potential by just spearheading things without a good idea and design how to address or prevent the various problems and potential road bumps for our users...

I mean, instead of sarcastic replies and hacking together you could've contributed a sane system like partially described in the report to Proxmox VE too.

And please don't get me wrong, great that you made something that you like and shared it in the spirit of FOSS, and the reason we want to have that clarified for users that this hack does not come from us nor is encouraged to be used comes from the years of experience where we had to help so many inexperienced users that just pulled in some random script or patch which were not really lowering the barrier for them (as often advertised) put exposing them to breakage in the waiting.
We already put some protections in to reduce risk potential of such, so lets hope this won't cause too many problems for our users and/or work for us.
 
I would at least wait for the PVE host backup feature from the roadmap to become implemented. That way you could at least restore the host in case an automatic upgrade totally screws everything up.
 
Doing apt-get -o APT::Get::Always-Include-Phased-Updates=true dist-upgrade -y + apt-get --purge autoremove -y blindly sounds like a disaster in the making, depending on the repo config it will just remove various packages and then even remove all configs (i.e. user data) automatically, pulling in bash code straight from the internet directly to the shell, no code signing what's over, that then probably our support needs to bathe out.

I'm learning friendly, so if there are any suggestions, I'll try to fix the code.

I now read about phase updates and decided to change the code, to disable that.

I want to say, I make this as my hobby, not for work. So, If anybody know, how to make the script better, let me know ;)

I mean, instead of sarcastic replies and hacking together you could've contributed a sane system like partially described in the report to Proxmox VE too.
Sorry for that :) I don't want to be unfriendly.
I want to help user with my scrip only. Because of that its on github, and everybody can check.

great that you made something that you like and shared it
Thanks for that ;)

Best regards
BassT
 
Hi BassT,
Please can you help, been running your script for a while and it's great thank you. Have just run into an issue, have just had to update to Kernal 6.5.3 from the test repository to fix an nvme issue. Now when running the script i get an error when updating the host..... "Error during Update --- Exit Code: 100".
Your help file mentions logs but where are they located please?
 
Hi @GeeSoft,
for help, I need more infos.
If you like, you could also make an issue on github.

What try the script to do, if the error comes up?
On what for an "machine"?
Please post the log from the machine, which run into the issue.

The log file is in
Code:
/var/log/update-"$HOSTNAME".log

After a little search, I found the test repo, but don't use it for now.
If I find time, I try the repo out. Where to find the changelog about it?
What for issues with nvme you had? I use two proxmox hosts with nvme without any issues - I think :D

If you want to talk directly, you can also use discord
 
Last edited:
Release v4.0

Unofficial Proxmox-Updater

Add:​

  • Real snapshot support before update - if your storage setup support it
  • Choose, if neofetch will be installed during installation

Fixed:​

  • Loop through VMs
  • New docker compose command
  • Alpine issue (disable internet check for now)

Extras:​

  • Cleaning code
 
Last edited:
Trying it right now, like it so far. I might be interesting to look at topgrade, which also upgrade flatpack snap cargo pip ... packages
 
  • Like
Reactions: BassT

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!