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

完。

相关文章
|
1月前
|
并行计算 Ubuntu Linux
Ubuntu学习笔记(五):18.04安装多版本CUDA
这篇博客文章介绍了在Ubuntu 18.04系统上如何安装和切换不同版本的CUDA,以及如何安装不同版本的cuDNN。
196 2
|
1月前
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
3434 3
|
9天前
|
Ubuntu 开发工具 git
Ubuntu安装homebrew的完整教程
本文介绍了如何在没有公网的情况下安装 Homebrew。首先访问 Homebrew 官网,然后通过阿里云的镜像克隆安装脚本,并创建普通用户进行安装。接着修改 `install.sh` 文件指向国内镜像,执行安装命令。最后配置环境变量并更换 Homebrew 源为国内镜像,确保安装顺利。
103 50
|
1月前
|
Ubuntu Linux 测试技术
Linux系统之Ubuntu安装cockpit管理工具
【10月更文挑战第13天】Linux系统之Ubuntu安装cockpit管理工具
121 4
Linux系统之Ubuntu安装cockpit管理工具
|
1月前
|
Ubuntu 应用服务中间件 nginx
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
本文是关于Ubuntu系统中使用ffmpeg 3.2.16源码编译OpenCV 3.4.0的安装笔记,包括安装ffmpeg、编译OpenCV、卸载OpenCV以及常见报错处理。
142 2
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
|
1月前
|
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和编译安装,以及常见问题的解决方法。
90 1
Ubuntu安装笔记(二):ubuntu18.04编译安装opencv 3.4.0 opencv_contrib3.4.0
|
1月前
|
Ubuntu 虚拟化
软件安装(二):VMware ubuntu20.04 安装步骤
这篇文章是关于如何在VMware Workstation 16 Player上安装Ubuntu 20.04桌面版的详细步骤指南。
169 2
软件安装(二):VMware ubuntu20.04 安装步骤
|
1月前
|
PyTorch TensorFlow 算法框架/工具
Jetson环境安装(一):Ubuntu18.04安装pytorch、opencv、onnx、tensorflow、setuptools、pycuda....
本文提供了在Ubuntu 18.04操作系统的NVIDIA Jetson平台上安装深度学习和计算机视觉相关库的详细步骤,包括PyTorch、OpenCV、ONNX、TensorFlow等。
44 1
Jetson环境安装(一):Ubuntu18.04安装pytorch、opencv、onnx、tensorflow、setuptools、pycuda....
|
1月前
|
消息中间件 监控 Ubuntu
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
76 3
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
|
5天前
|
Ubuntu Java
Ubuntu之jdk安装
以下是Ubuntu之jdk安装的详细内容
13 0