[英]Linux directories
I am writing installation script for my program, which is supposed to run on Linux/Unix OS. 我正在为我的程序编写安装脚本,它应该在Linux / Unix OS上运行。 What is the default directory for the following files:
以下文件的默认目录是什么:
The listing varies depending on the Linux filesystem. 列表因Linux文件系统而异。
1) /bin
, /usr/bin
, /usr/local/bin
1)
/bin
, /usr/bin
, /usr/local/bin
2/3) /lib
, /usr/lib
, /usr/local/lib
2/3)
/lib
, /usr/lib
, /usr/local/lib
3.
/usr/share/lib
3.
/usr/share/lib
4) /etc
is a read-only spot for configuration data. 4)
/etc
是配置数据的只读点。
5) /usr/local/etc
or usually in the /home
directory under the dot directory name, if the profile allows the bin directory to be located under the /home/user_id/bin
where 'user_id' is the relevant login id.. for an example for user 'jdoe', his configuration could be written to /home/jdoe/.configs
or ~/.configs
5)
/usr/local/etc
或通常位于点目录名下的/home
目录中,如果配置文件允许bin目录位于/home/user_id/bin
下,其中'user_id'是相关的登录ID。对于用户'jdoe'的示例,他的配置可以写入/home/jdoe/.configs
或~/.configs
Do not rely on this, for the most part the LSB filesystem dictates that there shall be at minimum: /bin
, /etc
, /usr
, /lib
, /home
不要依赖于此,在大多数情况下LSB文件系统规定至少应该:
/bin
, /etc
, /usr
, /lib
, /home
For instance, the /usr
could be on a different partition, likewise the same for /home
例如,
/usr
可以位于不同的分区上,对于/home
也是如此
Edit: Thanks to dtrosset for pointing out my blooper.... 编辑:感谢dtrosset指出我的blooper ....
$PREFIX/bin
$PREFIX/lib
$PREFIX/lib
/etc
$HOME/.config
Where $HOME
is the home directory of the user running the application, determined at runtime. 其中
$HOME
是运行应用程序的用户的主目录,在运行时确定。 $PREFIX
depends on the method of distribution: $PREFIX
取决于分发方法:
$PREFIX
should be configurable but default to /usr/local
; $PREFIX
应该是可配置的,但默认为/usr/local
; $PREFIX
should usually be /usr/local
(but /opt
is also common); $PREFIX
通常应该是/usr/local
(但/opt
也很常见); $PREFIX
should be /usr
. $PREFIX
应为/usr
。 Documentation and other architecture-independent files should go in $PREFIX/share/doc
; 文档和其他与架构无关的文件应该在
$PREFIX/share/doc
; program-generated files shared between instances should go in /var/run
(things like lockfiles, pidfiles and sockets) or /var/lib
(things like shared binary databases). 实例之间共享的程序生成文件应该放在
/var/run
(锁文件,pidfiles和套接字之类的东西)或/var/lib
(比如共享二进制数据库之类的东西)中。
查看文件系统层次结构标准 。
Executable (Binary): 可执行(二进制):
Shared: 共享:
Other: 其他:
I'm not sure it would be wise to be writing an install script if you don't know the file structure of a *nix OS. 如果您不知道* nix OS的文件结构,我不确定编写安装脚本是否明智。 Besides which, each distribution of *nix is sligthly different when it comes to where the data is stored.
除此之外,* nix的每个分布在数据存储位置方面都略有不同。
I suggest you read this: http://www.comptechdoc.org/os/linux/commands/linux_crfilest.html 我建议你这样读: http : //www.comptechdoc.org/os/linux/commands/linux_crfilest.html
^.^ ^。^
The easiest way is to make an .rpm
of your application and then use for example alien
to make an .deb
out of it. 最简单的方法是制作你的应用程序的
.rpm
,然后使用例如alien
来制作一个.deb
。 Last I made a deb, it was really, really simple. 最后我做了一个deb,它真的很简单。 The packaging also enables you to have a sorts-of auto-update if you want to enable it and you will not need to think a lot about uninstallation procedures.
如果要启用它,打包还可以让您进行各种自动更新,而您无需考虑卸载过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.