使用dpkg在ubuntu上安装软件包遇到依赖包的问题

简介: 使用dpkg在ubuntu上安装软件包遇到依赖包的问题

问题

在ubuntu上使用apt-get安装软件包,系统会自动安装依赖的软件包,但是使用dpkg在ubuntu上安装软件包时不会,有时会遇到下面的错误:

pengdl@pengdl-HP:~/Soft$ sudo dpkg -i virtualbox-7.0_7.0.14-161095~Ubuntu~focal_amd64.deb
[sudo] password for pengdl:
Selecting previously unselected package virtualbox-7.0.
(Reading database ... 278532 files and directories currently installed.)
Preparing to unpack virtualbox-7.0_7.0.14-161095~Ubuntu~focal_amd64.deb ...
Unpacking virtualbox-7.0 (7.0.14-161095~Ubuntu~focal) ...
dpkg: dependency problems prevent configuration of virtualbox-7.0:
 virtualbox-7.0 depends on libqt5help5 (>= 5.9.0); however:
  Package libqt5help5 is not installed.
 virtualbox-7.0 depends on libqt5opengl5 (>= 5.0.2); however:
  Package libqt5opengl5 is not installed.
 virtualbox-7.0 depends on libqt5x11extras5 (>= 5.6.0); however:
  Package libqt5x11extras5 is not installed.
 virtualbox-7.0 depends on libqt5xml5 (>= 5.0.2); however:
  Package libqt5xml5 is not installed.
dpkg: error processing package virtualbox-7.0 (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (245.4-4ubuntu3.23) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.15-1) ...
Errors were encountered while processing:
 virtualbox-7.0

解决

  • 查看当前的依赖关系问题:
$ sudo apt install --fix-missing
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:
 virtualbox-7.0 : Depends: libqt5help5 (>= 5.9.0) but it is not installed
                  Depends: libqt5opengl5 (>= 5.0.2) but it is not installed
                  Depends: libqt5x11extras5 (>= 5.6.0) but it is not installed
                  Depends: libqt5xml5 (>= 5.0.2) but it is not installed
                  Recommends: libsdl-ttf2.0-0 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
  • 解决依赖关系问题
$ sudo apt install --fix-broken
pengdl@pengdl-HP:~/Soft$ sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  gir1.2-goa-1.0 libfwupdplugin1 libpkgconf3 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libqt5help5 libqt5opengl5 libqt5sql5 libqt5sql5-sqlite libqt5x11extras5 libqt5xml5
The following NEW packages will be installed:
  libqt5help5 libqt5opengl5 libqt5sql5 libqt5sql5-sqlite libqt5x11extras5 libqt5xml5
