如何在Linux上安装Git [英] How to install Git on Linux

查看:51
本文介绍了如何在Linux上安装Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用apt-get安装Git:

I'm trying to install Git with apt-get:

$ apt-get install git-core

我收到此错误:

E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

我很确定我的帐户是root,但是无论如何我都尝试这样做:

I'm pretty sure that my account is the root, but I tried doing this anyway:

$ su -

此后我得到答复:

su: must be run from a terminal

另外,运行sudo会告诉我该程序未安装.由于上述错误,我也无法安装它(必须从终端运行).

Also, running sudo tells me the program isn't installed. I also can't install it because of the above error (must be run from a terminal).

如何解决此问题?

推荐答案

尝试一下:

$ sudo apt-get install git-core

这篇关于如何在Linux上安装Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