02 - Upgrading CyberPanel

Create a bash file example update.sh

#!/bin/bash
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)

And let it run in a crontab at a time interval you want.

I got this error when I try to upgrade to the lasted version.
Can anyone help?
Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘/usr/local/CyberCP/bin/python3’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘/usr/local/CyberCP/bin/python3’
sys.base_prefix = ‘/usr’
sys.base_exec_prefix = ‘/usr’
sys.executable = ‘/usr/local/CyberCP/bin/python3’
sys.prefix = ‘/usr’
sys.exec_prefix = ‘/usr’
sys.path = [
‘/usr/lib/python38.zip’,
‘/usr/lib/python3.8’,
‘/usr/lib/lib-dynload’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x00007f36f7155740 (most recent call first):

above command failed…

please fix this i cant upgrade the cyberpanel ubuntu 22

‘int’ object has no attribute ‘execute’
Traceback (most recent call last):
File “/root/cyberpanel_upgrade_tmp/upgrade.py”, line 842, in applyLoginSystemMigrations
cursor.execute(“UPDATE loginSystem_acl SET config = ‘%s’ where name = ‘admin’” % (Upgrade.AdminACL))
AttributeError: ‘int’ object has no attribute ‘execute’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/root/cyberpanel_upgrade_tmp/upgrade.py”, line 3072, in
main()
File “/root/cyberpanel_upgrade_tmp/upgrade.py”, line 3068, in main
Upgrade.upgrade(args.branch)
File “/root/cyberpanel_upgrade_tmp/upgrade.py”, line 2976, in upgrade
Upgrade.applyLoginSystemMigrations()
File “/root/cyberpanel_upgrade_tmp/upgrade.py”, line 845, in applyLoginSystemMigrations
import sleep
ModuleNotFoundError: No module named ‘sleep’
above command failed…

You can create an alias to simplify the upgrading/update CyberPanel command. Aliases in Linux allow you to create shortcuts for long or complex commands, making them easier to remember and execute. In this case, you can add an alias in your shell configuration file, such as .bashrc or .zshrc, depending on your environment.

Here’s how to do it for a Bash shell, which is common on many Linux systems. Open your .bashrc file in a text editor:

nano ~/.bashrc

Then, add a line at the end of the file to create your alias. For example, you could name it update_cyberpanel :

alias update_cyberpanel="sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)"

Save and close the file. Next, for the changes to take effect, reload your .bashrc by running:

source ~/.bashrc

Now, instead of typing the entire command, you can simply type update_cyberpanel in your terminal to execute the CyberPanel update script.

Please note that this alias will be available only for your current user and only in shell sessions that load the .bashrc file.

image
:white_check_mark:

1 Like

From V2.3.5, you can upgrade or downgrade the CyberPanel version from the versionManagment page.
PS: This feature is Beta in V2.3.5, the safest option is still to use the SSH command.

Hello, I just upgrade to:

Cyberpanel: 2.3
Build: 5
Current Commit: ef026d0ffabec88133a1f672519ba20a8df5e2ed

I have used:

sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)

My Server is Ubuntu 22.04

But OLS has not been upgraded, into OLS panel I still see:

CURRENT VERSION: OpenLiteSpeed 1.7.19 [New Release: 1.8.1]

How I can proceed?
Thank you for your time.

1.7.19 is the latest “stable” release. Be patient, once 1.8.1 becomes stable Cyberpanel will upgrade it automatically.

1 Like

Thanks a lot! have a great day!

Any way to automate the update process?