$ sudo apt-get install nodejs-dev
[...]
The following packages have unmet dependencies:
nodejs-dev : Depends: libssl1.0-dev (>= 1.0.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
然后检查我已经安装的包的版本libssl-dev
:
$ dpkg -L libssl-dev | grep libssl.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libssl.pc
$ grep Version /usr/lib/x86_64-linux-gnu/pkgconfig/libssl.pc
Version: 1.1.1
然后检查将从包中安装的版本libssl1.0-dev
:
$ apt-get download libssl1.0-dev
$ ar x libssl1.0-dev_1.0.2n-1ubuntu6.2_amd64.deb
$ tar xf data.tar.xz
$ grep Version usr/lib/x86_64-linux-gnu/pkgconfig/libssl.pc
Version: 1.0.2n
当我已经有1.1.1 版本并且依赖于低于该版本(即版本 >= 1.0.2)时,为什么会apt-get
拒绝安装?nodejs-dev
libssl
nodejs-dev
答案1
这个解决方法对我来说很有效。
sudo apt install libssl1.0-dev nodejs-dev
然后
sudo apt install libssl-dev