Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open /proc/net/unix: No such file or directory // invoke-rc.d: could not determine current runlevel

I am trying to reinstall mysql-server on my wsl Ubuntu 18.04.

(I have MySQL server on Windows 10, but on port 3307. Idk if this matters but just in case!)

I couldn't sudo service mysql start nor sudo /etc/init.d/mysql start and it returned

No directory, logging in with HOME=/
mkdir: cannot create directory ‘//.cache’: Permission denied
-su: 19: /etc/profile.d/wsl-integration.sh: cannot create //.cache/wslu/integration: Directory nonexistent [Failed]

I googled about reinstalling mysql in Ubuntu and followed the following procedure.
- https://github.com/microsoft/WSL/issues/1761

sudo su
apt-get remove --purge 'mysql*'
apt-get autoremove
apt-get autoclean
rm -f /etc/mysql /var/lib/mysql
apt-get install mysql-server

But while trying apt-get install mysql-server I got the error below.

invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                                         [ OK ]
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not permitted
Cannot stat file /proc/1/fd/10: Operation not permitted
Cannot stat file /proc/1/fd/6: Operation not permitted
Cannot stat file /proc/5/fd/7: Operation not permitted
Cannot stat file /proc/5/fd/10: Operation not permitted
Cannot stat file /proc/5/fd/5: Operation not permitted
Cannot stat file /proc/843/fd/7: Operation not permitted
Cannot stat file /proc/843/fd/10: Operation not permitted
Cannot stat file /proc/843/fd/5: Operation not permitted
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

I've been googling Cannot open /proc/net/unix: No such file or directory and invoke-rc.d: could not determine current runlevel problems but could not find the right solution for this issue.

I really appreciate if you could give me some advice on this. Thanks!

like image 553
YouJin Avatar asked Oct 15 '22 05:10

YouJin


1 Answers

When I looked into the log file /var/log/mysql/error.log I found

[ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.

I disabled the use of Native AIO by creating a new config file /etc/mysql/conf.d/no_native_aio.conf:

[mysqld]
innodb_use_native_aio = 0 

Then I was able to start the databse server like so:

sudo service mysql start

I also had to run

 sudo mysql_secure_installation

to set the password for the root user.

and I had to trick dpkg into believing that postinstall script had run successfully by:

  • adding exit 0 as the second line in /var/lib/dpkg/info/mysql-server-8.0.postinst
  • running sudo dpkg --configure -a
  • removing the exit 0 from /var/lib/dpkg/info/mysql-server-8.0.postinst
like image 91
bjelli Avatar answered Oct 17 '22 19:10

bjelli