【Linux环境配置】使用aptitude解决Ubuntu安装libsdl2-dev提示的unmet dependencies依赖不满足错误问题

1. 问题现象

  • 已经安装的库文件版本太新, 依赖不满足, 导致无法安装新软件
$ sudo apt-get install libsdl2-dev 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpulse-dev : Depends: libpulse0 (= 1:15.99.1+dfsg1-1ubuntu1) but 1:15.99.1+dfsg1-1ubuntu2.1 is to be installed
                Depends: libpulse-mainloop-glib0 (= 1:15.99.1+dfsg1-1ubuntu1) but 1:15.99.1+dfsg1-1ubuntu2.1 is to be installed
 libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3.7) but 249.11-0ubuntu3.11 is to be installed
E: Unable to correct problems, you have held broken packages.

2. 分步手动解决方案

2.1 安装 aptitude 工具

# 先安装工具 aptitude
$ sudo aptitude install aptitude

2.2 使用 aptitude 工具手动解决部分依赖关系

# 使用aptitude再次执行安装, 先安装上面依赖的一个库
$ sudo aptitude install libudev-dev
The following NEW packages will be installed:
  libudev-dev{
   
   b} 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.7 kB of archives. After unpacking 270 kB will be used.
The following packages have unmet dependencies:
 libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3.7) but 249.11-0ubuntu3.11 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libudev-dev [Not Installed]                        


# 注意下面这行, 选择 `n` 否决上面的 不安装方案, 让工具提示其他方案;
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Remove the following packages:                                            
1)      udev [249.11-0ubuntu3.11 (now)]                                         

      Install the following packages:                                           
2)      gcc-12-base:i386 [12.3.0-1ubuntu1~22.04 (jammy-security)]               
3)      krb5-locales [1.19.2-2ubuntu0.3 (jammy-security)]                       
4)      libacl1:i386 [2.3.1-1 (jammy)]                                          
5)      libblkid1:i386 [2.37.2-4ubuntu3 (jammy)]                                
6)      libc6:i386 [2.35-0ubuntu3.6 (jammy-security)]                           
7)      libcap2:i386 [1:2.44-1ubuntu0.22.04.1 (jammy-security)]                 
8)      libcom-err2:i386 [1.46.5-2ubuntu1.1 (jammy-security)]                   
9)      libcrypt1:i386 [1:4.4.27-1 (jammy)]                                     
10)     libgcc-s1:i386 [12.3.0-1ubuntu1~22.04 (jammy-security)]                 
11)     libgssapi-krb5-2:i386 [1.19.2-2ubuntu0.3 (<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

逸云沙鸥のIHave@Dream

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值