mariadb causes update to fail

Update fails, I’m not sure how to resolve. Any help would be appreciated.


apt update && apt upgrade

Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 https://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.34-0+deb10u1) but 1:10.3.31-0+deb10u1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt --fix-broken install

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  mariadb-server-10.3
Suggested packages:
  mailx mariadb-test netcat-openbsd tinyca
Recommended packages:
  libhtml-template-perl
The following packages will be upgraded:
  mariadb-server-10.3
1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
13 not fully installed or removed.
Need to get 0 B/3,575 kB of archives.
After this operation, 17.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 32886 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.3_1%3a10.3.34-0+deb10u1_armhf.deb ...
df: /var/lib/mysql/.: No such file or directory
ERROR: There's not enough space in /var/lib/mysql/
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.3_1%3a10.3.34-0+deb10u1_armhf.deb (--unpack):
 new mariadb-server-10.3 package pre-installation script subprocess returned error exit status 1
mariadb.service is a disabled or a static unit, not starting it.
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-server-10.3_1%3a10.3.34-0+deb10u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

ERROR: There’s not enough space in /var/lib/mysql/
Looks like your filesystem is full. What does df -h report?

df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        14G  1.4G   13G  11% /
devtmpfs        929M     0  929M   0% /dev
tmpfs           962M     0  962M   0% /dev/shm
tmpfs           962M   19M  943M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           962M     0  962M   0% /sys/fs/cgroup
/dev/sdb1       3.6T  2.4T  1.3T  65% /mnt/nidhogg
tmpfs            50M  8.0K   50M   1% /var/log
tmpfs          1023M     0 1023M   0% /tmp
/dev/mmcblk0p1  253M   54M  200M  22% /boot
/dev/sda1       3.6T  3.1T  573G  85% /mnt/ratatoskr

That looks all good. Can you check whether the /var/lib/mysql symlink is to the correct dir:

ls -l "$(readlink -f /var/lib/mysql)"

EDIT: It seems to do not, as of “df: /var/lib/mysql/.: No such file or directory”. Did you move your DietPi userdata to an external drive, and is this still attached?

Yes, attached external drive

User data location: /mnt/nidhogg/dietpi_userdata

Here is a idea, what is mariadb used for? I pretty much only use this install as a SMB file server and Qbtorrent for downloading.

That’s the list of software that would require MariaDB

ID 38 | =0 | FreshRSS: self-hosted RSS feed aggregator | +MariaDB +PHP +webserver
ID 40 | =0 | Ampache: web interface media streaming server | +ALSA +FFmpeg +MariaDB +PHP +webserver
ID 47 | =0 | ownCloud: File sync, sharing and collaboration platform | +MariaDB +PHP +Redis +webserver
ID 48 | =0 | Pydio: Feature-rich backup and sync server | +MariaDB +PHP +webserver
ID 49 | =0 | Gogs: Personal Git server with web interface | +Git +MariaDB +OpenSSH Client
ID 54 | =0 | phpBB: bulletin board forum software | +MariaDB +PHP +webserver
ID 55 | =0 | Wordpress: website blog and publishing platform | +MariaDB +PHP +webserver
ID 57 | =0 | Baïkal: lightweight caldav + carddav server | +MariaDB +PHP +webserver
ID 76 | =0 | LAMP: Apache   | MariaDB | PHP | +Apache +MariaDB +PHP
ID 79 | =0 | LEMP: Nginx    | MariaDB | PHP | +Nginx +MariaDB +PHP
ID 82 | =0 | LLMP: Lighttpd | MariaDB | PHP | +Lighttpd +MariaDB +PHP
ID 88 | =0 | MariaDB: Persistent cached file-per-table database server
ID 90 | =0 | phpMyAdmin: Optional MariaDB web interface admin tools | +MariaDB +PHP +webserver
ID 114 | =0 | Nextcloud: File sync, sharing and collaboration platform | +MariaDB +PHP +Redis +webserver
ID 129 | =0 | O!MPD: Feature-rich, web interface audio player for MPD | +ALSA +MariaDB +PHP +MPD +youtube-dl +webserver
ID 143 | =0 | Koel: web interface audio streamer | +FFmpeg +MariaDB +PHP +PHP Composer
ID 159 | =0 | Allo GUI full: Audiophile web interface with all dependencies | +ALSA +Squeezelite +Shairport Sync +Netdata +MariaDB +PHP +Samba Server +Roon Bridge +NAA daemon +MPD
ID 165 | =0 | Gitea: Git with a cup of tea | +Git +MariaDB +OpenSSH Client

Could you check if MariaDB has been installed from our catalouge?

dietpi-software list | grep maria

I tried setting up ownCloud at one point and then removed it.

dietpi-software list | grep maria
ID 88 | =2 | MariaDB: Persistent cached file-per-table database server | | https                                   ://dietpi.com/docs/software/databases/#mariadb

List of installed software

[ ] 46   qBittorrent: BitTorrent server with web interface (C++)                                             │
│    [ ] 84   Lighttpd: Extremely lightweight webserver                                                           │
│    [ ] 88   MariaDB: Persistent cached file-per-table database server                                           │
│    [ ] 89   PHP: Hypertext Preprocessor for dynamic web content                                                 │
│    [ ] 91   Redis: Volatile in-memory non-SQL database server                                                   │
│    [ ] 92   Certbot: Obtain and renew Let's Encrypt SSL certs for HTTPS                                         │
│    [ ] 96   Samba Server: Feature-rich SMB/CIFS server                                                          │
│    [ ] 103  DietPi-RAMlog: Makes /var/log a RAM disk, preserves file structure on reboot                        │
│    [ ] 104  Dropbear: Lightweight SSH server                                                                    │
│    [ ] 130  Python 3: Runtime system, pip package installer and development headers

there are quite some software leftover. if you like, you could try to remove them. I highly recommend to do a backup before :wink:

Check the software ID’s if needed or not beforhand

dietpi-software uninstall 84 88 89 91 92 130

You most probably will hit some issues as MariaDB is not running. If yes, select the change command option on the error screen, remove the command and replace it with true. Continue afterwards.

I uninstalled mariadb and update completed. Nothing else seems broken, I’m calling this successful. Thanks for all the help.

did you removed the other software components as well? Because they are not needed to operate SAMBA + Qbit :sunglasses:

No I didn’t, I don’t want to potentially cause other issues.

ok, no problem. Just keep it in mind that you have more installed than needed. :wink:

There was Nextcloud or ownCloud installed before? Would explain the webserver stack + Redis. Indeed qBittorrent and Samba do not require any of those :slight_smile:.