trying to purge Mariadb, didn't work - Now dpkg hangs up and re-boot won't fix


New Member

Using Ubuntu 18.04.6.

Was trying to install mariadb which didn't work. So now trying to un-install (sudo apt purge mariadb*). In doing this the machine hung up.
I tried to use the GUI to shut down the machine but instead of shutting down it popped up with the log-in screen. Finally used 'shutdown now'
and re-booted. Now in trying to use 'synaptic' here is what I get:

[email protected]:~$ sudo synaptic

E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to
correct the problem.

E: _cache->open() failed, please report.


[email protected]:~$ sudo dpkg --configure -a

Setting up mariadb-server-10.1 (1:10.1.44-0ubuntu0.18.04.1) ...

Hangs here! re-boot does not clear this problem.

Thanks in advance for help in fixing this.



Well-Known Member
The reason you can’t uninstall it is because it hasn’t installed properly to begin with.

When you say the installer hangs...... how long are we talking here? How long did you leave it to run for, before calling time on it?

Sometimes packages do take a while to install properly. Especially if they have to build and install custom kernel modules. And depending on the specs of your machine - that can take a while. And if you’ve got more than one kernel, it will have to build and install one for each. Which can take even longer.

Offhand, I don’t know if the mariadb installer does this. But there are various other install-time tasks that can sometimes take a while to complete.
My point is- It may not have actually been hanging. It may well have been doing something.

I recommend running the dpkg command again and waiting for the process to finish.
Once the package has installed properly, then you can use apt remove —purge.


Well-Known Member
Thanks JasKinasis,

I reran dpkg and you were right.

It took about 20 minutes!!

Ah, I figured as much!
Glad you got it sorted.

Sometimes packages seem to take an ice age or two to install, or uninstall. When that happens, it just requires a little bit of patience.

Use the time to make a brew, or catch up with emails, or watch cat videos!

Or in the case of mariadb - Grow a beard, meet a nice young lady, have kids, watch them grow up and have grandchildren of their own!! Ha ha!!

Members online