[SOLVED] Updating Debian 11 to 12 SAMBA AD

Come here to share your tips and tricks for using Samba4
Locked
wapt42
Messages: 8
Registration: August 10, 2020 - 4:12 PM

December 3, 2025 - 11:30

Hello friends

I am having difficulty updating Debian and Samba on a 4-node infrastructure that was installed a long time ago by your technicians.

We have been customers for many years.

I tried to follow the official documentation:

https://samba.tranquil.it/doc/fr/samba_ ... ian12.html

Therefore, I base my work on a fully up-to-date version of Debian 11, which I reboot before starting the operations.

I encounter these errors after:

Code: Select all

apt dist-upgrade 

Code: Select all

Des erreurs ont été rencontrées pendant l'exécution :
 /tmp/apt-dpkg-install-KRQ4bQ/02-winbind_2%3a4.22.6+dfsg-2-1bookworm1_amd64.deb
 /tmp/apt-dpkg-install-KRQ4bQ/06-samba-libs_2%3a4.22.6+dfsg-2-1bookworm1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
(I know the output in French isn't great)

I am being asked to do a:

Code: Select all

apt --fix-broken

Code: Select all

Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 29, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Extraction des modèles depuis les paquets : 100%
(Lecture de la base de données... 67015 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de .../winbind_2%3a4.22.6+dfsg-2-1bookworm1_amd64.deb ...
Dépaquetage de winbind (2:4.22.6+dfsg-2-1bookworm1) sur (2:4.17.12+dfsg-1.1bullseye1) ...
dpkg: erreur de traitement de l'archive /var/cache/apt/archives/winbind_2%3a4.22.6+dfsg-2-1bookworm1_amd64.deb (--unpack) :
 tentative de remplacement de « /usr/share/man/man8/idmap_rfc2307.8.gz », qui appartient aussi au paquet samba-libs:amd64 2:4.17.12+dfsg-1.1bullseye1
Reinstalling /etc/logrotate.d/winbind that was moved away
Pas de détournement « détournement de /usr/lib/x86_64-linux-gnu/samba/krb5/async_dns_krb5_locator.so par winbind », aucun supprimé.
winbind.service is a disabled or a static unit not running, not starting it.
Des erreurs ont été rencontrées pendant l'exécution : 
 /var/cache/apt/archives/winbind_2%3a4.22.6+dfsg-2-1bookworm1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
And that prevents us from going further.

It seems that the Python version is naturally the culprit and that this will cause a lot of problems with the libraries for the rest of the upgrade.

Code: Select all

ls /usr/lib/python3/dist-packages/apt_pkg.cpython-*   
apt_pkg.cpython-311-x86_64-linux-gnu.so

All the apt-clean operations, cache clearing, etc... have yielded no results.

I'm working on a virtual machine stage with Snapshots, so I can test quite a bit. If anyone has any advice, I would be very grateful to receive it.

Have a great day, friends.

Val.
Last edited by wapt42 on Dec 3, 2025 - 11:45, edited 1 time.
User avatar
blemoigne
Messages: 178
Registration: July 17, 2020 - 11:29

December 3, 2025 - 11:39

Good morning
You would need to remove these packages (without purging) and then type the command to install the necessary packages:

Code: Select all

apt-get install samba winbind libnss-winbind krb5-user smbclient ldb-tools python3-cryptography
https://samba.tranquil.it/doc/fr/samba_ ... e-packages
wapt42
Messages: 8
Registration: August 10, 2020 - 4:12 PM

December 3, 2025 - 12:34

Thank you @blemoigne and @Bertrand TRanquilIT

It seems to work like this:


These packages should be uninstalled BEFORE changing the sources (when on a fully updated and rebooted Debian 11 system).

without purging to keep the configurations:

Code: Select all

apt remove samba winbind libnss-winbind krb5-user smbclient ldb-tools python3-cryptography
We perform all the operations as described in the documentation (don't forget the chronograph).

after the dist-upgrade we reboot

And now we reinstall the packages:

Code: Select all

apt install samba winbind libnss-winbind krb5-user smbclient ldb-tools python3-cryptography
I didn't encounter any errors. Now I'm putting the VM back into production and will report back if it doesn't work.

@+
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

December 8, 2025 - 5:31 PM

Hello wapt42,

we tend to follow the developments of Michael Tokarev from the Samba packaging team for Debian regarding package structuring. The tradition in Debian is to break software into many small pieces in many different packages. The problem arises when modules are moved within Samba; this then causes conflicts between packages that share the same file between one distribution version and the next.

Often, the only way to upgrade while keeping apt/deb happy is to uninstall and reinstall... As long as you don't purge the system, it doesn't cause any problems with the data and configuration files :-)

. Regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked