开发版本发布为稳定版后,如何减少 apt-get 更新列表的大小?

Adi*_*tya 5 update-manager apt

我从三月初开始使用13.04的开发版。在开发版本中,运行该sudo apt-get update命令的一般行为是在列表文件发生更改时完全下载它们。然而,如果使用 Ubuntu 的稳定版本,则该命令仅下载列表文件的差异(如果它们已更改)(rsync 样式)。

基本上,在开发版本中sudo apt-get update下载大约 17-18 MB 的数据;而在稳定版本中,只能下载大约 1 MB 的数据(初始运行除外)。

现在,由于 13.04 已作为稳定版发布,我想更改 的行为sudo apt-get update以模仿其在稳定版中的正常行为。我该如何做到这一点?


之前在 Ask Ubuntu 上提出了一个类似的问题,但针对稳定版本:

但是,这是 12.04 中的一个错误,后来得到了修复。但是在我的情况下给出的答案是不可行的。对于 Ubuntu+1,它不是错误,而是开发版本的一般行为。无论如何,我会通过那里提供的答案:

  • touch在我每次运行命令 ( sudo apt-get update)之前,John S Gruber 的回答会询问相关文件。在我的情况下这绝对不可行。这个问题的答案是可以的,因为它是 12.04 中的一个错误,并且在这种情况下提供了临时修复。

  • Chan-Ho Suh 的回答要求更改更新镜像。这不会解决开发版本中的问题。

  • 安华的回答也是对这种情况的临时解决方案。它假设我sudo apt-get update只会在添加 PPA 后运行命令,因此要求禁用其他存储库。这在我的情况下是不可行的,因为我显然想更新所有存储库。我不一定只在添加 PPA 后才运行此命令。我每天运行这个命令来安装 Canonical 发布的任何更新。我sudo apt-get update用作软件中心的替代品。


所以在这里。如何恢复sudo apt-get update命令的正常行为以仅下载已更改文件的差异?希望相同的解决方案也适用于软件中心,因为如果我使用它进行更新,软件中心也会消耗类似的带宽。

我绝对不想仅仅为了恢复这种行为而重新安装 13.04。


sudo apt-get update万一重要的输出:

