Re-install CasaOS as clean as possible
sudo casaos-uninstall # answer prompted questions
curl -fsSL https://get.casaos.io | sudo bash
Update CasaOS manually via command line
DO NOT run under the Terminal from CasaOS UI, because it kills the UI and thus the update per se
curl -fsSL https://get.casaos.io/update | sudo bash
This is basically the same thing happens behind the scene after clicking update button from UI.
Reset username and password
ls /var/lib/casaos/db/user.db
sudo mv /var/lib/casaos/db/user.db /var/lib/casaos/db/user.db.backup
sudo systemctl restart casaos-user-service.service
After running commands above, visit CasaOS UI again and the welcome screen should present.