wrror updating dietpi

Hi.

I tried updating my RPi3 with dietpi-update.

The process fails because it seems there’s a problem with mariadb.

What could be the problem?


APT upgrade
- Command: apt-get -qq upgrade
- Exit code: 100
- DietPi version: v6.25.3 (MichaIng/master) | HW_MODEL: 3 | HW_ARCH: 2 | DISTRO: 4
- Image creator: DietPi Core Team
- Pre-image: Raspbian Lite
- Error log:
Setting up mariadb-server-10.1 (10.1.47-0+deb9u1) ...
dpkg: error processing package mariadb-server-10.1 (--configure):
  subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
  mariadb-server depends on mariadb-server-10.1 (>= 10.1.47-0+deb9u1); however:
    Package mariadb-server-10.1 is not configured yet.
dpkg: error processing package mariadb-server (--configure):
  dependency problems - leaving unconfigured
Errors were encountered while processing:
  mariadb-server-10.1
  mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hi,

many thanks for your message. Before a DietPi update will be implemented, your system is trying to update all packaged manages by apt package manager.

Looks like this is failing in your case. As far as I can see, you are on a very old DietPi release (1,5 years) and I guess quite some packages are pending to be updated now. Let’s try to get it sorted.

pls can you run apt update && apt upgrade and post full output.

Yes, my installation is quite old but it’s your fault. My mini DietPi server works so well that sometimes I forget I have it.

I did the upgrade. The output is fairly long but basically it fails with the same packege.


dpkg: errore nell’elaborare il pacchetto mariadb-server-10.1 (–configure):
il sottoprocesso installato script di post-installation ha restituito lo stato di errore 1

dpkg: problemi con le dipendenze impediscono la configurazione di mariadb-server:
mariadb-server dipende da mariadb-server-10.1 (>= 10.1.47-0+deb9u1); comunque:
Il pacchetto mariadb-server-10.1 non è ancora configurato.

dpkg: errore nell’elaborare il pacchetto mariadb-server (–configure):
problemi con le dipendenze - lasciato non configurato

Si sono verificati degli errori nell’elaborazione:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Not sure why it is my fault but ok

can you post dpkg -l maria*

That’s because I thought you were in the development team :wink:



dietpi@DietPi:~$ dpkg -l maria*
Voluto=U (non noto)/I (installato)/R (rimosso)/P (rimosso totale)/H (in attesa)
| Stato=Non/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(nessuno)/R (reinstallazione richiesta) (Stato,Err: maiuscolo=grave)
||/ Nome                                      Versione                  Architettura              Descrizione
+++-=========================================-=========================-=========================-========================================================================================
un  mariadb-client-10.0                       <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
ii  mariadb-client-10.1                       10.1.47-0+deb9u1          armhf                     MariaDB database client binaries
un  mariadb-client-5.5                        <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-client-core-10.0                  <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
ii  mariadb-client-core-10.1                  10.1.47-0+deb9u1          armhf                     MariaDB database core client binaries
un  mariadb-client-core-5.5                   <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
ii  mariadb-common                            10.1.47-0+deb9u1          all                       MariaDB common metapackage
un  mariadb-galera-server                     <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-galera-server-10.0                <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-galera-server-5.5                 <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
iU  mariadb-server                            10.1.47-0+deb9u1          all                       MariaDB database server (metapackage depending on the latest version)
un  mariadb-server-10.0                       <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
iF  mariadb-server-10.1                       10.1.47-0+deb9u1          armhf                     MariaDB database server binaries
un  mariadb-server-5.5                        <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-server-core-10.0                  <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
ii  mariadb-server-core-10.1                  10.1.47-0+deb9u1          armhf                     MariaDB database core server files
un  mariadb-server-core-5.5                   <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-test                              <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-tokudb-engine-10.0                <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-tokudb-engine-10.1                <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)
un  mariadb-tokudb-engine-5.5                 <nessuna>                 <nessuna>                 (nessuna descrizione disponibile)

Hi,

the step you are failing is a default Debian functionality. At the moment your system is trying to update Debian software packages using APT package manager. This has nothing to do with DietPi and could not have been prevented by DietPi !!

