Upgrade failed, please advise

Mail-in-a-Box Version: v68

Updating system packages…

FAILED: apt-get -y -o Dpkg::Options::=–force-confdef -o Dpkg::Options::=–force-confnew upgrade

Reading package lists…
Building dependency tree…
Reading state information…
Calculating upgrade…
The following packages have been kept back:
ethtool firmware-sof-signed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up update-notifier-common ( …
Traceback (most recent call last):
File “/usr/lib/update-notifier/package-data-downloader”, line 24, in
import debian.deb822
ModuleNotFoundError: No module named ‘debian’
dpkg: error processing package update-notifier-common (–configure):
installed update-notifier-common package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)


I also didn’t get it when updating to v68:

Updating system packages…
Installing system packages…
Initializing system random number generator…
Opening alternate SSH port ???.
Firewall is active and enabled on system startup
Synchronizing state of fail2ban.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable fail2ban
Installing nsd (DNS server)…
Installing Postfix (SMTP server)…
Traceback (most recent call last):
File “/root/mailinabox/tools/editconf.py”, line 80, in
input_lines = list(f)
File “/usr/lib/python3.10/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xec in position 752: invalid continuation byte

Maybe I got lucky, but my upgrade completed without error messages. There was more output than I’ve ever seen on a miab upgrade before.

Kernel 5.15.0-101-generic
Upgrade 67 to 68.

For the No module named 'Debian' message

I used

sudo apt-get update
sudo apt-get install --reinstall python3-debian
sudo apt-get --fix-broken install

from here apt - Failed to update update-notifier, ModuleNotFoundError: No module named 'debian' - Ask Ubuntu

Similar issue here:

Dealing with the “No module named ‘Debian’” as matidau described here worked for me.


Looks like you have made changes to your dkim.sh

Make a backup of the file outside of the mailinabox directory, like in your home, then follow the instructions in this post, with using your current version number, to return you mailinabox directory to the same as the git version. (the post was for v62)

Can someone please take a look at my problem with upgrading from version 67 to 68? I have not been able to deal with it yet and the problem persists.
Thanks a lot and sorry for the machine translation.

It looks like one of your postfix config files is not UTF-8.

There was a change made to the line above the one in the error message recently that enforces utf-8 mailinabox/tools/editconf.py at 0e9193651d3f9f23e08f9dd7823b4b9642ac120d · mail-in-a-box/mailinabox · GitHub

The file that is causing a problem is one of the following:


This next part is a bit of a stab in the dark, the byte 0xec is ì (small i with grave) in Latin-1. Try using grep on these three files to identify which one/s have the byte.

grep -P "\xec" /etc/postfix/main.cf

I would then visually inspect the file file to see if you can find the small i with grave to confirm it is Latin-1.

Then make a backup the file, and possibly of MiaB.

Run iconv to convert the file from Latin-1 to utf-8, where input.file is the file that you identified above.

iconv -f ISO-8859-1 -t UTF-8//TRANSLIT input.file

Restart postfix and see if the configuration works without errors.

Thanks for the directions:
in /etc/postfix/main.cf
I changed the note

moje doplněné parametry 2.1.2024


moje doplnene parametry 2.1.2024

and it went through without any problems…

1 Like

I think this is Czech? For future reference this is Latin-2, and the command should have been:

iconv -f ISO-8859-2 -t UTF-8//TRANSLIT /etc/postfix/main.cf

Glad it is working for you.

Yes note is Czech …