当我尝试解压 libpng12-0_1.2.54-1ubuntu1.1_amd64.deb 时,我得到了这个信息:
$ sudo dpkg -i libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
(Reading database ... 183096 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.29-0ubuntu2) ...
Errors were encountered while processing:
libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
我尝试这样做是因为我试图运行 Runescape 并收到以下错误:
ryan@ryan-HP-Notebook:~$ runescape-launcher
/usr/share/games/runescape-launcher/runescape: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
我也尝试安装 libpng12-0_1.2.50,但无济于事。
答案1
这不是正确的做法,但你可以通过解压 .deb 包并将其内容复制到根文件系统来解决它。
wget http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb dpkg -x libpng12-0_1.2.54-1ubuntu1.1_amd64.deb libpng12
您将在 libpng12 文件夹中找到库。然后您只需将其复制到其目标位置即可。
但是如果你不想在系统中存在任何静态内容,你可以保留这个库,但在运行runescape-launcher
导出 LD_LIBRARY_PATH 之前,请像这样:
导出 LD_LIBRARY_PATH=libpng12/lib/x86_64-linux-gnu RuneScape 启动器
我不确定您需要设置的路径,但如果出现问题,libpng12/lib
也可以尝试一下。libpng12
您还可以使用 提供自定义库/etc/ld.so.conf.d/
。您可以在此处阅读相关内容:https://stackoverflow.com/questions/9151491/extending-default-lib-search-path-in-ubuntu