Manually removing /etc/mysql results in install/upgrade failures, with errors like "Can't read dir of '/etc/mysql/conf.d/'"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-8.0 (Ubuntu) |
Triaged
|
Wishlist
|
Lars Tangvald |
Bug Description
$ sudo apt purge mysql-server
$ sudo rm -rf /etc/mysql
$ dpkg -l | grep mysql
result:
ii libmysqlclient2
ii mysql-common 5.8+1.0.5ubuntu2 all MySQL database common files, e.g. /etc/mysql/my.cnf
sudo apt-get install mysql-server
result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-7
libevent-
mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0
mysql-
Suggested packages:
libipc-
The following NEW packages will be installed:
libaio1 libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-7
libevent-
mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0
mysql-
0 upgraded, 16 newly installed, 0 to remove and 2 not upgraded.
Need to get 30,6 MB/30,6 MB of archives.
After this operation, 249 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Get:13 http://
Get:14 http://
Get:15 http://
Fetched 30,6 MB in 2min 11s (233 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-client-
(Reading database ... 171059 files and directories currently installed.)
Preparing to unpack .../00-
Unpacking mysql-client-
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../01-
Unpacking mysql-client-8.0 (8.0.23-
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../02-
Unpacking libaio1:amd64 (0.3.112-5) ...
Selecting previously unselected package libevent-
Preparing to unpack .../03-
Unpacking libevent-
Selecting previously unselected package libevent-
Preparing to unpack .../04-
Unpacking libevent-
Selecting previously unselected package libmecab2:amd64.
Preparing to unpack .../05-
Unpacking libmecab2:amd64 (0.996-10build1) ...
Selecting previously unselected package mysql-server-
Preparing to unpack .../06-
Unpacking mysql-server-
Selecting previously unselected package mysql-server-8.0.
Preparing to unpack .../07-
grep: /etc/mysql/: No such file or directory
Unpacking mysql-server-8.0 (8.0.23-
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../08-
Unpacking libcgi-pm-perl (4.46-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../09-
Unpacking libfcgi-perl (0.79-1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../10-
Unpacking libcgi-fast-perl (1:2.15-1) ...
Selecting previously unselected package libhtml-
Preparing to unpack .../11-
Unpacking libhtml-
Selecting previously unselected package mecab-utils.
Preparing to unpack .../12-
Unpacking mecab-utils (0.996-10build1) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../13-
Unpacking mecab-ipadic (2.7.0-
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../14-
Unpacking mecab-ipadic-utf8 (2.7.0-
Selecting previously unselected package mysql-server.
Preparing to unpack .../15-
Unpacking mysql-server (8.0.23-
Setting up libmecab2:amd64 (0.996-10build1) ...
Setting up mysql-client-
Setting up libcgi-pm-perl (4.46-1) ...
Setting up libhtml-
Setting up mecab-utils (0.996-10build1) ...
Setting up libevent-
Setting up mysql-client-8.0 (8.0.23-
Setting up libfcgi-perl (0.79-1) ...
Setting up libaio1:amd64 (0.3.112-5) ...
Setting up libevent-
Setting up mecab-ipadic (2.7.0-
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/
emitting double-array: 100% |######
/usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
emitting double-array: 100% |######
reading /usr/share/
emitting matrix : 100% |######
done!
update-
Setting up libcgi-fast-perl (1:2.15-1) ...
Setting up mysql-server-
Setting up mecab-ipadic-utf8 (2.7.0-
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/
emitting double-array: 100% |######
/usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
emitting double-array: 100% |######
reading /usr/share/
emitting matrix : 100% |######
done!
update-
Setting up mysql-server-8.0 (8.0.23-
update-
update-
update-
Renaming removed key_buffer and myisam-recover options (if present)
ERROR: Unable to start MySQL server:
mysqld: Can't read dir of '/etc/mysql/
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Please take a look at https:/
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for systemd (245.4-4ubuntu3.4) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
-------
Fixing method:
Check if /etc/mysql directory exist. If it exist, then check if /etc/mysql/conf.d/ exist. It it not exist, then check if /etc/mysql/
$ sudo ln -s /etc/mysql/
That command create symbolic link to provide compatibility. After that, run command below.
$ sudo apt-get --fix-broken install
That's it ^_^
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.23-
ProcVersionSign
Uname: Linux 5.8.0-41-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Thu Feb 4 22:07:18 2021
ErrorMessage: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2021-02-02 (2 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
Logs.var.
Logs.var.
ProcCmdline: BOOT_IMAGE=
Python3Details: /usr/bin/python3.8, Python 3.8.5, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.4
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.23-
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | removed: need-duplicate-check |
Changed in mysql-8.0 (Ubuntu): | |
status: | Incomplete → Confirmed |
Changed in mysql-8.0 (Ubuntu): | |
assignee: | nobody → Lars Tangvald (lars-tangvald) |
description: | updated |
summary: |
package mysql-server-8.0 8.0.23-0ubuntu0.20.04.1 failed to - install/upgrade: installed mysql-server-8.0 package post-installation - script subprocess returned error exit status 1 + install/upgrade: After installing mysql-8.0 on system that had mysql-5.7 + removed previously, with error "Can't read dir of '/etc/mysql/conf.d/'" |
summary: |
- package mysql-server-8.0 8.0.23-0ubuntu0.20.04.1 failed to - install/upgrade: After installing mysql-8.0 on system that had mysql-5.7 - removed previously, with error "Can't read dir of '/etc/mysql/conf.d/'" + Manually removing /etc/mysql results in install/upgrade failures, with + errors like "Can't read dir of '/etc/mysql/conf.d/'" |
Changed in mysql-8.0 (Ubuntu): | |
importance: | Undecided → Wishlist |
status: | Confirmed → Triaged |
------- ------- ------- mysql.conf. d exist. If it exist then run the command below. mysql.conf. d /etc/mysql/conf.d
Fixing method:
Check if /etc/mysql directory exist. If it exist, then check if /etc/mysql/conf.d/ exist. It it not exist, then check if /etc/mysql/
$ sudo ln -s /etc/mysql/
That command create symbolic link to provide compatibility. After that, run command below.
$ sudo apt-get --fix-broken install
That's it ^_^