mysql“塞进”每个安装中,尽管我不想这样

mysql“塞进”每个安装中,尽管我不想这样

[Ubuntu 16.04]

我的机器上没有mysql运行它,我也不想要它。

我确实需要安装redis-server。所以我这样做了:

 $ sudo apt-get install redis-server
    E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

所以我继续...

$ sudo dpkg --configure -a
Setting up linux-aws-headers-4.4.0-1055 (4.4.0-1055.64) ...
Setting up linux-image-4.4.0-1055-aws (4.4.0-1055.64) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-1055-aws /boot/vmlinuz-4.4.0-1055-aws
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-1055-aws /boot/vmlinuz-4.4.0-1055-aws
update-initramfs: Generating /boot/initrd.img-4.4.0-1055-aws
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-1055-aws /boot/vmlinuz-4.4.0-1055-aws
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-1055-aws /boot/vmlinuz-4.4.0-1055-aws
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-1055-aws /boot/vmlinuz-4.4.0-1055-aws
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-1055-aws
Found initrd image: /boot/initrd.img-4.4.0-1055-aws
Found linux image: /boot/vmlinuz-4.4.0-1054-aws
Found initrd image: /boot/initrd.img-4.4.0-1054-aws
Found linux image: /boot/vmlinuz-4.4.0-1052-aws
Found initrd image: /boot/initrd.img-4.4.0-1052-aws
Found linux image: /boot/vmlinuz-4.4.0-1049-aws
Found initrd image: /boot/initrd.img-4.4.0-1049-aws
Found linux image: /boot/vmlinuz-4.4.0-1048-aws
Found initrd image: /boot/initrd.img-4.4.0-1048-aws
Found linux image: /boot/vmlinuz-4.4.0-1047-aws
Found initrd image: /boot/initrd.img-4.4.0-1047-aws
Found linux image: /boot/vmlinuz-4.4.0-1044-aws
Found initrd image: /boot/initrd.img-4.4.0-1044-aws
Found linux image: /boot/vmlinuz-4.4.0-1043-aws
Found initrd image: /boot/initrd.img-4.4.0-1043-aws
Found linux image: /boot/vmlinuz-4.4.0-1041-aws
Found initrd image: /boot/initrd.img-4.4.0-1041-aws
Found linux image: /boot/vmlinuz-4.4.0-1039-aws
Found initrd image: /boot/initrd.img-4.4.0-1039-aws
Found linux image: /boot/vmlinuz-4.4.0-1038-aws
Found initrd image: /boot/initrd.img-4.4.0-1038-aws
Found linux image: /boot/vmlinuz-4.4.0-1035-aws
Found initrd image: /boot/initrd.img-4.4.0-1035-aws
Found linux image: /boot/vmlinuz-4.4.0-1022-aws
Found initrd image: /boot/initrd.img-4.4.0-1022-aws
done
Setting up linux-headers-4.4.0-1055-aws (4.4.0-1055.64) ...
Setting up linux-image-aws (4.4.0.1055.57) ...
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).

它就停在了这一点上。必须按 CTRL-C 才能退出...

我再试一次...

$ sudo apt-get install redis-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-aws-headers-4.4.0-1022 linux-aws-headers-4.4.0-1035 linux-aws-headers-4.4.0-1038 linux-aws-headers-4.4.0-1039 linux-aws-headers-4.4.0-1041 linux-aws-headers-4.4.0-1043
  linux-aws-headers-4.4.0-1044 linux-aws-headers-4.4.0-1047 linux-aws-headers-4.4.0-1048 linux-aws-headers-4.4.0-1049 linux-aws-headers-4.4.0-1052 linux-headers-4.4.0-1022-aws
  linux-headers-4.4.0-1035-aws linux-headers-4.4.0-1038-aws linux-headers-4.4.0-1039-aws linux-headers-4.4.0-1041-aws linux-headers-4.4.0-1043-aws linux-headers-4.4.0-1044-aws
  linux-headers-4.4.0-1047-aws linux-headers-4.4.0-1048-aws linux-headers-4.4.0-1049-aws linux-headers-4.4.0-1052-aws linux-image-4.4.0-1022-aws linux-image-4.4.0-1035-aws
  linux-image-4.4.0-1038-aws linux-image-4.4.0-1039-aws linux-image-4.4.0-1041-aws linux-image-4.4.0-1043-aws linux-image-4.4.0-1044-aws linux-image-4.4.0-1047-aws
  linux-image-4.4.0-1048-aws linux-image-4.4.0-1049-aws linux-image-4.4.0-1052-aws newrelic-daemon newrelic-php5-common
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  redis-server
0 upgraded, 1 newly installed, 0 to remove and 113 not upgraded.
2 not fully installed or removed.
Need to get 343 kB of archives.
After this operation, 918 kB of additional disk space will be used.
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu xenial/universe amd64 redis-server amd64 2:3.0.6-1 [343 kB]
Fetched 343 kB in 0s (1,595 kB/s)    
Selecting previously unselected package redis-server.
(Reading database ... 357711 files and directories currently installed.)
Preparing to unpack .../redis-server_2%3a3.0.6-1_amd64.deb ...
Unpacking redis-server (2:3.0.6-1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).

从那一刻起,它就冻结了并且再也没有完成。它就停在了这一点。不得不按 CTRL-C 退出它...

我该如何解决这一困境?

答案1

当你这样做时sudo apt-get install redis-serverapt-get会告诉你

[snip]
2 not fully installed or removed.
[snip]

这意味着包处于“损坏”状态,既未安装也未删除。

mysql-server-5.7就是其中之一,这就是它不断“弹出”的原因。

如果您坚持Ctrl+C退出,这些错误就不会消失。

最简单的方法就是摆脱它:

sudo apt-get purge mysql-server-5.7

如果apt-get出现投诉,只需让它dpkg --configure -a完成(不要按Ctrl+ C,让它完成!),然后mysql-server-5.7使用上述命令删除。

相关内容