Ubuntu apt get更新源替換及加速方法

2021-07-05 21:23:40 字數 2496 閱讀 7174

使用ubuntu時,apt-get是很方便的乙個工具,但預設使用的歐洲源,國內速度太慢。可以把更新源換成速度更快的映象,並使用apt-fast去多執行緒更新。

1、備份更新原始檔

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、開啟更新原始檔編輯

$ sudo gedit /etc/apt/sources.list

3、根據ubuntu版本,把全部內容替換為如下內容

版本11.04

deb natty main restricted universe multiverse

deb natty-backports main restricted universe multiverse

deb natty-proposed main restricted universe multiverse

deb natty-security main restricted universe multiverse

deb natty-updates main restricted universe multiverse

deb-src natty main restricted universe multiverse

deb-src natty-backports main restricted universe multiverse

deb-src natty-proposed main restricted universe multiverse

deb-src natty-security main restricted universe multiverse

deb-src natty-updates main restricted universe multiverse

版本11.10

deb oneiric main restricted universe multiverse

deb oneiric-backports main restricted universe multiverse

deb oneiric-proposed main restricted universe multiverse

deb oneiric-security main restricted universe multiverse

deb oneiric-updates main restricted universe multiverse

deb-src oneiric main restricted universe multiverse

deb-src oneiric-backports main restricted universe multiverse

deb-src oneiric-proposed main restricted universe multiverse

deb-src oneiric-security main restricted universe multiverse

deb-src oneiric-updates main restricted universe multiverse

版本12.04

deb precise main restricted universe multiverse

deb precise-backports main restricted universe multiverse

deb precise-proposed main restricted universe multiverse

deb precise-security main restricted universe multiverse

deb precise-updates main restricted universe multiverse

deb-src precise main restricted universe multiverse

deb-src precise-backports main restricted universe multiverse

deb-src precise-proposed main restricted universe multiverse

deb-src precise-security main restricted universe multiverse

deb-src precise-updates main restricted universe multiverse

4、更新系統

$ sudo apt-get update

$ sudo apt-get dist-upgrade

5、安裝apt-fast

$ sudo add-apt-repository ppa:tldm217/tahutek.net

$ sudo apt-get update   

$ sudo apt-get install apt-fast

#num_connections = 4

Linux Mint Debian更新源問題

今天裝了linux mint debian 版本,安裝後換了 163的 squeeze 源,發現好多軟體包在安裝時會報錯 破損的安裝包 說我的系統是 unstable 的,而且 sudo apt get upgrade 到官網看文件才知道mint 的debian 是基於testing 的,可是 16...

Ubuntu更新源設定

在編輯之前做個備份 sudo cp etc apt source.list etc apt sources.list backup 編輯源位址 sudo gedit etc apt sources.list 更新命令 sudo apt get update sudo apt get dist upg...

Linux Mint Debian更新源問題

今天裝了linux mint debian 版本,安裝後換了 163的 squeeze 源,發現好多軟體包在安裝時會報錯 破損的安裝包 說我的系統是 unstable 的,而且 sudo apt get upgrade 到官網看文件才知道mint 的debian 是基於testing 的,可是 16...