安装下载为.tar文件的程序

第一管

我是一个运行Mint 17.3的新Linux用户。我想安装以.tar文件下载的程序。我提取了.tar的内容。现在我看到了文件夹:

programname/lib
programname/bin
programname/include

这些文件夹中有文件,但看起来好像没有安装文件。我不确定从哪里可以安装此程序。任何帮助将是巨大的。

每一个

简短答案

您的下载文件似乎包含了一组预编译的文件。为了“安装”它们,您只需要将每个文件复制或移动到适当的位置。

在这种情况下,您可能只想将所有文件从的每个子目录复制smartcash-1.0.0到的相应子目录/usr/local,例如:

cp -i smartcash-1.0.0/bin/* /usr/local/bin
cp -i smartcash-1.0.0/include/* /usr/local/include
cp -i smartcash-1.0.0/lib/* /usr/local/lib

而已。完成后,您应该能够运行四个新命令:

smartcash-cli
smartcash-qt
smartcash-tx
smartcashd

长答案

这是我尝试找出您正在处理的内容的方法。首先,我下载了TAR归档文件:

wget 'https://smartcash.cc/wp-content/uploads/2017/11/smartcash-1.0.0-x86_64-linux-gnu.tar.gz'

然后我解压缩了存档:

tar xzf smartcash-1.0.0-x86_64-linux-gnu.tar.gz

然后,我查看了生成的目录:

tree smartcash-1.0.0

这是来自的输出tree

smartcash-1.0.0
|-- bin
|   |-- smartcash-cli
|   |-- smartcash-qt
|   |-- smartcash-tx
|   `-- smartcashd
|-- include
|   `-- bitcoinconsensus.h
`-- lib
    |-- libbitcoinconsensus.so -> libbitcoinconsensus.so.0.0.0
    |-- libbitcoinconsensus.so.0 -> libbitcoinconsensus.so.0.0.0
    `-- libbitcoinconsensus.so.0.0.0

看起来我们拥有的是一些预编译的可执行程序(在'bin /'子目录中),一些共享库(在lib/子目录中)以及头文件(在include子目录中)。

通常,您可能希望将可执行文件放入路径中的目录中。要查看PATH中的目录,可以运行以下命令:

(IFS=:; for path in ${PATH[@]}; do echo "${path}"; done)

输出结果如下所示:

/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

一个典型的放置这些位置的地方是/usr/local/bin您可以使用以下命令来实现:

cp -i smartcash-1.0.0/bin/* /usr/local/bin

共享库文件应放在共享库搜索路径中的目录中。要查看您的共享库搜索路径是什么,您应该检查/etc/ld.so.conf配置文件。这是我的东西:

include /etc/ld.so.conf.d/*.conf

因此,它包括/etc/ld.so.conf.d目录中的配置文件检查该目录(即cat /etc/ld.so.conf.d/*的内容将显示以下目录列表:

/usr/lib/x86_64-linux-gnu/libfakeroot
/usr/local/lib
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

所以我将文件放在/usr/local/lib目录中,例如:

cp -i smartcash-1.0.0/lib/* /usr/local/lib

有关在何处放置共享库的进一步讨论,您可能需要参考以下文章:

最后,/usr/local/include出于一致性考虑,您可能希望将头文件放入-例如:

cp -i smartcash-1.0.0/include/* /usr/local/include

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章