umet dependencies问题处理,mysql相关.

想在服务器上面也安装上NVIDIA-docker,结果上来就报错了.
一.

(base) ouc@ouc-Super-Server:~$ sudo apt install curl
[sudo] password for ouc: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.17) but it is not going to be installed
 mysql-client : Depends: mysql-community-client (= 8.0.29-1ubuntu18.04) but it is not going to be installed
 mysql-community-server : Depends: mysql-community-server-core (= 8.0.29-1ubuntu18.04) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

两个小时还是没有找到解决方案, 决定换个环境.换了之后发现还是一样的问题,我吐了,但是现在不知道怎么回事就好了,我只能记录下可能有用的步骤.

  1. sudo apt-get install -fsudo apt --fix-broken installsudo apt -f install这三个命令都尝试过,其作用应该是一样的,但是都会报如下错误
dpkg: error processing archive /var/cache/apt/archives/mysql-community-client_8.0.29-1ubuntu18.04_amd64.deb (--unpack):
 trying to overwrite '/usr/share/mysql-8.0/charsets/Index.xml', which is also in package mysql-community-common 8.0.26-2
Preparing to unpack .../mysql-community-server-core_8.0.29-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.29-1ubuntu18.04) ...
dpkg: error processing archive /var/cache/apt/archives/mysql-community-server-core_8.0.29-1ubuntu18.04_amd64.deb (--unpack):
 trying to overwrite '/usr/share/mysql-8.0/bulgarian/errmsg.sys', which is also in package mysql-community-common 8.0.26-2
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-community-client_8.0.29-1ubuntu18.04_amd64.deb
 /var/cache/apt/archives/mysql-community-server-core_8.0.29-1ubuntu18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

这个问题虽然现在解决了,但还是并不清除是如何解决的,还是会显示有关mysql的警告,但毕竟可以安装了。

针对上面这个错误,即E: Sub-process /usr/bin/dpkg returned an error code (1),我最后参考了这里的指导,其中主要是如下两个步骤,
(1)

(base) ouc@ouc-Super-Server:~$ sudo ls -l /var/lib/dpkg/info/ | grep -i 'mysql-*'
-rwxr-xr-x 1 root root    7402 1216 17:42 mysql-apt-config.config
-rw-r--r-- 1 root root     242 54 16:01 mysql-apt-config.list
-rw-r--r-- 1 root root     308 54 16:01 mysql-apt-config.md5sums
-rwxr-xr-x 1 root root    6252 1216 17:42 mysql-apt-config.postinst
-rwxr-xr-x 1 root root     975 1216 17:42 mysql-apt-config.postrm
-rw-r--r-- 1 root root    3124 1216 17:42 mysql-apt-config.templates
-rw-r--r-- 1 root root     312 53 14:27 mysql-client.list
-rw-r--r-- 1 root root     367 323 22:26 mysql-client.md5sums
-rw-r--r-- 1 root root      55 323 22:26 mysql-common.conffiles
-rw-r--r-- 1 root root     518 53 14:27 mysql-common.list

(2)

(base) ouc@ouc-Super-Server:~$ sudo rm -r /var/lib/dpkg/info/mysql-*

当我按照它的这么步骤做完之后,我再次尝试安装curl,结果还是失败的。

(base) ouc@ouc-Super-Server:~$ sudo apt install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.17) but it is not going to be installed
 mysql-client : Depends: mysql-community-client (= 8.0.29-1ubuntu18.04) but it is not going to be installed
 mysql-community-server : Depends: mysql-community-server-core (= 8.0.29-1ubuntu18.04) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

然后我对服务器重启了一次,切换了一个用户,还是会发生相同的错误,

(base) ouc@ouc-Super-Server:~$ sudo reboot
Connection to ×××.195.146.××× closed by remote host.
Connection to ×××.195.146.××× closed.

