红联Linux门户
Linux帮助

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

发布时间:2017-06-06 10:52:19来源:linux网站作者:言默
高级包装工具(英语:Advanced Packaging Tools,简称:APT)是Debian及其衍生发行版(如:ubuntu)的软件包管理器。APT可以自动下载,配置,安装二进制或者源代码格式的软 件包,因此简化了 Unix系统上管理软件的过程,apt-get命令一般需要root权限执行,所以一般跟着sudo命令。
 
在阿里的云服务器上想要安装git,先运行apt-get update去更新镜像,然后使用apt-get install git去安装git。
 
root@iZ2ze40ubs5g1jr3rgylpfZ:/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]
 
root@iZ2ze40ubs5g1jr3rgylpfZ:/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)
 
root@iZ2ze40ubs5g1jr3rgylpfZ:/usr/local/GitRepo/HelloWorld# touch test.txt
root@iZ2ze40ubs5g1jr3rgylpfZ:/usr/local/GitRepo/HelloWorld# git add test.txt
root@iZ2ze40ubs5g1jr3rgylpfZ:/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
root@iZ2ze40ubs5g1jr3rgylpfZ:/usr/local/GitRepo/HelloWorld# git push origin
Username for 'https://github.com': guoguangzhi
Password for 'https://guoguangzhi@github.com':
To https://github.com/guoguangzhi/HelloWorld.git
b50d8e8..01bbaa1 master -> master
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31289.html