我想我知道自己在 Unix shell 中做什么但可能不知道。
我在 MySQL 的配置文件中犯了一个错误,所以我决定卸载它然后重新安装它,所以我这样做了:
sudo apt-get --purge remove mysql-server mysql-server-5.0 mysql-client
文件被删除了,所以我尝试安装它,但它没有要求我输入 root 密码或其他任何东西,所以我再次使用上述命令卸载它,然后
sudo rm -rf /etc/mysql
sudo rm /etc/init.d/mysql
sudo rm -rf /var/lib/mysql*
然后我重新启动了计算机,然后再次安装它:
sudo apt-get install mysql-server mysql-client
它要求输入 root 密码,一切看起来都正常,直到我看到这个:
$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-server-5.0
Suggested packages:
tinyca
The following NEW packages will be installed:
mysql-client mysql-server mysql-server-5.0
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/27.4MB of archives.
After this operation, 86.7MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
mysql-server-5.0 mysql-client mysql-server
Authentication warning overridden.
Preconfiguring packages ...
Can't exec "/tmp/mysql-server-5.0.config.28101": Permission denied at /usr/share/perl/5.10/IPC/Open3.pm line 168.
open2: exec of /tmp/mysql-server-5.0.config.28101 configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 59
mysql-server-5.0 failed to preconfigure, with exit status 255
Selecting previously deselected package mysql-server-5.0.
(Reading database ... 160284 files and directories currently installed.)
Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.51a-24+lenny5_amd64.deb) ...
Selecting previously deselected package mysql-client.
Unpacking mysql-client (from .../mysql-client_5.0.51a-24+lenny5_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.0.51a-24+lenny5_all.deb) ...
Processing triggers for man-db ...
Setting up mysql-server-5.0 (5.0.51a-24+lenny5) ...
Stopping MySQL database server: mysqld.
/var/lib/dpkg/info/mysql-server-5.0.postinst: line 144: /etc/mysql/conf.d/old_passwords.cnf: No such file or directory
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
Setting up mysql-client (5.0.51a-24+lenny5) ...
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
Errors were encountered while processing:
mysql-server-5.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
现在我似乎不知道该怎么做。我现在只想获得一个干净的 MySQL 安装。我正在运行 Debian 的最新稳定版本。
非常感谢所有帮助 — 谢谢!
编辑:我看了这个类似的问题,这建议我卸载 mysql-common,但是当我尝试这样做时,我看到:
The following packages will be REMOVED:
apache2 apache2-mpm-prefork apache2-utils apache2.2-common git-svn libapache2-mod-php5 libapache2-mod-python libapache2-svn libaprutil1
libdbd-mysql-perl libdbd-mysql-rubygem libmysql-ruby libmysql-ruby1.8 libmysql-rubygem libmysqlclient15-dev libmysqlclient15off librdf-perl librdf0
libserf-0-0 libsvn-perl libsvn1 mysql-client-5.0 mysql-common mytop ndn-apache22-php5 ndn-apache22-svn ndn-interpreters ndn-lighttpd
ndn-netsaint-plugins ndn-perl-modules ndn-php5-cgi ndn-php5-xcache ndn-php53 ndn-php53-suhosin ndn-rubygems php5 php5-mcrypt php5-mysql proftpd
proftpd-mod-mysql python-django python-mysqldb python-subversion python-svn subversion subversion-tools trac zendoptimizer
0 upgraded, 0 newly installed, 48 to remove and 1 not upgraded.
哎呀!有什么建议吗?
答案1
dpkg 无法执行配置脚本。这是 Linux-VServer 的问题。
使用 exec 选项重新挂载 /tmp。