Hello everyone,
I’m currently experiencing an issue with my Hestia control panel on an Ubuntu server. Every time the cron job runs to update Hestia (sudo /usr/local/hestia/bin/v-update-sys-hestia-all
), I receive the following error message via email:
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 3, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
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
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 3, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
I have tried the following steps to resolve the issue:
-
Confirmed
python3-apt
is installed and up-to-date: The packagepython3-apt
is installed, and it’s already the newest version (2.4.0ubuntu3
). -
System Update and Upgrade: I ran
sudo apt update && sudo apt upgrade
to ensure all packages are up-to-date. -
Reinstalled
python3-apt
: I removed and reinstalled thepython3-apt
package using:sudo apt remove --purge python3-apt sudo apt install python3-apt
-
Checked Python Path: Verified the Python path to ensure it includes the necessary directories for
apt_pkg
. -
Ran
dpkg --configure -a
: I attempted to fix broken package configurations. -
Reinstalled
command-not-found
package: Tried reinstalling the package that includes/usr/lib/cnf-update-db
.
Despite these efforts, the error persists. I suspect there might be a configuration issue with Hestia or the environment variables that are causing this problem, but I’m not sure how to proceed.
Has anyone faced a similar issue or could provide any suggestions to resolve this? Any help would be greatly appreciated!
Thank you in advance.