Cannot install mysql server 5.5 on ubuntu 14.04
Solution 1
Remove the cached deb file:
sudo rm /var/cache/apt/archives/mysql-server-5.5_5.5.43-0ubuntu0.14.04.1_amd64.deb
and try it again:
sudo apt-get install -f
sudo apt-get install mysql-client mysql-server
Alternatively, install version 5.6:
sudo apt-get remove mysql-server mysql-client
sudo apt-get install mysql-server-5.6 mysql-client-5.6
Solution 2
dpkg --get-selections | grep "mysql"
(It list all installed mysql in your system)
If still mysql installed In Your System remove it first by using following commands.
sudo apt-get --purge remove mysql
sudo apt-get autoremove mysql
sudo apt-get autoclean mysql
check for /etc/mysql/my.cnf and /var/lib/mysql files. If these files still exist then remove them by using
sudo rm -rf /etc/mysql/
sudo rm -rf /var/lib/mysql/
Above two commands completely removes your MySQL data directory and configuration file.please sure before removing it.
Once update your system:
sudo apt-get update
After update install MySQL server
sudo apt-get install mysql-client mysql-server
Related videos on Youtube
Savitoj Cheema
I am a developer by profession. It's been couple of years now that I have been working with web development technologies on Python, JavaScript and HTML. I am familiar with platforms like flask, Django, and NodeJS. I have used AngularJS, JQuery and Bootstrap for frontend development and I am open to learning new languages and platforms.
Updated on September 18, 2022Comments
-
Savitoj Cheema over 1 year
I have tried many ways to install mysql-server. I first tried installing by executing
sudo apt-get install mysql-client-5.5 mysql-server mysql-server-core-5.5
I was asked for root password, and that I did. But the install was not complete some unmet dependency came up. Very similar to in this question. I have then tried different combinations and unmet dependency issue went away but I started getting this
Preparing to unpack .../mysql-server_5.5.43-0ubuntu0.14.04.1_all.deb Unpacking mysql-server (5.5.43-0ubuntu0.14.04.1) ... Errors were encountered while processing: /var/cache/apt/archives/mysql-server-5.5_5.5.43- 0ubuntu0.14.04.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I have already tried removing and purging dependencies through various methods like in this question 2. I have also tried doing that via Aptitude and tried installing mysql-server again, but with no success. Please help me out!
-
A.B. almost 9 yearsRemove the cached archive:
sudo rm /var/cache/apt/archives/mysql-server-5.5_5.5.43- 0ubuntu0.14.04.1_amd64.deb
-
Savitoj Cheema almost 9 yearssudo rm /var/lib/mysql/debian-5.6.flag
-
Savitoj Cheema almost 9 yearsI did as you said and I remooved the debian .flag file too. It installed successfully but gave error at setting root password. Running
mysql
gave this errorERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
. So I gave up and installed 5.6 mysql server and client via Aptitude. Thanks anyways -
A.B. almost 9 yearsThan I have an answer for you :)
-
-
user269867 over 8 yearsInstalling new version of config file /etc/init.d/mysql Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld start: Job failed to start invoke-rc.d: initscript mysql, action "start" failed dpkg: error processing package mysql-server-5.6 (--configure): subprocess installed post-installation script returned error exit status 1 Setting up libhtml-template-perl (2.95-1) Setting up mysql-common-5.6 (5.6.27-0ubuntu0.14.04.1) Processing triggers for ureadahead Errors were encountered while processing:mysql-server-5.6 E: Sub-process /usr/bin/dpkg returned an error code (1)
-
Mathlight over 7 yearsJust a note for any future people with the same problem: I tried installing it as root, but wouldn't succeed. But as a normal user and
sudo
install all the packages, it worked. Maybe this will help anybody in the future... -
Sushivam over 7 yearsTried all the steps , removed all the mysql related packages, still i get ": dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: mysql-server-5.6 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)