0 upgraded, 6 newly installed, 0 to remove and 12 not upgraded.
1 not fully installed or removed.
Need to get 554 kB of archives.
After this operation, 2,408 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 libqt5sql5 amd64 5.12.8+dfsg-0ubuntu2.1 [121 kB]
Get:2 http://mirrors.aliyun.com/ubuntu focal/universe amd64 libqt5help5 amd64 5.12.8-0ubuntu1 [134 kB]
Get:3 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 libqt5opengl5 amd64 5.12.8+dfsg-0ubuntu2.1 [136 kB]
Get:4 http://mirrors.aliyun.com/ubuntu focal/universe amd64 libqt5x11extras5 amd64 5.12.8-0ubuntu1 [10.3 kB]
Get:5 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 libqt5xml5 amd64 5.12.8+dfsg-0ubuntu2.1 [105 kB]
Get:6 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 libqt5sql5-sqlite amd64 5.12.8+dfsg-0ubuntu2.1 [47.6 kB]
Fetched 554 kB in 1s (385 kB/s)
Selecting previously unselected package libqt5sql5:amd64.
(Reading database ... 279268 files and directories currently installed.)
Preparing to unpack .../0-libqt5sql5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5sql5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5help5:amd64.
Preparing to unpack .../1-libqt5help5_5.12.8-0ubuntu1_amd64.deb ...
Unpacking libqt5help5:amd64 (5.12.8-0ubuntu1) ...
Selecting previously unselected package libqt5opengl5:amd64.
Preparing to unpack .../2-libqt5opengl5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5opengl5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5x11extras5:amd64.
Preparing to unpack .../3-libqt5x11extras5_5.12.8-0ubuntu1_amd64.deb ...
Unpacking libqt5x11extras5:amd64 (5.12.8-0ubuntu1) ...
Selecting previously unselected package libqt5xml5:amd64.
Preparing to unpack .../4-libqt5xml5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5sql5-sqlite:amd64.
Preparing to unpack .../5-libqt5sql5-sqlite_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5sql5-sqlite:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5x11extras5:amd64 (5.12.8-0ubuntu1) ...
Setting up libqt5sql5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5opengl5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5sql5-sqlite:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5help5:amd64 (5.12.8-0ubuntu1) ...
Setting up virtualbox-7.0 (7.0.14-161095~Ubuntu~focal) ...
Adding group `vboxusers' (GID 138) ...
Done.
Processing triggers for libc-bin (2.31-0ubuntu9.14) ...

完。

相关文章
|
7天前
|
存储 Ubuntu Linux
关于实体机安装Ubuntu 22.04.3-desktop-amd64遇见的一些问题
【10月更文挑战第5天】本文介绍了Ubuntu安装过程中常见的四个问题及其解决方案,包括分区设置、驱动问题、软件安装问题和启动问题。对于分区,推荐新手选择自动分区,手动分区需了解基本概念。驱动问题可通过安装相应硬件的Linux驱动解决。软件安装问题可更换国内镜像源或修复依赖关系。启动问题则可尝试进入恢复模式修复或根据错误提示信息寻求帮助。
|
16小时前
|
Ubuntu Unix 应用服务中间件
Ubuntu16.04.1 安装Nginx
Ubuntu16.04.1 安装Nginx
|
2天前
|
Ubuntu 网络安全 Apache
Ubuntu下安装Apache2.4.7遇到的问题及解决办法
Ubuntu下安装Apache2.4.7遇到的问题及解决办法
|
2天前
|
Kubernetes 网络安全 容器
基于Ubuntu-22.04安装K8s-v1.28.2实验(一)部署K8s
基于Ubuntu-22.04安装K8s-v1.28.2实验(一)部署K8s
11 2
|
1天前
|
NoSQL Ubuntu Redis
Ubuntu安装redis
本文介绍了在Ubuntu系统上安装Redis的两种方法:一种是通过编译安装本地Redis包,包括下载、解压、编译安装、配置启动和测试连接的步骤;另一种是通过apt安装在线的Redis包,并提供了更新系统软件包列表、安装Redis服务器、检查Redis服务器状态和测试连接的命令。
9 0
Ubuntu安装redis
|
2天前
|
存储 Kubernetes 负载均衡
基于Ubuntu-22.04安装K8s-v1.28.2实验(四)使用域名访问网站应用
基于Ubuntu-22.04安装K8s-v1.28.2实验(四)使用域名访问网站应用
10 1
|
2天前
|
负载均衡 应用服务中间件 nginx
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
11 1
|
10天前
|
存储 Ubuntu
关于实体机安装Ubuntu 22.04.3-desktop-amd64遇见的一些问题
【10月更文挑战第2天】本文详细介绍了在使用 Ubuntu 过程中常见的五个问题及其解决方案:下载镜像文件速度慢或损坏,可更换镜像源或验证哈希值;制作启动盘失败,需检查 U 盘及设置;安装过程中的分区问题,需合理规划分区;安装后的驱动问题,可通过安装官方驱动解决;软件安装和更新问题,需检查仓库配置及依赖关系。
|
15小时前
|
Ubuntu jenkins 持续交付
Ubuntu系统 用docker安装jenkins
Ubuntu系统 用docker安装jenkins
|
1天前
|
Ubuntu Linux 网络安全
如何在Ubuntu 22.04或20.04 Linux上安装MobaXterm
虽然直接在Ubuntu 22.04或20.04上安装MobaXterm是不可能的任务,因为它是专为Windows设计的,但Ubuntu系统提供了丰富的原生工具和替代方案,足以满足远程管理、文件传输等需求。如果你对MobaXterm的特定功能有强烈需求,考虑采用Windows子系统或虚拟机方案作为折衷方案,不失为一种可行之道。在追求高效工作流的同时,不妨也探索和熟悉Linux原生工具,它们往往能提供更为无缝的集成体验。
10 0