ubuntu unable to locate package git

今天安装完ubuntu之后,在安装git时,结果发现没有找到git这个包。根本原因在于软件库没有更新,只要更新一下软件库就行了。

  1. 直接安装时,会出现下面的提示
root@raul-desktop:/home/raul# apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package git

2. 更新软件库

root@raul-desktop:/home/raul# apt-get update
Ign http://cn.archive.ubuntu.com trusty InRelease
Get:1 http://cn.archive.ubuntu.com trusty-updates InRelease [65.9 kB]          
Get:2 http://cn.archive.ubuntu.com trusty-backports InRelease [65.9 kB]        
Get:3 http://cn.archive.ubuntu.com trusty Release.gpg [933 B]                  
Get:4 http://cn.archive.ubuntu.com trusty Release [58.5 kB]                    
Get:5 http://cn.archive.ubuntu.com trusty-updates/main Sources [277 kB]        
Ign http://extras.ubuntu.com trusty InRelease                                
Get:6 http://security.ubuntu.com trusty-security InRelease [65.9 kB]           
Get:7 http://cn.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B] 
Get:8 http://cn.archive.ubuntu.com trusty-updates/universe Sources [156 kB]    
Get:9 http://cn.archive.ubuntu.com trusty-updates/multiverse Sources [5,936 B] 
Get:10 http://cn.archive.ubuntu.com trusty-updates/main amd64 Packages [780 kB]
Get:11 http://extras.ubuntu.com trusty Release.gpg [72 B]                      
Get:12 http://extras.ubuntu.com trusty Release [11.9 kB]                       
Get:13 http://extras.ubuntu.com trusty/main Sources [14 B]                     
Get:14 http://security.ubuntu.com trusty-security/main Sources [116 kB]        
Get:15 http://cn.archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:16 http://cn.archive.ubuntu.com trusty-updates/universe amd64 Packages [362 kB]
Get:17 http://extras.ubuntu.com trusty/main amd64 Packages [14 B]              
Get:18 http://extras.ubuntu.com trusty/main i386 Packages [14 B]               
Get:19 http://cn.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Get:20 http://cn.archive.ubuntu.com trusty-updates/main i386 Packages [748 kB] 
Get:21 http://security.ubuntu.com trusty-security/restricted Sources [4,035 B] 
Get:22 http://security.ubuntu.com trusty-security/universe Sources [37.3 kB]   
Get:23 http://security.ubuntu.com trusty-security/multiverse Sources [2,757 B] 
Get:24 http://cn.archive.ubuntu.com trusty-updates/restricted i386 Packages [15.6 kB]
Get:25 http://cn.archive.ubuntu.com trusty-updates/universe i386 Packages [363 kB]
Get:26 http://security.ubuntu.com trusty-security/main amd64 Packages [493 kB] 
Get:27 http://cn.archive.ubuntu.com trusty-updates/multiverse i386 Packages [13.6 kB]
Get:28 http://cn.archive.ubuntu.com trusty-updates/main Translation-en [391 kB]
Get:29 http://cn.archive.ubuntu.com trusty-updates/multiverse Translation-en [7,227 B]
Get:30 http://cn.archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B]
Get:31 http://cn.archive.ubuntu.com trusty-updates/universe Translation-en [189 kB]
Get:32 http://cn.archive.ubuntu.com trusty-backports/main Sources [9,551 B]    
Get:33 http://cn.archive.ubuntu.com trusty-backports/restricted Sources [28 B] 
Get:34 http://cn.archive.ubuntu.com trusty-backports/universe Sources [35.2 kB]
Get:35 http://cn.archive.ubuntu.com trusty-backports/multiverse Sources [1,898 B]
Get:36 http://cn.archive.ubuntu.com trusty-backports/main amd64 Packages [13.3 kB]
Get:37 http://cn.archive.ubuntu.com trusty-backports/restricted amd64 Packages [28 B]
Get:38 http://cn.archive.ubuntu.com trusty-backports/universe amd64 Packages [43.2 kB]
Get:39 http://cn.archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1,571 B]
Get:40 http://cn.archive.ubuntu.com trusty-backports/main i386 Packages [13.3 kB]
Get:41 http://cn.archive.ubuntu.com trusty-backports/restricted i386 Packages [28 B]
Get:42 http://cn.archive.ubuntu.com trusty-backports/universe i386 Packages [43.2 kB]
Get:43 http://cn.archive.ubuntu.com trusty-backports/multiverse i386 Packages [1,552 B]
Get:44 http://cn.archive.ubuntu.com trusty-backports/main Translation-en [7,505 B]
Get:45 http://cn.archive.ubuntu.com trusty-backports/multiverse Translation-en [1,215 B]
Get:46 http://cn.archive.ubuntu.com trusty-backports/restricted Translation-en [28 B]
Get:47 http://cn.archive.ubuntu.com trusty-backports/universe Translation-en [36.8 kB]
Get:48 http://cn.archive.ubuntu.com trusty/main Sources [1,064 kB]             
Ign http://extras.ubuntu.com trusty/main Translation-en_US                     
Ign http://extras.ubuntu.com trusty/main Translation-en                        
Get:49 http://cn.archive.ubuntu.com trusty/restricted Sources [5,433 B]        
Get:50 http://security.ubuntu.com trusty-security/restricted amd64 Packages [13.0 kB]
Get:51 http://cn.archive.ubuntu.com trusty/universe Sources [6,399 kB]         
Get:52 http://security.ubuntu.com trusty-security/universe amd64 Packages [130 kB]
Get:53 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [4,989 B]
Get:54 http://security.ubuntu.com trusty-security/main i386 Packages [464 kB]  
Get:55 http://security.ubuntu.com trusty-security/restricted i386 Packages [12.7 kB]
Get:56 http://security.ubuntu.com trusty-security/universe i386 Packages [130 kB]
Get:57 http://security.ubuntu.com trusty-security/multiverse i386 Packages [5,170 B]
Get:58 http://security.ubuntu.com trusty-security/main Translation-en [271 kB] 
Get:59 http://cn.archive.ubuntu.com trusty/multiverse Sources [174 kB]         
Get:60 http://cn.archive.ubuntu.com trusty/main amd64 Packages [1,350 kB]      
Get:61 http://security.ubuntu.com trusty-security/multiverse Translation-en [2,570 B]
Get:62 http://security.ubuntu.com trusty-security/restricted Translation-en [3,206 B]
Get:63 http://security.ubuntu.com trusty-security/universe Translation-en [76.6 kB]
Get:64 http://cn.archive.ubuntu.com trusty/restricted amd64 Packages [13.0 kB] 
Get:65 http://cn.archive.ubuntu.com trusty/universe amd64 Packages [5,859 kB]  
Get:66 http://cn.archive.ubuntu.com trusty/multiverse amd64 Packages [132 kB]  
Get:67 http://cn.archive.ubuntu.com trusty/main i386 Packages [1,348 kB]       
Get:68 http://cn.archive.ubuntu.com trusty/restricted i386 Packages [13.4 kB]  
Get:69 http://cn.archive.ubuntu.com trusty/universe i386 Packages [5,866 kB]   
Get:70 http://cn.archive.ubuntu.com trusty/multiverse i386 Packages [134 kB]   
Get:71 http://cn.archive.ubuntu.com trusty/main Translation-en [762 kB]        
Get:72 http://cn.archive.ubuntu.com trusty/multiverse Translation-en [102 kB]  
Get:73 http://cn.archive.ubuntu.com trusty/restricted Translation-en [3,457 B] 
Get:74 http://cn.archive.ubuntu.com trusty/universe Translation-en [4,089 kB]  
Ign http://cn.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http://cn.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http://cn.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http://cn.archive.ubuntu.com trusty/universe Translation-en_US             
Fetched 32.9 MB in 32s (1,028 kB/s)                                            
Reading package lists... Done

3. 安装软件

root@raul-desktop:/home/raul# 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-email git-gui gitk
  gitweb git-arch git-bzr git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 357 not upgraded.
Need to get 3,306 kB of archives.
After this operation, 21.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1 [21.1 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.3 [699 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.3 [2,586 kB]
Fetched 3,306 kB in 6s (523 kB/s)                                              
Selecting previously unselected package liberror-perl.
(Reading database ... 164677 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ...
Unpacking liberror-perl (0.17-1.1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a1.9.1-1ubuntu0.3_all.deb ...
Unpacking git-man (1:1.9.1-1ubuntu0.3) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.3_amd64.deb ...
Unpacking git (1:1.9.1-1ubuntu0.3) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up liberror-perl (0.17-1.1) ...
Setting up git-man (1:1.9.1-1ubuntu0.3) ...
Setting up git (1:1.9.1-1ubuntu0.3) ...

No comments yet.

Leave a comment

Comment form

All fields marked (*) are required

返回顶部
跳到底部