Install the Latest MariaDB Release with EasyEngine 3

MariaDB mendadak macet, mogok, berhenti beroperasi saat COVID-19 mulai merebak di awal 2020. Masalahnya adalah ketika update, gagal membaca repository mariaDB 10.2. Mungkin Maria pindah tanpa lapor pak RT dan petugas dukcapil. Jadi waktu didatangi rumahnya kosong terus. Asv kan!?

Server + Linux
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.1_1%3a10.1.45+maria-1~bionic_amd64.deb (--unpack):
new mariadb-server-10.1 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.1_1%3a10.1.45+maria-1~bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Error di atas adalah problem yang muncul bersamaan dengan pandemi COVID-19 di tahun 2020. Ketika update Ubuntu via apt update -y, proses terhenti karena ada error saat memperbarui mariadb.

Solusi tercepat saat itu adalah dengan uninstall mariadb-server sama sekali dari server.

Loh kok dibuang? Iya, karena mariadb-server tidak terpakai sama sekali di local host, karena database pakai remote host.

Namanya quick fix jelas tidak mengobati penyakit sebenarnya. Hanya menutupi luka sementara, agar proses apt update tetap tereksekusi dengan sukses hingga selesai.

root@server:~# apt install mariadb-server -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following additional packages will be installed:
mariadb-server-10.1
Suggested packages:
mailx mariadb-test tinyca
The following NEW packages will be installed:
mariadb-server-10.1
0 upgraded, 1 newly installed, 0 to remove and 108 not upgraded.
21 not fully installed or removed.
Need to get 0 B/7,234 kB of archives.
After this operation, 89.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages …
(Reading database … 102169 files and directories currently installed.)
Preparing to unpack …/mariadb-server-10.1_1%3a10.1.45+maria-1~bionic_amd64.deb …
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.1_1%3a10.1.45+maria-1~bionic_amd64.deb (--unpack):
new mariadb-server-10.1 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.1_1%3a10.1.45+maria-1~bionic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@server:~# cd

Solusinya? Baru dapat bulan Agustus ini: menambahkan repository MariaDB 10.2.

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup \ | sudo bash -s -- --mariadb-server-version=10.3 --skip-maxscale

Setelah itu baru kita bisa install mariadb-server dengan selamat dan sukses.

sudo apt update && sudo apt install mariadb-server

Gitu aja ternyata. Asv sekali …

Referensi hasil googling dari sini dan sini.