$ sudo apt-get update
Hit http://dl.google.com stable Release.gpg                                    
Hit http://dl.google.com stable Release                                        
Hit http://ppa.launchpad.net raring Release.gpg                                
Hit http://dl.google.com stable/main i386 Packages                             
Hit http://linux.dropbox.com precise Release.gpg                               
Hit http://ppa.launchpad.net raring Release.gpg                      
Get:1 http://mirror.picosecond.org raring Release.gpg [933 B]        
Hit http://ppa.launchpad.net raring Release                                    
Hit http://linux.dropbox.com precise Release                                   
Get:2 http://mirror.picosecond.org raring-updates Release.gpg [933 B]          
Hit http://ppa.launchpad.net raring Release                                    
Hit http://linux.dropbox.com precise/main i386 Packages                        
Hit http://ppa.launchpad.net raring/main i386 Packages                         
Get:3 http://mirror.picosecond.org raring-backports Release.gpg [933 B]
Ign http://dl.google.com stable/main Translation-en_IN                         
Ign http://dl.google.com stable/main Translation-en                            
Hit http://mirror.picosecond.org raring-security Release.gpg          
Get:4 http://mirror.picosecond.org raring Release [40.8 kB]           
Hit http://ppa.launchpad.net raring/main i386 Packages                       
Get:5 http://mirror.picosecond.org raring-updates Release [40.8 kB]            
Get:6 http://mirror.picosecond.org raring-backports Release [40.8 kB]          
Ign http://linux.dropbox.com precise/main Translation-en_IN                    
Ign http://linux.dropbox.com precise/main Translation-en                       
Hit http://mirror.picosecond.org raring-security Release                       
Get:7 http://mirror.picosecond.org raring/main Sources [963 kB]                
Ign http://ppa.launchpad.net raring/main Translation-en_IN                     
Ign http://ppa.launchpad.net raring/main Translation-en                        
Ign http://ppa.launchpad.net raring/main Translation-en_IN                     
Ign http://ppa.launchpad.net raring/main Translation-en                        
Get:8 http://mirror.picosecond.org raring/restricted Sources [5,987 B]         
Get:9 http://mirror.picosecond.org raring/universe Sources [5,838 kB]          
Get:10 http://mirror.picosecond.org raring/multiverse Sources [171 kB]         
Get:11 http://mirror.picosecond.org raring/main i386 Packages [1,168 kB]       
Get:12 http://mirror.picosecond.org raring/restricted i386 Packages [9,623 B]  
Get:13 http://mirror.picosecond.org raring/universe i386 Packages [5,405 kB]   
Get:14 http://mirror.picosecond.org raring/multiverse i386 Packages [131 kB]   
Hit http://mirror.picosecond.org raring/main Translation-en                    
Hit http://mirror.picosecond.org raring/multiverse Translation-en              
Hit http://mirror.picosecond.org raring/restricted Translation-en              
Get:15 http://mirror.picosecond.org raring/universe Translation-en [3,736 kB]  
Get:16 http://mirror.picosecond.org raring-updates/main Sources [1,616 B]      
Get:17 http://mirror.picosecond.org raring-updates/restricted Sources [14 B]   
Get:18 http://mirror.picosecond.org raring-updates/universe Sources [14 B]     
Get:19 http://mirror.picosecond.org raring-updates/multiverse Sources [14 B]   
Get:20 http://mirror.picosecond.org raring-updates/main i386 Packages [3,331 B]
Get:21 http://mirror.picosecond.org raring-updates/restricted i386 Packages [14 B]
Get:22 http://mirror.picosecond.org raring-updates/universe i386 Packages [1,078 B]
Get:23 http://mirror.picosecond.org raring-updates/multiverse i386 Packages [14 B]
Hit http://mirror.picosecond.org raring-updates/main Translation-en            
Hit http://mirror.picosecond.org raring-updates/multiverse Translation-en      
Hit http://mirror.picosecond.org raring-updates/restricted Translation-en      
Hit http://mirror.picosecond.org raring-updates/universe Translation-en        
Get:24 http://mirror.picosecond.org raring-backports/main Sources [14 B]       
Get:25 http://mirror.picosecond.org raring-backports/restricted Sources [14 B] 
Get:26 http://mirror.picosecond.org raring-backports/universe Sources [738 B]  
Get:27 http://mirror.picosecond.org raring-backports/multiverse Sources [14 B] 
Get:28 http://mirror.picosecond.org raring-backports/main i386 Packages [14 B] 
Get:29 http://mirror.picosecond.org raring-backports/restricted i386 Packages [14 B]
Get:30 http://mirror.picosecond.org raring-backports/universe i386 Packages [508 B]
Get:31 http://mirror.picosecond.org raring-backports/multiverse i386 Packages [14 B]
Hit http://mirror.picosecond.org raring-backports/main Translation-en          
Hit http://mirror.picosecond.org raring-backports/multiverse Translation-en    
Hit http://mirror.picosecond.org raring-backports/restricted Translation-en    
Hit http://mirror.picosecond.org raring-backports/universe Translation-en      
Hit http://mirror.picosecond.org raring-security/main Sources                  
Hit http://mirror.picosecond.org raring-security/restricted Sources            
Hit http://mirror.picosecond.org raring-security/universe Sources              
Hit http://mirror.picosecond.org raring-security/multiverse Sources            
Hit http://mirror.picosecond.org raring-security/main i386 Packages            
Hit http://mirror.picosecond.org raring-security/restricted i386 Packages      
Hit http://mirror.picosecond.org raring-security/universe i386 Packages        
Hit http://mirror.picosecond.org raring-security/multiverse i386 Packages      
Hit http://mirror.picosecond.org raring-security/main Translation-en           
Hit http://mirror.picosecond.org raring-security/multiverse Translation-en     
Hit http://mirror.picosecond.org raring-security/restricted Translation-en
Hit http://mirror.picosecond.org raring-security/universe Translation-en
Ign http://mirror.picosecond.org raring/main Translation-en_IN
Ign http://mirror.picosecond.org raring/multiverse Translation-en_IN
Ign http://mirror.picosecond.org raring/restricted Translation-en_IN
Ign http://mirror.picosecond.org raring/universe Translation-en_IN
Ign http://mirror.picosecond.org raring-updates/main Translation-en_IN
Ign http://mirror.picosecond.org raring-updates/multiverse Translation-en_IN
Ign http://mirror.picosecond.org raring-updates/restricted Translation-en_IN
Ign http://mirror.picosecond.org raring-updates/universe Translation-en_IN
Ign http://mirror.picosecond.org raring-backports/main Translation-en_IN
Ign http://mirror.picosecond.org raring-backports/multiverse Translation-en_IN
Ign http://mirror.picosecond.org raring-backports/restricted Translation-en_IN
Ign http://mirror.picosecond.org raring-backports/universe Translation-en_IN
Ign http://mirror.picosecond.org raring-security/main Translation-en_IN
Ign http://mirror.picosecond.org raring-security/multiverse Translation-en_IN
Ign http://mirror.picosecond.org raring-security/restricted Translation-en_IN
Ign http://mirror.picosecond.org raring-security/universe Translation-en_IN
Fetched 17.6 MB in 3min 46s (77.7 kB/s)
Reading package lists... Done
Run Code Online (Sandbox Code Playgroud)

