1 (edited by heeter 2024-02-05 11:08:06)

Topic: mlmmjadmin python error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version 1.6.8
- Deployed with iRedMail downloadable installer?
- Linux/BSD distribution name and version: Ubuntu20LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi All

just did a Ubuntu18LTS to Ubuntu20LTS update following the guide.

One step is to  Upgrade mlmmjadmin

I am getting this pyhton error:

root@mail:~/mlmmjadmin-3.1.9/tools# bash upgrade_mlmmjadmin.sh
* Detected Linux/BSD distribution: UBUNTU
Install package: python3 python3-pip python3-requests uwsgi-plugin-python3 python3-pymysql
Install required packages:  uwsgi-plugin-python3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 uwsgi-plugin-python3 : Depends: libpython3.8 (>= 3.8.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
<<< ERROR >>> Failed to install required packages, please try to install them manually:  python3 python3-pip python3-requests uwsgi-plugin-python3 python3-pymysql
root@mail:~/mlmmjadmin-3.1.9/tools#
root@mail:~/mlmmjadmin-3.1.9/tools# python -V
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 28, in <module>
    from CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
    from CommandNotFound.db.db import SqliteDatabase
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
root@mail:~/mlmmjadmin-3.1.9/tools# 
root@mail:~/mlmmjadmin-3.1.9/tools# sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://ca.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Hit:5 http://ca.archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 114 kB in 1s (84.1 kB/s)
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 12, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
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
root@mail:~/mlmmjadmin-3.1.9/tools# 

Cannot figure out how to fix this

Regards

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: mlmmjadmin python error

Can Someone help with this error? Still haven't been able to fix it.

Thank you

3

Re: mlmmjadmin python error

heeter wrote:

Can Someone help with this error? Still haven't been able to fix it.

Thank you

Try to run the

sudo apt install --reinstall python3-apt

command in your terminal.