Roots Discourse

Mariadb broken package while provisioning staging server

ansible version: 2.10.6
virtualbox version: 6
vagrant version: 2.2.14
trellis version: 1.5.0
Digital ocean droplet: Ubuntu 18

I’m working on a website using trellis (ansible, vagrant) bedrock setup. I have set up my local development environment successfully but I see this error when I provision the staging environment

TASK [mariadb : Install MySQL client] ******************************************************************************************************************************
System info:                                                                                                                                                        
  Ansible 2.10.6; Linux                                                                                                                                             
  Trellis version (per changelog): "Remove prestissimo for Composer 2.0 support"                                                                                    
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o                                                                                                        
"Dpkg::Options::=--force-confold"      install 'mariadb-client'' failed: E:                                                                                         
Unable to correct problems, you have held broken packages.                                                                                                          
E: Unable to correct problems, you have held broken packages.                                                                                                       
fatal: []: FAILED! => {"cache_update_time": 1614332810, "cache_updated": false, "changed": false, "rc": 100, "stderr_lines": ["E: Unable to correct pr
oblems, you have held broken packages."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nSome packages could not be
 installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet b
een created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n maria
db-client : Depends: mariadb-client-10.5 (>= 1:10.5.9+maria~focal) but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building de
pendency tree...", "Reading state information...", "Some packages could not be installed. This may mean that you have", "requested an impossible situation or if you
 are using the unstable", "distribution that some required packages have not yet been created", "or been moved out of Incoming.", "The following information may hel
p to resolve the situation:", "", "The following packages have unmet dependencies:", " mariadb-client : Depends: mariadb-client-10.5 (>= 1:10.5.9+maria~focal) but i
t is not going to be installed"]}        

PLAY RECAP *********************************************************************************************************************************************************
*************                                : ok=48   changed=1    unreachable=0    failed=1    skipped=28   rescued=0    ignored=0   
localhost                  : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

This is my first website using this setup so I am kind of lost.

Any help will be greatly appreciated.

The server is running Ubuntu 20

Trellis now also officially supports Ubuntu 20.04 Focal LTS, as you are starting from scratch it may be a good idea (also for other reasons like having the recent-most Ubuntu) to use Ubuntu 20.x instead of 18.x. This may also resolve this package issue (for whatever reasons this happened).

If you still want to use Ubuntu 18.x, it appears that this seems to be some strange bug/situation with apt installation, the solution seems to be using aptitude instead:

Apologies, the Ubuntu version is 20.

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Does the aptitude fix from StackOverflow work?

I am provisioning the ubuntu 20 droplet using ansible from my local computer. As far as I understand, in this scenario ansible is responsible for orchestrating the whole server setup on the droplet. Is there a configuration in ansible that I could change to make it use aptitude command instead of apt?


One thing comes to mind: Could it be that Droplet image came with some packages preinstalled? Is this a blank/base Ubuntu 20 image or a “web server” one? For me only the “minimal” images caused no issues.

You were absolutely right. The droplet was not a blank Ubuntu 20 server but one with wordpress on it. Performing the provision on a new Ubuntu 20 droplet went just fine.

Thanks a lot for your help :slight_smile:

This topic was automatically closed after 42 days. New replies are no longer allowed.