内容/etc/apt/sources.list的情况下,它的事项:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.
deb http://mirror.picosecond.org/ubuntu/ raring main restricted
deb-src http://mirror.picosecond.org/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirror.picosecond.org/ubuntu/ raring-updates main restricted
deb-src http://mirror.picosecond.org/ubuntu/ raring-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirror.picosecond.org/ubuntu/ raring universe
deb-src http://mirror.picosecond.org/ubuntu/ raring universe
deb http://mirror.picosecond.org/ubuntu/ raring-updates universe
deb-src http://mirror.picosecond.org/ubuntu/ raring-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirror.picosecond.org/ubuntu/ raring multiverse
deb-src http://mirror.picosecond.org/ubuntu/ raring multiverse
deb http://mirror.picosecond.org/ubuntu/ raring-updates multiverse
deb-src http://mirror.picosecond.org/ubuntu/ raring-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirror.picosecond.org/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://mirror.picosecond.org/ubuntu/ raring-backports main restricted universe multiverse

deb http://mirror.picosecond.org/ubuntu/ raring-security main restricted
deb-src http://mirror.picosecond.org/ubuntu/ raring-security main restricted
deb http://mirror.picosecond.org/ubuntu/ raring-security universe
deb-src http://mirror.picosecond.org/ubuntu/ raring-security universe
deb http://mirror.picosecond.org/ubuntu/ raring-security multiverse
deb-src http://mirror.picosecond.org/ubuntu/ raring-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu raring partner
# deb-src http://archive.canonical.com/ubuntu raring partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu raring main
# deb-src http://extras.ubuntu.com/ubuntu raring main
Run Code Online (Sandbox Code Playgroud)

Rob*_*sak 3

apt 在开发版本和稳定版本之间实际上并没有做任何不同的事情。

然而,版本本身停止变化,因此 apt 必须下载的包列表的大小变得更小。

我们以拉林为例。

在开发过程中,raring-updatesraring-security口袋仍然是空的,但raring口袋会定期(每半小时)更新一次。

释放后,raring口袋停止变化。现在,更新会随着新软件包进入口袋raring-updates而上传raring-security

从 apt 的角度来看,在开发期间raring每次apt-get update运行时都会完整下载软件包列表(除非在上游更新之间的半小时窗口内调用了两次或更多次)。这是一个很大的列表,所以花了一些时间。

现在 Raring 已发布,raring软件包列表不再变化。和软件包列表确实发生了变化,但这些要小得多,因为它们只包含自 Raring 发布以来在 Raring 中“更改”的软件包raring-updatesraring-security

我可以在你的问题中的 apt 输出中看到这种行为。看起来正如预期的那样:raring口袋版刚刚获得点击,无需下载;Get实际下载相对raring-updates应。编辑:再看一下,似乎有些文件被不必要地重新下载;请参阅我的另一个答案。raring-security

如果这对您来说太慢,请考虑使用更快的镜像,或者删除那里相当大的 PPA 列表。如果您不需要 可用的源,您也可以删除deb-src来​​自 的行。sources.listapt-get

我认为如果您直接安装此版本,您不会看到任何不同的行为。