# 13.0: pkg upgrade removes mariadb105-server/-client?



## mack3457 (Dec 9, 2022)

I'm a little late in upgrading my 13.0 installation, so I did a `freebsd-upgrade fetch`/ `freebsd-upgrade install`, which was fine.

Then I started a `pkg upgrade`, but it tells me, it will remove mariadb without replacing it:


```
Installed packages to be REMOVED:
        autoconf-wrapper: 20131203
        hdf-szip: 2.1.1
        mariadb105-client: 10.5.13
        mariadb105-server: 10.5.13
...
```

This would not be good, to say the least - what is happening here?

Shall I upgrade to 13.1 without `pkg upgrade` on my 13.0 or do I have other options beyond dumping the DB and restoring it afterwards?



```
root:~ # freebsd-version -kur
13.0-RELEASE-p13
13.0-RELEASE
13.0-RELEASE-p13
root:~ #
```


----------



## Alain De Vos (Dec 9, 2022)

Normal. The freebsd packages use mysql instead of mariadb
To only solutiion is to compile and install all dependend ports with make.conf:

```
#5.7
DEFAULT_VERSIONS+= mysql=10.6m
```
Or

```
#5.7
DEFAULT_VERSIONS+= mysql=10.5m
```
freebsd-update does not change this, nor nothing in source-ports/binary-packages

My, freebsd-version -kru

```
13.1-RELEASE-p5
13.1-RELEASE-p5
13.1-RELEASE-p5
```


----------



## mack3457 (Dec 9, 2022)

Ok, but I don't really understand.


```
root@www:/usr/ports/databases/mariadb105-server # pkg info -rx "mariadb105.*"
mariadb105-client-10.5.13:
        p5-DBD-MariaDB-1.21
        mariadb105-server-10.5.13
mariadb105-server-10.5.13:
root@www:/usr/ports/databases/mariadb105-server #
```

So, there are no dependent ports beyond the perl interface for mariadb, which is obvious. And there is no mysql installed and nothing related to mysql (beyond php80-mysqli-8.0.15, which isn't used or depended on anywhere).

So, I "just" have to reinstall mariadb-server and -client after the upgrade and I can't convince pkg to leave mariadb untouched?


----------



## Alain De Vos (Dec 9, 2022)

Try

```
pkg remove mariadb106-client
or
pkg remove mariadb105-client
```
Then Ctrl-C.
For me it takes 60 packages, as dependencies.
You should decide if you want to install everything from compiled-source-ports or precompiled-packages.
Mixing can be problematic.
In the ports you can use mariadb but the packages use mysql specific version-5.7 and nothing else.


----------



## mack3457 (Dec 9, 2022)

```
root:~ # pkg remove mariadb105-client
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 3 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mariadb105-client: 10.5.13
        mariadb105-server: 10.5.13
        p5-DBD-MariaDB: 1.21

Number of packages to be removed: 3

The operation will free 234 MiB.

Proceed with deinstalling packages? [y/N]:
root:~ #
```

I installed everything from pkg precompiled packages, as far as I remember.


----------



## dbdemon (Dec 9, 2022)

This dependency design is frustrating, I have to say. 

For what it's worth, at least in theory if you can uninstall the mariadb packages, it should leave your datadir untouched. So then you can then reinstall it later and everything will be just fine. Assuming you don't try to install mysql in the meantime. Of course, taking a backup first is recommended ...


----------



## mack3457 (Dec 10, 2022)

Ok, the problem is this p5-DBD-MariaDB.

I vaguely remember that I had one port package installation somewhere on one of the FreeBSD machines, so probably it was this machine due to the mysql / mariadb problem.

When I check, everything looks ok:

```
root:~ # pkg info -dx p5-DBD-MariaDB-1.21
p5-DBD-MariaDB-1.21:
        perl5-5.32.1_3
        p5-DBI-1.643
        mariadb105-client-10.5.13
root:~ #
```

But when trying to reinstall, mysql57-client is required.

Anyway, I deinstalled p5-DBD-MariaDB, then ran `pkg upgrade`. `pkg install p5-DBD-MariaDB` liked to remove mariadb again, so I went to ports and installed it from there.

Everything looks ok now.

Btw., I had the same / similar problem when setting up this machine with MariaDB with the solution to use ports: https://forums.freebsd.org/threads/...3-removes-p5-dbd-mariadb-and-vice-versa.84149

Some vague memories where left, but so many other problems on so many other machines this year...


----------

