在阿里云的Ubuntu ECS instance 使用Apt-get安装git

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在阿里云的Ubuntu ECS instance 使用Apt-get安装git相关的知识,希望对你有一定的参考价值。

高级包装工具(英语:Advanced Packaging Tools,简称:APT)是Debian及其衍生发行版(如:ubuntu)的软件包管理器。APT可以自动下载,配置,安装二进制或者源代码格式的软 件包,因此简化了 Unix系统上管理软件的过程,apt-get命令一般需要root权限执行,所以一般跟着sudo命令。

在阿里的云服务器上想要安装git,先运行apt-get update去更新镜像,然后使用apt-get install git去安装git.

 

[email protected]:/usr/local# apt-get update
Ign http://mirrors.cloud.aliyuncs.com precise InRelease
Get:1 http://mirrors.cloud.aliyuncs.com precise-security InRelease [55.7 kB]
Get:2 http://mirrors.cloud.aliyuncs.com precise-updates InRelease [55.7 kB]
Get:3 http://mirrors.cloud.aliyuncs.com precise-proposed InRelease [55.7 kB]
Get:4 http://mirrors.cloud.aliyuncs.com precise-backports InRelease [55.7 kB]

[email protected]:/usr/local# apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-
gui gitk gitweb
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 235 not upgraded.
Need to get 6,759 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu/ precise-security/main git-man all 1:1.7.9.5-
1ubuntu0.3 [632 kB]
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu/ precise-security/main git amd64 1:1.7.9.5-
1ubuntu0.3 [6,103 kB]
Fetched 6,759 kB in 1s (4,334 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 54216 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.9.5-1ubuntu0.3_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.9.5-1ubuntu0.3_amd64.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.9.5-1ubuntu0.3)

 

[email protected]:/usr/local/GitRepo/HelloWorld# touch test.txt
[email protected]:/usr/local/GitRepo/HelloWorld# git add test.txt
[email protected]:/usr/local/GitRepo/HelloWorld# git commit -m ‘deliver new test file‘
[master 01bbaa1] deliver new test file
0 files changed
create mode 100644 test.txt
[email protected]:/usr/local/GitRepo/HelloWorld# git push origin
Username for ‘https://github.com‘: guoguangzhi
Password for ‘https://[email protected]‘:
To https://github.com/guoguangzhi/HelloWorld.git
b50d8e8..01bbaa1 master -> master

 














































以上是关于在阿里云的Ubuntu ECS instance 使用Apt-get安装git的主要内容,如果未能解决你的问题,请参考以下文章

阿里云的服务器ecs怎么配置

阿里云的服务器ecs怎么配置

阿里云的云服务器ECS是什么?

基于阿里云的ECS(云服务器)

阿里云的ECS座云服务器怎么设置301重定向?

如何用阿里云的ECS建造属于你自己的网站详细介绍