For your reference I’m linking a Wikipedia page describing APT

https://en.wikipedia.org/wiki/APT_(software)#:~:text=wiki.debian.org%2FApt,Ubuntu%2C%20and%20related%20Linux%20distributions.

Looks like MariaDB software package is in an undefined status. Let’s try to get it corrected

apt --reinstall install mariadb-server-10.1

Mh. Seems it can’t find the package in the repository

dietpi@DietPi:/mnt/storage/aMule/Completed$ sudo apt --reinstall install mariadb-server-10.1
Lettura elenco dei pacchetti… Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato… Fatto
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
libbluray2 libicu64
Usare “sudo apt autoremove” per rimuoverli.
0 aggiornati, 0 installati, 1 reinstallati, 0 da rimuovere e 0 non aggiornati.
2 non completamente installati o rimossi.
Dopo quest’operazione, verranno occupati 0 B di spazio su disco.
E: Internal Error, No file name for mariadb-server-10.1:armhf

let’s try it manually. pls use user root

cd /tmp/
wget http://raspbian.raspberrypi.org/raspbian/pool/main/m/mariadb-10.1/mariadb-server-10.1_10.1.47-0+deb9u1_armhf.deb
dpkg -i mariadb-server-10.1_10.1.47-0+deb9u1_armhf.deb

Seems there are still errors during the installation process

dietpi@DietPi:/tmp$ sudo dpkg -i mariadb-server-10.1_10.1.47-0+deb9u1_armhf.deb
(Lettura del database… 81454 file e directory attualmente installati.)
Preparativi per estrarre mariadb-server-10.1_10.1.47-0+deb9u1_armhf.deb…
/var/lib/mysql: found previous version 10.1
Estrazione di mariadb-server-10.1 (10.1.47-0+deb9u1) su (10.1.47-0+deb9u1)…
Configurazione di mariadb-server-10.1 (10.1.47-0+deb9u1)…
dpkg: errore nell’elaborare il pacchetto mariadb-server-10.1 (–install):
il sottoprocesso installato script di post-installation ha restituito lo stato
di errore 1
Elaborazione dei trigger per systemd (232-25+deb9u12)…
Si sono verificati degli errori nell’elaborazione:
mariadb-server-10.1

looks like MariaDB package is brocken completely. Before next step, I recommend to create a dietpi-backup or better to clone you SD card as we will remove MariaDB and try to get it installed again.

systemctl stop mariadb.service
apt remove mariadb-server-10.1
apt update
apt install mariadb-server

The uninstallation process worked fine, but the installation returned the usual mariadb-server-10.1 configuration error

NOTE: I see this line:

/var/lib/mysql: found previous version 10.1

might it be of relevance?




dietpi@DietPi:~$ sudo apt install mariadb-server
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
  libbluray2 libicu64
Usare "sudo apt autoremove" per rimuoverli.
The following additional packages will be installed:
  mariadb-server-10.1
Pacchetti suggeriti:
  mailx mariadb-test netcat-openbsd tinyca
Pacchetti raccomandati:
  libhtml-template-perl
I seguenti pacchetti NUOVI saranno installati:
  mariadb-server mariadb-server-10.1
0 aggiornati, 2 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 4.716 kB di archivi.
Dopo quest'operazione, verranno occupati 73,0 MB di spazio su disco.
Continuare? [S/n] s
Scaricamento di:1 http://ftp.arnes.si/mirrors/raspbian/raspbian stretch/main armhf mariadb-server-10.1 armhf 10.1.47-0+deb9u1 [4.688 kB]
Scaricamento di:2 http://ftp.arnes.si/mirrors/raspbian/raspbian stretch/main armhf mariadb-server all 10.1.47-0+deb9u1 [27,6 kB]
Recuperati 4.716 kB in 2s (1.650 kB/s)    
Preconfiguring packages ...
Selezionato il pacchetto mariadb-server-10.1 non precedentemente selezionato.
(Lettura del database... 81327 file e directory attualmente installati.)
Preparativi per estrarre .../mariadb-server-10.1_10.1.47-0+deb9u1_armhf.deb...
/var/lib/mysql: found previous version 10.1
Estrazione di mariadb-server-10.1 (10.1.47-0+deb9u1)...
Selezionato il pacchetto mariadb-server non precedentemente selezionato.
Preparativi per estrarre .../mariadb-server_10.1.47-0+deb9u1_all.deb...
Estrazione di mariadb-server (10.1.47-0+deb9u1)...
Elaborazione dei trigger per systemd (232-25+deb9u12)...
Configurazione di mariadb-server-10.1 (10.1.47-0+deb9u1)...
dpkg: errore nell'elaborare il pacchetto  (--configure):
 il sottoprocesso installato script di post-installation ha restituito lo stato di errore 1
