[已解决]libgtk2.0-dev依赖包的问题

问题描述:
由于重装系统的原因,所以重新安装opencv,在安装opencv 的依赖项时,发现一直安装不上libgtk2.0-dev,在网上看到的主要方法大致分为4种
1.更换源,但将源更换为阿里或者清华的源后,仍为解决问题
2.对库进行降级操作,参考这篇博客
3.从软件和更新入手的,参考这篇博客
4.还有个操作比较骚的,参考这篇博客
我从方法1试到方法4均未解决问题,在进行操作四的时候,逐个安装软件和依赖,直接导致系统图表都不见,ctrl+t无法进入终端,无法关机,因为把系统核心的一些库删了,没办法,只能再度重新安装系统,,,
重装完系统后,再度安装opencv的依赖,发现居然可以安装了!!!!!
想了一下原因,大概是因为在上个系统中为了加快安装软件的速度,更换了源,现在的源是系统自带的源,所以现在可以直接下而之前不可以,将自己的源分享给大家,希望能帮到大家

#deb cdrom:[Ubuntu 18.04.3 LTS _Bionic Beaver_ - Release amd64 (20190805)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
PackagesNotFoundError: "libgtk2.0-dev" 错误通常出现在使用管理器(如 Debian、Ubuntu 的 apt 或者 Arch Linux 的 pacman)安装软件时,提示找不到特定的库或开发工具。这个错误表明系统中无法找到名为 "libgtk2.0-dev" 的依赖项,这通常是用于构建和运行使用 GTK+(图形用户界面工具)的应用程序。 为了解决这个问题,你可以尝试以下步骤: 1. **更新列表**: - 对于 Ubuntu/Debian: `sudo apt-Syu` 2. **直接安装缺失的**: - 使用命令:`sudo apt-get install libgtk2.0-dev` (Debian/Ubuntu) - 或者:`sudo pacman -S libgtk2.0-dev` (Arch Linux) 3. **检查是否需升级或安装前缀的依赖**: - 如果有更高版本的可用,可能需要先安装其依赖。 4. **检查第三方源**: - 在某些情况下,你需要添加额外的源(如 PPAs),才能获取到这个特定的。比如,对于非官方的 Deb ,可以查看相应软件的文档或社区指导。 5. **如果是在虚拟环境中**: - 如果你在虚拟环境中,确保已经设置了正确的环境变量,比如 Anaconda 或者 Python 的 virtualenv 中,可能需要激活相应的环境并重新安装。 6. **检查权限**: - 如果你是 root 用户,确认没有权限问题,如果不是,请尝试切换到 root 并执行上述操作。 务必根据你的具体操作系统和环境来调整这些步骤。如果问题依然存在,可能是由于网络连接问题或者源的问题,这时你可以尝试更换网络环境或者联系相关的开发者社区寻求帮助。
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值