(base) wlj@wlj-OUC:~$ ssh li@×××.195.146.×××
li@×××.195.146.×××'s password: 
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-74-generic x86_64)
li@ouc-Super-Server:/$ sudo apt-get install -y \
>     apt-transport-https \
>     ca-certificates \
>     curl \
>     gnupg-agent \
>     software-properties-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.17) but it is not going to be installed
 gnupg-agent : Depends: gpg-agent (>= 2.2.4-1ubuntu1.4)
 gnupg2 : Depends: gnupg-agent (= 2.1.11-6ubuntu2.1)
 mysql-client : Depends: mysql-community-client (= 8.0.29-1ubuntu18.04) but it is not going to be installed
 mysql-community-server : Depends: mysql-community-server-core (= 8.0.29-1ubuntu18.04) but it is not going to be installed
 software-properties-common : Depends: python3-software-properties (= 0.96.24.32.18) but 0.96.20.8 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

然后我又切换成了原用户,再次使用sudo apt -f install, 这次Error变成了warning,可以正常执行了。

(base) ouc@ouc-Super-Server:~$ sudo apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  mysql-community-client mysql-community-server-core
The following NEW packages will be installed:
  mysql-community-client mysql-community-server-core
0 upgraded, 2 newly installed, 0 to remove and 470 not upgraded.
4 not fully installed or removed.
Need to get 26.4 MB of archives.
After this operation, 195 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.29-1ubuntu18.04 [2,922 kB]
Get:2 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.29-1ubuntu18.04 [23.5 MB]
Fetched 26.4 MB in 15s (1,776 kB/s)                                                                 
dpkg: warning: files list file for package 'mysql-community-libs' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-libs-compat' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-core' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-plugins' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-apt-config' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-devel' missing; assuming package has no files currently installed
(Reading database ... 250303 files and directories currently installed.)
Preparing to unpack .../mysql-community-client_8.0.29-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client (8.0.29-1ubuntu18.04) ...
Preparing to unpack .../mysql-community-server-core_8.0.29-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.29-1ubuntu18.04) ...
Setting up mysql-common (8.0.29-1ubuntu18.04) ...
Setting up mysql-community-server-core (8.0.29-1ubuntu18.04) ...
Setting up mysql-community-client (8.0.29-1ubuntu18.04) ...
Setting up mysql-client (8.0.29-1ubuntu18.04) ...
Setting up mysql-community-server (8.0.29-1ubuntu18.04) ...
Setting up mysql-server (8.0.29-1ubuntu18.04) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
W: APT had planned for dpkg to do more than it reported back (19 vs 23).
   Affected packages: mysql-common:amd64

但是mysql依然是不能运行的,

(base) ouc@ouc-Super-Server:~$ systemctl status mysql
Unit mysql.service could not be found.

不过可以安装curl了,目的也算是达到了,mysql 的警告就暂时不管了。感觉应该和重启有一定的关系,但是没有什么依据。

(base) ouc@ouc-Super-Server:~$ sudo apt-get install -y curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libcurl4
The following packages will be REMOVED:
  libcurl3
The following NEW packages will be installed:
  curl libcurl4
0 upgraded, 2 newly installed, 1 to remove and 469 not upgraded.
Need to get 379 kB of archives.
After this operation, 487 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.17 [220 kB]
Get:2 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 curl amd64 7.58.0-2ubuntu3.17 [159 kB]
Fetched 379 kB in 6s (65.5 kB/s)
dpkg: warning: files list file for package 'mysql-server' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-libs' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-libs-compat' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-core' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-plugins' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-apt-config' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-devel' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-server' missing; assuming package has no files currently installed
(Reading database ... 250515 files and directories currently installed.)
Removing libcurl3:amd64 (7.47.0-1ubuntu2.14) ...
Selecting previously unselected package libcurl4:amd64.
dpkg: warning: files list file for package 'mysql-server' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-libs' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-client' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-libs-compat' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-core' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-client-plugins' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-apt-config' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-devel' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mysql-community-server' missing; assuming package has no files currently installed
(Reading database ... 250508 files and directories currently installed.)
Preparing to unpack .../libcurl4_7.58.0-2ubuntu3.17_amd64.deb ...
Unpacking libcurl4:amd64 (7.58.0-2ubuntu3.17) ...
Selecting previously unselected package curl.
Preparing to unpack .../curl_7.58.0-2ubuntu3.17_amd64.deb ...
Unpacking curl (7.58.0-2ubuntu3.17) ...
Setting up libcurl4:amd64 (7.58.0-2ubuntu3.17) ...
Setting up curl (7.58.0-2ubuntu3.17) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...

两个小时,就搞了这么一件事情。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值