最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】给Ubuntu更换成163的源(sources.list)

Ubuntu crifan 9620浏览 0评论

【背景】

折腾:

【已解决】Ubuntu中用sudo apt-get install安装某软件,结果出错:E: Unable to locate package

期间,虽然已经解决问题。

但是还是嫌弃本地连到us的ubuntu的源的速度太慢。

所以还是打算去更换为,国内访问的速度比较快的163的源。

【折腾过程】

1.参考:

Ubuntu 12.04更新源

Ubuntu镜像使用帮助

【已解决(fixed)】W: Duplicate sources.list entry when do “sudo apt-get update”

ubuntu apt源的添加和使用【整理】

去:

crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0$ sudo cp -p /etc/apt/sources.list /etc/apt
apt/       aptdaemon/ 
crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0$ sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0$ sudo gedit /etc/apt/sources.list

然后把下面内容添加到文件:

/etc/apt/sources.list

的最顶端:

#add by Crifan Li 2013-08-08, added 163 source
deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

保存退出后。

2.再去更新一下:

crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0$ sudo apt-get update
Get:1 http://security.ubuntu.com raring-security Release.gpg [933 B]           
Hit http://extras.ubuntu.com raring Release.gpg                                
Get:2 http://security.ubuntu.com raring-security Release [40.8 kB]   
Hit http://extras.ubuntu.com raring Release                                    
Hit http://extras.ubuntu.com raring/main Sources                               
Hit http://us.archive.ubuntu.com raring Release.gpg                            
Hit http://extras.ubuntu.com raring/main i386 Packages                         
Get:3 http://security.ubuntu.com raring-security/main Sources [36.2 kB]        
Get:4 http://us.archive.ubuntu.com raring-updates Release.gpg [933 B]          
Get:5 http://us.archive.ubuntu.com raring-backports Release.gpg [933 B]        
Get:6 http://security.ubuntu.com raring-security/restricted Sources [14 B]     
Hit http://us.archive.ubuntu.com raring Release                                
Get:7 http://security.ubuntu.com raring-security/universe Sources [8,839 B]    
Get:8 http://security.ubuntu.com raring-security/multiverse Sources [1,825 B]  
Get:9 http://us.archive.ubuntu.com raring-updates Release [40.8 kB]            
Get:10 http://security.ubuntu.com raring-security/main i386 Packages [94.3 kB] 
Get:11 http://security.ubuntu.com raring-security/restricted i386 Packages [14 B]
Get:12 http://security.ubuntu.com raring-security/universe i386 Packages [32.9 kB]
Ign http://extras.ubuntu.com raring/main Translation-en_US                     
Get:13 http://security.ubuntu.com raring-security/multiverse i386 Packages [3,612 B]
Ign http://extras.ubuntu.com raring/main Translation-en                        
Hit http://security.ubuntu.com raring-security/main Translation-en             
Get:14 http://us.archive.ubuntu.com raring-backports Release [40.8 kB]         
Hit http://security.ubuntu.com raring-security/multiverse Translation-en       
Hit http://security.ubuntu.com raring-security/restricted Translation-en       
Hit http://security.ubuntu.com raring-security/universe Translation-en         
Hit http://us.archive.ubuntu.com raring/main Sources                           
Hit http://us.archive.ubuntu.com raring/restricted Sources            
Get:15 http://mirrors.163.com precise Release.gpg [198 B]             
Hit http://us.archive.ubuntu.com raring/universe Sources              
Hit http://us.archive.ubuntu.com raring/multiverse Sources            
Hit http://us.archive.ubuntu.com raring/main i386 Packages            
Get:16 http://mirrors.163.com precise-security Release.gpg [198 B]    
Hit http://us.archive.ubuntu.com raring/restricted i386 Packages      
Ign http://security.ubuntu.com raring-security/main Translation-en_US 
Get:17 http://mirrors.163.com precise-updates Release.gpg [198 B]     
Hit http://us.archive.ubuntu.com raring/universe i386 Packages        
Get:18 http://mirrors.163.com precise-proposed Release.gpg [198 B]    
Ign http://security.ubuntu.com raring-security/multiverse Translation-en_US    
Get:19 http://mirrors.163.com precise-backports Release.gpg [198 B]   
Hit http://us.archive.ubuntu.com raring/multiverse i386 Packages               
Ign http://security.ubuntu.com raring-security/restricted Translation-en_US    
Get:20 http://mirrors.163.com precise Release [49.6 kB]               
Ign http://security.ubuntu.com raring-security/universe Translation-en_US      
Hit http://us.archive.ubuntu.com raring/main Translation-en                    
Get:21 http://mirrors.163.com precise-security Release [49.6 kB]               
Hit http://us.archive.ubuntu.com raring/multiverse Translation-en              
Get:22 http://mirrors.163.com precise-updates Release [49.6 kB]                
Hit http://us.archive.ubuntu.com raring/restricted Translation-en              
Hit http://us.archive.ubuntu.com raring/universe Translation-en                
Get:23 http://mirrors.163.com precise-proposed Release [49.6 kB]               
Get:24 http://mirrors.163.com precise-backports Release [49.6 kB]              
Get:25 http://mirrors.163.com precise/main Sources [934 kB]                    
Get:26 http://us.archive.ubuntu.com raring-updates/main Sources [57.5 kB]      
Get:27 http://mirrors.163.com precise/restricted Sources [5,470 B]             
Get:28 http://mirrors.163.com precise/universe Sources [5,019 kB]              
Get:29 http://us.archive.ubuntu.com raring-updates/restricted Sources [14 B]   
Get:30 http://us.archive.ubuntu.com raring-updates/universe Sources [68.5 kB]  
Get:31 http://us.archive.ubuntu.com raring-updates/multiverse Sources [1,825 B]
Get:32 http://us.archive.ubuntu.com raring-updates/main i386 Packages [148 kB] 
Get:33 http://us.archive.ubuntu.com raring-updates/restricted i386 Packages [14 B]
Get:34 http://us.archive.ubuntu.com raring-updates/universe i386 Packages [133 kB]
Get:35 http://us.archive.ubuntu.com raring-updates/multiverse i386 Packages [3,612 B]
Hit http://us.archive.ubuntu.com raring-updates/main Translation-en            
Hit http://us.archive.ubuntu.com raring-updates/multiverse Translation-en      
Hit http://us.archive.ubuntu.com raring-updates/restricted Translation-en      
Hit http://us.archive.ubuntu.com raring-updates/universe Translation-en        
Get:36 http://us.archive.ubuntu.com raring-backports/main Sources [14 B]       
Get:37 http://us.archive.ubuntu.com raring-backports/restricted Sources [14 B] 
Get:38 http://us.archive.ubuntu.com raring-backports/universe Sources [5,134 B]
Get:39 http://us.archive.ubuntu.com raring-backports/multiverse Sources [1,403 B]
Get:40 http://us.archive.ubuntu.com raring-backports/main i386 Packages [14 B] 
Get:41 http://us.archive.ubuntu.com raring-backports/restricted i386 Packages [14 B]
Get:42 http://mirrors.163.com precise/multiverse Sources [155 kB]      
Get:43 http://us.archive.ubuntu.com raring-backports/universe i386 Packages [6,239 B]
Get:44 http://us.archive.ubuntu.com raring-backports/multiverse i386 Packages [1,345 B]
Hit http://us.archive.ubuntu.com raring-backports/main Translation-en          
Hit http://us.archive.ubuntu.com raring-backports/multiverse Translation-en    
Hit http://us.archive.ubuntu.com raring-backports/restricted Translation-en    
Hit http://us.archive.ubuntu.com raring-backports/universe Translation-en      
Get:45 http://mirrors.163.com precise/main i386 Packages [1,274 kB]            
Get:46 http://mirrors.163.com precise/restricted i386 Packages [8,431 B]       
Get:47 http://mirrors.163.com precise/universe i386 Packages [4,796 kB]        
Ign http://us.archive.ubuntu.com raring/main Translation-en_US                 
Ign http://us.archive.ubuntu.com raring/multiverse Translation-en_US           
Ign http://us.archive.ubuntu.com raring/restricted Translation-en_US           
Ign http://us.archive.ubuntu.com raring/universe Translation-en_US             
Ign http://us.archive.ubuntu.com raring-updates/main Translation-en_US         
Ign http://us.archive.ubuntu.com raring-updates/multiverse Translation-en_US   
Ign http://us.archive.ubuntu.com raring-updates/restricted Translation-en_US   
Ign http://us.archive.ubuntu.com raring-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com raring-backports/main Translation-en_US
Ign http://us.archive.ubuntu.com raring-backports/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com raring-backports/restricted Translation-en_US
Ign http://us.archive.ubuntu.com raring-backports/universe Translation-en_US
Get:48 http://mirrors.163.com precise/multiverse i386 Packages [121 kB]        
Get:49 http://mirrors.163.com precise/main Translation-en [726 kB]             
Get:50 http://mirrors.163.com precise/multiverse Translation-en [93.4 kB]      
Get:51 http://mirrors.163.com precise/restricted Translation-en [2,395 B]      
Get:52 http://mirrors.163.com precise/universe Translation-en [3,341 kB]       
Get:53 http://mirrors.163.com precise-security/main Sources [84.9 kB]          
Get:54 http://mirrors.163.com precise-security/restricted Sources [2,494 B]    
Get:55 http://mirrors.163.com precise-security/universe Sources [28.0 kB]      
Get:56 http://mirrors.163.com precise-security/multiverse Sources [1,383 B]    
Get:57 http://mirrors.163.com precise-security/main i386 Packages [320 kB]     
Get:58 http://mirrors.163.com precise-security/restricted i386 Packages [4,620 B]
Get:59 http://mirrors.163.com precise-security/universe i386 Packages [83.7 kB]
Get:60 http://mirrors.163.com precise-security/multiverse i386 Packages [2,371 B]
Get:61 http://mirrors.163.com precise-security/main Translation-en [148 kB]    
Get:62 http://mirrors.163.com precise-security/multiverse Translation-en [995 B]
Get:63 http://mirrors.163.com precise-security/restricted Translation-en [1,253 B]
Get:64 http://mirrors.163.com precise-security/universe Translation-en [51.8 kB]
Get:65 http://mirrors.163.com precise-updates/main Sources [412 kB]            
Get:66 http://mirrors.163.com precise-updates/restricted Sources [5,467 B]     
Get:67 http://mirrors.163.com precise-updates/universe Sources [93.4 kB]       
Get:68 http://mirrors.163.com precise-updates/multiverse Sources [6,582 B]     
Get:69 http://mirrors.163.com precise-updates/main i386 Packages [692 kB]      
Get:70 http://mirrors.163.com precise-updates/restricted i386 Packages [10.0 kB]
Get:71 http://mirrors.163.com precise-updates/universe i386 Packages [215 kB]  
Get:72 http://mirrors.163.com precise-updates/multiverse i386 Packages [13.8 kB]
Get:73 http://mirrors.163.com precise-updates/main Translation-en [304 kB]     
Get:74 http://mirrors.163.com precise-updates/multiverse Translation-en [7,834 B]
Get:75 http://mirrors.163.com precise-updates/restricted Translation-en [2,432 B]
Get:76 http://mirrors.163.com precise-updates/universe Translation-en [124 kB] 
Get:77 http://mirrors.163.com precise-proposed/main Sources [20.8 kB]          
Get:78 http://mirrors.163.com precise-proposed/restricted Sources [14 B]       
Get:79 http://mirrors.163.com precise-proposed/universe Sources [9,376 B]      
Get:80 http://mirrors.163.com precise-proposed/multiverse Sources [1,891 B]    
Get:81 http://mirrors.163.com precise-proposed/main i386 Packages [92.0 kB]    
Get:82 http://mirrors.163.com precise-proposed/restricted i386 Packages [14 B] 
Get:83 http://mirrors.163.com precise-proposed/universe i386 Packages [19.0 kB]
Get:84 http://mirrors.163.com precise-proposed/multiverse i386 Packages [2,054 B]
Get:85 http://mirrors.163.com precise-proposed/main Translation-en [31.3 kB]   
Get:86 http://mirrors.163.com precise-proposed/multiverse Translation-en [1,160 B]
Get:87 http://mirrors.163.com precise-proposed/restricted Translation-en [14 B]
Get:88 http://mirrors.163.com precise-proposed/universe Translation-en [10.5 kB]
Get:89 http://mirrors.163.com precise-backports/main Sources [2,935 B]         
Get:90 http://mirrors.163.com precise-backports/restricted Sources [14 B]      
Get:91 http://mirrors.163.com precise-backports/universe Sources [35.2 kB]     
Get:92 http://mirrors.163.com precise-backports/multiverse Sources [5,311 B]   
Get:93 http://mirrors.163.com precise-backports/main i386 Packages [2,390 B]   
Get:94 http://mirrors.163.com precise-backports/restricted i386 Packages [14 B]
Get:95 http://mirrors.163.com precise-backports/universe i386 Packages [36.1 kB]
Get:96 http://mirrors.163.com precise-backports/multiverse i386 Packages [5,178 B]
Get:97 http://mirrors.163.com precise-backports/main Translation-en [1,512 B]  
Get:98 http://mirrors.163.com precise-backports/multiverse Translation-en [4,610 B]
Get:99 http://mirrors.163.com precise-backports/restricted Translation-en [14 B]
Get:100 http://mirrors.163.com precise-backports/universe Translation-en [26.5 kB]
Ign http://mirrors.163.com precise/main Translation-en_US                      
Ign http://mirrors.163.com precise/multiverse Translation-en_US
Ign http://mirrors.163.com precise/restricted Translation-en_US
Ign http://mirrors.163.com precise/universe Translation-en_US
Ign http://mirrors.163.com precise-security/main Translation-en_US
Ign http://mirrors.163.com precise-security/multiverse Translation-en_US
Ign http://mirrors.163.com precise-security/restricted Translation-en_US
Ign http://mirrors.163.com precise-security/universe Translation-en_US
Ign http://mirrors.163.com precise-updates/main Translation-en_US
Ign http://mirrors.163.com precise-updates/multiverse Translation-en_US
Ign http://mirrors.163.com precise-updates/restricted Translation-en_US
Ign http://mirrors.163.com precise-updates/universe Translation-en_US
Ign http://mirrors.163.com precise-proposed/main Translation-en_US
Ign http://mirrors.163.com precise-proposed/multiverse Translation-en_US
Ign http://mirrors.163.com precise-proposed/restricted Translation-en_US
Ign http://mirrors.163.com precise-proposed/universe Translation-en_US
Ign http://mirrors.163.com precise-backports/main Translation-en_US
Ign http://mirrors.163.com precise-backports/multiverse Translation-en_US
Ign http://mirrors.163.com precise-backports/restricted Translation-en_US
Ign http://mirrors.163.com precise-backports/universe Translation-en_US
Fetched 20.4 MB in 2min 23s (142 kB/s)
Reading package lists... Done
crifan@ubuntu:~/develop/crosstool-ng/crosstool-ng-1.18.0$ 

如此,应该是可以了。

3.但是打算再去用图形界面的方式,去操作看看:

进入Ubuntu Software Center

ubuntu software center

edit software sources

software and updates

download from other

need authenticate for crifan li

other china mirrors 163 choose server

already choose 163 close

也是可以的。

最好再去做一次:

sudo apt-get update

 

【总结】

想要换成163的源的话,可以使用图形界面的方式去:

Ubuntu Software Center->Ubuntu Software->Download from-> choose ‘Other…’ -> choose ‘China->mirrors.163.com->Choose server’->Close

转载请注明:在路上 » 【记录】给Ubuntu更换成163的源(sources.list)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.195 seconds, using 22.25MB memory