dpkg: problemi con le dipendenze impediscono la configurazione di mariadb-server:
 mariadb-server dipende da mariadb-server-10.1 (>= 10.1.47-0+deb9u1); comunque:
  Il pacchetto mariadb-server-10.1 non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto mariadb-server (--configure):
 problemi con le dipendenze - lasciato non configurato
Si sono verificati degli errori nell'elaborazione:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

MichaIng
Any idea what could prevent system from reinstall mariadb-server-10.1

Tarrasque
yes /var/lib/mysql is still present. May aim was to keep this data as it contain your actual database configuration

Let’s see:

apt install mariadb-server-10.1

One needs to attempt to install dependencies explicitly to see which other packages prevent their install. It does not show the whole tale.

Here it is.

More or less the issue sems the same. It fails during the configure step.

P.S. let me thank you all for the time and effort you’re putting in helping me with my issue. Really appreciated.



dietpi@DietPi:/mnt/storage/aMule/Completed$ sudo apt install mariadb-server-10.1
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
mariadb-server-10.1 is already the newest version (10.1.47-0+deb9u1).
È stato impostato mariadb-server-10.1 per l'installazione manuale.
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
  libbluray2 libicu64
Usare "sudo apt autoremove" per rimuoverli.
0 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.
2 non completamente installati o rimossi.
Dopo quest'operazione, verranno occupati 0 B di spazio su disco.
Continuare? [S/n] s
Configurazione di mariadb-server-10.1 (10.1.47-0+deb9u1)...
dpkg: errore nell'elaborare il pacchetto mariadb-server-10.1 (--configure):
 il sottoprocesso installato script di post-installation ha restituito lo stato di errore 1
dpkg: problemi con le dipendenze impediscono la configurazione di mariadb-server:
 mariadb-server dipende da mariadb-server-10.1 (>= 10.1.47-0+deb9u1); comunque:
  Il pacchetto mariadb-server-10.1 non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto mariadb-server (--configure):
 problemi con le dipendenze - lasciato non configurato
Si sono verificati degli errori nell'elaborazione:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

MichaIng
could it be some file system corruption preventing dpkg to complete configuration step?

Not sure, error code 1 :thinking:.

What does the following say?

dpkg --configure mariadb-server-10.1

Here it is

dietpi@DietPi:/mnt/storage/JDownloader$ sudo dpkg --configure mariadb-server-10.1 
Configurazione di mariadb-server-10.1 (10.1.47-0+deb9u1)...
dpkg: errore nell'elaborare il pacchetto mariadb-server-10.1 (--configure):
 il sottoprocesso installato script di post-installation ha restituito lo stato di errore 1
Si sono verificati degli errori nell'elaborazione:
 mariadb-server-10.1

Let’s run that postinst script in verbose mode:

bash -e -x /var/lib/dpkg/info/mariadb-server-10.1.postinst

This will produce likely a lot of output, but it’s the only way to see where/why it fails.

dietpi@DietPi:~$ sudo bash -e -x /var/lib/dpkg/info/mariadb-server-10.1.postinst
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/mariadb-server-10.1.postinst
Use of uninitialized value $action in string eq at /usr/share/debconf/frontend line 27.
postinst called with unknown argument ''

Whoops sorry, I forgot the configure argument:

bash -e -x /var/lib/dpkg/info/mariadb-server-10.1.postinst configure