搭建Ubuntu 12.04 本地源济丘,徹底實(shí)現(xiàn)以后的內(nèi)網(wǎng)安裝OpenStack。
- 安裝apt-mirror工具
sudo apt-get install apt-mirror
或者下載源碼編譯捻激,不過推薦apt安裝.方法自行摸索.
- 配置apt-mirror工具
gksu gedit /etc/apt/mirrors.list
清除原有內(nèi)容括勺,沒關(guān)系,輸入以下內(nèi)容:
set nthreads 20
set _tilde 0
############# end config ##############
deb http://mirrors.sohu.com/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.sohu.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.sohu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.sohu.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.sohu.com/ubuntu/ lucid-backports universe main multiverse restricted
clean http://mirrors.sohu.com/ubuntu
這里的地址規(guī)則和sources.list中是一樣的潜秋,用的是sohu的鏡像蛔琅,內(nèi)容很全的,與官方同步的.
- 開始制作
sudo apt-mirror
大概會(huì)顯示
Downloading 80 index files using 20 threads...
Begin time: Fri Mar 30 21:47:40 2012
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Fri Mar 30 21:47:57 2012
Proceed indexes: [PPPPP]
44 GiB will be downloaded into archive.
Downloading 4388 archive files using 20 threads...
制作完成后會(huì)有提示,制作過程可以中斷峻呛,之后再次運(yùn)行apt-mirror會(huì)繼續(xù)以前的工作.每次都可以這樣更新.
此過程根據(jù)網(wǎng)速不同罗售,會(huì)有不同的時(shí)間.網(wǎng)速快的話,1個(gè)晚上就能完成.
- 作為本地源頭更新
制作完成后钩述,在本地存儲(chǔ)的地址為:/var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu
編輯sources.list
gksu gedit /ets/apt/sources.list
刪除原有內(nèi)容寨躁,寫入:
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ lucid main universe restricted multiverse
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ lucid-security universe main multiverse restricted
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ lucid-backports universe main multiverse restricted
- 本地安裝軟件包
sudo apt-get update
sudo apt-get install xxxx
- 制作成局域網(wǎng)源
安裝apaches
/var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu/ 作為webroot
地址為局域網(wǎng)ip地址即可.