package mysql-server-8.0 (not installed) failed to install/upgrade: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2

Bug #1934383 reported by Thamaraiselvan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

i don't know what happened

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 (not installed)
ProcVersionSignature: Ubuntu 5.8.0-59.66~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-59-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
Date: Wed Jun 30 02:22:34 2021
DuplicateSignature:
 package:mysql-server-8.0:(not installed)
 Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
 update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
 dpkg: error processing package mysql-server-8.0 (--configure):
  installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2
InstallationDate: Installed on 2021-02-25 (125 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.5
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 (not installed) failed to install/upgrade: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Thamaraiselvan (tomcsc) wrote :
Revision history for this message
Avital Ostromich (avital) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

information type: Private Security → Public
tags: removed: need-duplicate-check
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thank you for taking the time to file a bug report.

I could reproduce the bug here by following these steps (which are listed in your DpkgTerminalLog.txt file):

$ lxc launch images:ubuntu/focal mysql-bug1934383
$ lxc shell mysql-bug1934383
# apt update
# apt install mysql-server -y
# apt remove --purge -y mysql-server
# apt autoremove
# apt purge -y mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
# rm -rf /etc/mysql/
# apt-get install mysql-server

The interesting part from the log is this:

 update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist

This error indicates that there is no /etc/mysql/mysql.cnf file, which is strange and shouldn't happen after you install the MySQL package.

So, there are two things at play here: the removal of a directory by hand, and not purging the right package.

I am assuming that you removed the /etc/mysql/ directory by hand (like I did in the reproduction steps above). However, your apt commands did not purge the package that owned the directory, which is mysql-server-8.0. In fact, you can check this by:

# dpkg -S /etc/mysql/
mysql-server-8.0: /etc/mysql

As a general rule, we should never manually remove something from the system that was installed by a package. In this specific case, the proper way to get rid of the directory is to purge the package that owns it:

# apt purge mysql-server-8.0

Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'.

However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, explain why you believe this is a bug in Ubuntu
rather than a problem specific to your system, and then change the bug
status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in mysql-8.0 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mysql-8.0 (Ubuntu) because there has been no activity for 60 days.]

Changed in mysql-8.0 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.