Linux/Unix 应用程序的源代码最适合保存在哪里?
作为一名开发人员,我经常下载并运行
./configure
./make
./make install
应用程序以将其安装到我的 Linux 系统上。 但我一直不太清楚保存下载目录的最佳位置。 我的本地桌面
是默认位置,但我想知道保存它的最佳“官方”位置是什么。 另外,它会因发行版而异吗?
我现在运行的是 Ubuntu。 我知道 apt-get install 可以为您执行此操作,但有时我感兴趣的应用程序根本不在这些列表中可用。
As a developer, I've often downloaded and run
./configure
./make
./make install
to install apps onto my Linux system. But I've never been quite clear on the best place to keep the downloaded directory. My local Desktop
is the default location, but I'd like to know what the best "official" place to keep it is. Also, does it vary by distro?
I'm running Ubuntu for now. I know apt-get install can do this for you, but sometimes the app I'm interested in simply isn't available on those lists.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看一下文件系统层次结构标准:它是
/usr /local/src
。 然而,这是一个有争议的问题,您可以在此处找到。Take a look at the FileSystem Hierarchy Standard: it's
/usr/local/src
. However, this is a contentious issue as you will find here.也许“/usr/local/src”? ;-)
Perhaps "/usr/local/src" ? ;-)
如果您使用包管理器,请允许它使用受管包的默认值。 如果您管理该框,请将非托管第三方工具放在
/usr/local
下,如 Steel Plume 建议(尽管有些人更喜欢/opt
)。 如果以非特权用户身份安装,请在$(HOME)/src
中解压并编译,然后安装到$(HOME)/bin
、$(HOME)/等等
,等等。If you use a package manager, allow it to use the default for managed packages. If you administer the box, put unmanaged third party tools under
/usr/local
as Steel Plume suggests (though there are some who prefer/opt
). If installing as a unprivileged user, unpack and compile in$(HOME)/src
, and install into$(HOME)/bin
,$(HOME)/etc
, and so on.个人使用:~/src
跨系统共享:/usr/local/src
for personal use: ~/src
for sharing across a system: /usr/local/src
@dirkgently 和 @dmckee 完全正确。 我想补充一点,因为这可能是一个有争议的问题,所以我会模仿发行提供商(在您的情况下)Ubuntu 对其主要软件包所做的事情。
@dirkgently and @dmckee are completely spot on. I would add that since it is can be a contentious issue, I would mimic what the distribution provider (in your case) Ubuntu does for its major packages.