这是执行sudo apt update 的报错
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
原因是我将python从3.12升级为了3.13。
解决办法:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1