使用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) ...

完。

相关文章
|
2月前
|
并行计算 Ubuntu Linux
Ubuntu学习笔记(五):18.04安装多版本CUDA
这篇博客文章介绍了在Ubuntu 18.04系统上如何安装和切换不同版本的CUDA,以及如何安装不同版本的cuDNN。
236 2
|
2月前
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
4829 3
|
1天前
|
Ubuntu Linux Docker
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
31 11
|
1月前
|
Ubuntu 开发工具 git
Ubuntu安装homebrew的完整教程
本文介绍了如何在没有公网的情况下安装 Homebrew。首先访问 Homebrew 官网,然后通过阿里云的镜像克隆安装脚本,并创建普通用户进行安装。接着修改 `install.sh` 文件指向国内镜像,执行安装命令。最后配置环境变量并更换 Homebrew 源为国内镜像,确保安装顺利。
225 50
|
24天前
|
Ubuntu
ubuntu和debian 的安装包dpkg管理命令对安装包进行安装,查询,卸载
Ubuntu dpkg 软件包管理命令概览:安装、卸载、查看和配置软件包。包括解决依赖、强制卸载、列出及过滤已安装包、查看包详情等操作。
53 10
|
26天前
|
Ubuntu API 开发工具
PSOPT在Ubuntu22.04下的安装
通过上述步骤,可以在Ubuntu 22.04下成功安装并配置PSOPT。PSOPT是一个功能强大的工具,适用于解决各种最优控制问题。确保在安装前满足系统要求,并仔细按照步骤操作,可以避免大多数常见问题。通过MATLAB与PSOPT的结合,您可以更高效地处理复杂的控制问题,并获得准确的解决方案。
31 5
|
27天前
|
Ubuntu 网络协议 关系型数据库
超聚变服务器2288H V6使用 iBMC 安装 Ubuntu Server 24.04 LTS及后续系统配置
【11月更文挑战第15天】本文档详细介绍了如何使用iBMC在超聚变服务器2288H V6上安装Ubuntu Server 24.04 LTS,包括连接iBMC管理口、登录iBMC管理界面、配置RAID、安装系统以及后续系统配置等步骤。
|
2月前
|
Ubuntu Linux 测试技术
Linux系统之Ubuntu安装cockpit管理工具
【10月更文挑战第13天】Linux系统之Ubuntu安装cockpit管理工具
200 4
Linux系统之Ubuntu安装cockpit管理工具
|
2月前
|
Ubuntu 应用服务中间件 nginx
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
本文是关于Ubuntu系统中使用ffmpeg 3.2.16源码编译OpenCV 3.4.0的安装笔记,包括安装ffmpeg、编译OpenCV、卸载OpenCV以及常见报错处理。
201 2
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
|
2月前
|
Ubuntu Linux C语言
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0
本文介绍了在Ubuntu 18.04系统上编译安装OpenCV 3.4.0及其扩展包opencv_contrib 3.4.0的详细步骤,包括下载源码、安装依赖、配置CMake和编译安装,以及常见问题的解决方法。
218 1
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0