我尝试遵循有关安装libpng12.so
的各种说明,这最终导致我在下载deb文件后使用以下命令:
sudo gdebi libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
但不幸的是,deb的安装会导致以下错误:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done
PNG library - runtime
libpng is a library implementing an interface for reading and writing
PNG (Portable Network Graphics) format files.
.
This package contains the runtime library files needed to run software
using libpng.
Do you want to install the software package? [y/N]:y
/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
c = findall("[[(](\S+)/\S+[])]", msg)[0].lower()
(Reading database ... 373964 files and directories currently installed.)
Preparing to unpack libpng12-0_1.2.54-1ubuntu1.1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1.1) ...
dpkg: error processing archive libpng12-0_1.2.54-1ubuntu1.1_amd64.deb (--install):
unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Errors were encountered while processing:
libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
有人知道我为什么会犯这些错误吗?非常感谢。
发布于 2022-05-19 21:11:00
这个答案是针对Ubuntu22.04上的R用户,他们在Ubuntu22.04上的R会话中加载latticeExtra包时得到了我问题中描述的错误。我所做的三个步骤如下。(这是在大量搜索和许多死胡同之后!)
请注意,在下面的链接中,使用来自user1335274的说明获得了许多这个答案。我只是一步一步地把它们写出来。
第1步):
我去了ubuntuupdates.org,下载了libpng12-0_1.2.54-1 ubuntu1_amd64.deb
然后,我使用ar 12-0_1.2.54-1 ubuntu1_amd64.deb从deb中提取文件。
这导致我的目录中有两个文件,名为data.tar.xz和control.tar.xz。
第2步):
我没有使用control.tar.xz,因为它是不必要的。我从data.tar.xz获得这些文件
焦油data.tar.xz.
它下载了xz文件中存在的整个文件结构。然后,我将下面的两个文件复制到/usr/local/lib目录中。我不知道什么是最好的地方放置他们,但这似乎是合理的,因为它不是很多其他文件拥挤。
/lib/x86_64-linux-gnu/libpng12.so.0.54.0
/lib/x86_64-linux-gnu/libpng12.so.0
第3步):
因此,一旦我在usr/local/lib中获得了上面的文件,我就需要在点bashrc文件中修改我的LD_LIBRARY_PATH,以便在查找路径时包含usr/local/lib目录。
我这么做是因为
导出LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
在我的点bashrc文件里。
完成上述操作后,在运行Ubuntu22.04时,尝试从R安装latticeExtra包就不再有问题了。我希望这有助于未来的R用户使用Ubuntu22.04。
注意:这类问题的解决方案通常是在Ubuntu的新版本上重新安装相应的R包。不幸的是,latticeExtra的情况并非如此。
https://askubuntu.com/questions/1409363
复制相似问题