解决:Unable to correct problems,The following packages have unmet dep

 Depends: ros-kinetic-simulators but it is not going to be installed

 

之前一直正常的apt,突然就不好用了。一种原因是已经安装的包的版本和当前要安装的包出现了版本冲突。这样的情况下,只要卸载之后再重新安装就好了。

卸载可以用

$apt-get autoremove 

$apt-get purge your_pacakename

$ sudo aptitude install libgazebo7-dev
aptitude在PC机的ubuntu上可以正常使用。

如果是在tx2或者xavier上就不要使用aptitude了;之前亲测,在xavier上用aptitude,结果调入万丈深渊,apt都挂掉了。

卸载了冲突包之后,在按正常流程安装所需要的包就好了。

----------------------------

$ sudo apt-get  install openssh-server 
Reading package lists... Done
Building dependency tree       
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:
 openssh-server : Depends: openssh-client (= 1:7.2p2-4)
                  Depends: openssh-sftp-server but it is not going to be installed
                  Recommends: ssh-import-id but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决方法

给需要的源打钩,不需要的源不打钩。

关闭后$sudo apt-get update搞定。

如果还是不行,则,

https://sourcedigit.com/22691-unmet-dependencies-error-ubuntu-unmet-dependencies-ubuntu-desktop/

How To Fix Unmet Dependencies Error On Ubuntu

By Sourabh / September 11, 2017Category: How ToUbuntu

How to fix unmet dependencies error on Ubuntu. If you see the message “the following packages have unmet dependencies”, here’s how to remove packages with unmet dependencies on Linux Ubuntu Systems.

Unmet Dependency Errors

Unmet Dependency means that the package you are trying to install is looking for “dependencies” that it cannot find in the current version. The simple way to fix this error is to update the package database, clean out the package cache, and download-and-reinstall the newer version.


sudo apt-get autoclean
sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get -f install

If the output is: 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. That means the solution failed and you will have to run the following commands to fix the error.

Method 1


sudo apt-get update
sudo apt-get -u dist-upgrade
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
sudo apt-get remove --dry-run package-name

Method 2


sudo apt-get update
sudo apt-get -u dist-upgrade
sudo apt-get clean package-name
sudo apt-get install --reinstall package-name

其他方案

发现一个好用scp,可视功能。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值