Linux – Cannot install MYSQL using aptitude…can anyone tell me why

aptitudeinstallationlinuxMySQLunix

It just stops and freezes after this.

 The following packages will be upgraded:
      libmysqlclient15off mysql-client mysql-client-5.0 mysql-common
    4 packages upgraded, 4 newly installed, 0 to remove and 49 not upgraded.
    Need to get 38.0MB of archives. After unpacking 91.1MB will be used.
    Do you want to continue? [Y/n/?] y
    Writing extended state information... Done
    Get:1 http://archive.ubuntu.com jaunty-updates/main mysql-common 5.1.30really5.0                                                       .75-0ubuntu10.2 [62.9kB]
    Get:2 http://archive.ubuntu.com jaunty-updates/main mysql-client 5.1.30really5.0                                                       .75-0ubuntu10.2 [55.0kB]
    Get:3 http://archive.ubuntu.com jaunty-updates/main libmysqlclient15off 5.1.30re                                                       ally5.0.75-0ubuntu10.2 [1878kB]
    Get:4 http://archive.ubuntu.com jaunty-updates/main mysql-client-5.0 5.1.30reall                                                       y5.0.75-0ubuntu10.2 [8292kB]
    Get:5 http://archive.ubuntu.com jaunty-updates/main mysql-server-core-5.0 5.1.30                                                       really5.0.75-0ubuntu10.2 [3534kB]
    Get:6 http://archive.ubuntu.com jaunty-updates/main mysql-server-5.0 5.1.30reall                                                       y5.0.75-0ubuntu10.2 [24.0MB]
    Get:7 http://archive.ubuntu.com jaunty/main libhtml-template-perl 2.9-1 [65.8kB]
    Get:8 http://archive.ubuntu.com jaunty-updates/main mysql-server 5.1.30really5.0                                                       .75-0ubuntu10.2 [57.2kB]
    Fetched 38.0MB in 3s (10.8MB/s)
    Preconfiguring packages ...
    (Reading database ... 17211 files and directories currently installed.)
    Preparing to replace mysql-common 5.1.30really5.0.75-0ubuntu10 (using .../mysql-                                                       common_5.1.30really5.0.75-0ubuntu10.2_all.deb) ...
    Unpacking replacement mysql-common ...
    Preparing to replace mysql-client 5.1.30really5.0.75-0ubuntu10 (using .../mysql-                                                       client_5.1.30really5.0.75-0ubuntu10.2_all.deb) ...
    Unpacking replacement mysql-client ...
    Preparing to replace libmysqlclient15off 5.1.30really5.0.75-0ubuntu10 (using ...                                                       /libmysqlclient15off_5.1.30really5.0.75-0ubuntu10.2_amd64.deb) ...
    Unpacking replacement libmysqlclient15off ...
    Preparing to replace mysql-client-5.0 5.1.30really5.0.75-0ubuntu10 (using .../my                                                       sql-client-5.0_5.1.30really5.0.75-0ubuntu10.2_amd64.deb) ...
    Unpacking replacement mysql-client-5.0 ...
    Selecting previously deselected package mysql-server-core-5.0.
    Unpacking mysql-server-core-5.0 (from .../mysql-server-core-5.0_5.1.30really5.0.                                                       75-0ubuntu10.2_amd64.deb) ...
    Setting up mysql-common (5.1.30really5.0.75-0ubuntu10.2) ...
    Selecting previously deselected package mysql-server-5.0.
    (Reading database ... 17290 files and directories currently installed.)
    Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.1.30really5.0.75-0ubuntu                                                       10.2_amd64.deb) ...
     * Stopping MySQL database server mysqld                                 [ OK ]
    Selecting previously deselected package libhtml-template-perl.
    Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.9-1_all.deb) .                                                       ..
    Selecting previously deselected package mysql-server.
    Unpacking mysql-server (from .../mysql-server_5.1.30really5.0.75-0ubuntu10.2_all                                                       .deb) ...
     * Stopping MySQL database server mysqld                                 [ OK ]
    Setting up libmysqlclient15off (5.1.30really5.0.75-0ubuntu10.2) ...

    Setting up mysql-client-5.0 (5.1.30really5.0.75-0ubuntu10.2) ...
    Setting up mysql-client (5.1.30really5.0.75-0ubuntu10.2) ...
    Setting up mysql-server-core-5.0 (5.1.30really5.0.75-0ubuntu10.2) ...
    Setting up mysql-server-5.0 (5.1.30really5.0.75-0ubuntu10.2) ...
     * Stopping MySQL database server mysqld                                 [ OK ]
     * /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debi                                                       an.gz
     * Starting MySQL database server mysqld                                 [fail]
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.0 (--configure):
     subprocess post-installation script returned error exit status 1
    Setting up libhtml-template-perl (2.9-1) ...
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-5.0; however:
      Package mysql-server-5.0 is not configured yet.
    dpkg: error processing mysql-server (--configure):
     dependency problems - leaving unconfigured
    Processing triggers for libc6 ...
    No apport report written because the error message indicates its a followup erro                                                       r from a previous failure.
                              ldconfig deferred processing now taking place
    Errors were encountered while processing:
     mysql-server-5.0
     mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install.  Trying to recover:
    Setting up mysql-server-5.0 (5.1.30really5.0.75-0ubuntu10.2) ...
     * Stopping MySQL database server mysqld                                 [ OK ]
     * /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debi                                                       an.gz
     * Starting MySQL database server mysqld                                 [ OK ]
    /etc/init.d/mysql: line 115: /etc/mysql/debian-start: No such file or directory
    invoke-rc.d: initscript mysql, action "start" failed.

Best Answer

Because when you removed the packages last time, you only removed them, not purged them, and then you deleted the config files by hand. So dpkg thinks you don't want a default config file (because you deleted it), so it doesn't install a new one, and MySQL has a cry.

Purge all mysql-related packages and try again.