mirror of
https://github.com/cloudpanel-io/cloudpanel-ce.git
synced 2026-04-05 20:31:58 +02:00
[Reopen, Enhancement] Use apt-get upgrade and apt-get update instead of just apt upgrade/update in the CLP update script. #298
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @peaklabs-dev on 1/11/2024
CloudPanel version(s) affected
2.4.0
Description
Reopened because it has not been added yet!
In the CLP update script at https://update.cloudpanel.io/v2. you will find these lines almost at the bottom:
And a little further up is the update line.
-> Use apt-get upgrade and apt-get update -> Because if you use the automatic update script for CLP updates, this Warning will appear in the logs (only when there is an update, as far as I can tell):
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.-> This is not causing a problem on the server at the moment, but may cause a problem on the server at some point in the future, just the log Warning is concerning.-> and it is simply not good practice to use apt upgrade in any non-interactive scripts (see solution).
How to reproduce
Use the automatic update script https://www.techbreeze.in/auto-update-securing-cloudpanel/ and watch the log, when there is an update the log will contain the following Warning:
WARNING: apt does not have a stable CLI interface. Use with care in scripts.Possible Solution
Use apt-get instead of just apt, because apt is designed for interactive use on the command line, not for use in scripts. For scripts, you should use apt-get or apt-cache instead, which provide stable, parsable output.
Additional Context
No response