我是Ubuntu和Git的新手.我如何验证我在我的机器上安装了git?当我尝试apt-get时,我得到了:
root@ubuntu:/home/nebojsa# apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
linux-headers-3.13.0-40 linux-headers-3.13.0-40-generic
linux-headers-3.13.0-43 linux-headers-3.13.0-43-generic
linux-image-3.13.0-24-generic linux-image-3.13.0-39-generic
linux-image-3.13.0-40-generic linux-image-3.13.0-43-generic
linux-image-extra-3.13.0-24-generic linux-image-extra-3.13.0-39-generic
linux-image-extra-3.13.0-40-generic linux-image-extra-3.13.0-43-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 133 not upgraded.
Run Code Online (Sandbox Code Playgroud)
但我不知道安装的软件包在哪里.
谢谢你的帮助!
Kev*_*ert 47
类型which git
.它应该返回可执行文件的路径
如果您想了解更多详细信息:https://serverfault.com/questions/96964/list-of-files-installed-from-apt-package
小智 13
只需拨打电话git --version
.它应该返回这样的东西:
$ git --version
git version 1.9.3 (Apple Git-50)
Run Code Online (Sandbox Code Playgroud)
像大多数可执行文件一样,git
安装在/usr/bin/git
.
要查看包中所有文件的git
位置,可以键入:
dpkg -L git
Run Code Online (Sandbox Code Playgroud)
你想要输出输出less
或你最喜欢的页面; 我的系统上有591 664行输出.
(并非所有的系统使用Ubuntu的做同样的包管理器,您可能需要使用比其他一些命令dpkg
,也许rpm
,yum
或dnf
).
如果您从源代码而不是通过软件包管理器安装了git,git
则可执行文件可以在任何位置,具体取决于您的安装方式.如果它在你的$PATH
,打字
type git
Run Code Online (Sandbox Code Playgroud)
要么
type -a git
Run Code Online (Sandbox Code Playgroud)
会告诉你它在哪里.(假设你正在使用默认的bash shell.)
归档时间: |
|
查看次数: |
50887 次 |
最近记录: |