Ubuntu自建源

版本16.04

1,更新本地源

apt-get update
apt-get upgrade

2,安裝apt-mirror

apt-get install apt-mirror

3,修改配置文件

root@VDIUBUNTU1604:~# cat /etc/apt/mirror.list
############# config ##################
# 以下注釋的內(nèi)容都是默認配置,如果需要自定義,取消注釋修改即可
set base_path /var/spool/apt-mirror
#
# 鏡像文件下載地址
# set mirror_path $base_path/mirror
# 臨時索引下載文件目錄,也就是存放軟件倉庫的dists目錄下的文件(默認即可)
# set skel_path $base_path/skel
# 配置日志(默認即可)
# set var_path $base_path/var
# clean腳本位置
# set cleanscript $var_path/clean.sh
# 架構配置,i386/amd64,默認的話會下載跟本機相同的架構的源
set defaultarch amd64
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
# 下載線程數(shù)
set nthreads 20
set _tilde 0
#
############# end config ##############
# Ali yun(這里沒有添加deb-src的源)
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
 
clean http://mirrors.aliyun.com/ubuntu

4,同步到本地

apt-miiror

時間巨長,有117G

5,安裝Apache

apt-get install apache2
#創(chuàng)建索引
ln -s /var/spool/apt-mirror/mirror/mirrors.aliyun.com/ubuntu /var/www/html/ubuntu

6,訪問成功

http://ip:port/ubuntu 
image.png

7,客戶端配置

root@VDIUBUNTU1604:~#vim /etc/apt/source.list
# Local Source      #ip和port是自己本機的,其中端口默認為80
deb [arch=amd64] http://[ip]:[port]/ubuntu/ trusty main restricted universe multiverse
deb [arch=amd64] http://[ip]:[port]/ubuntu/ trusty-security main restricted universe multiverse
deb [arch=amd64] http://[ip]:[port]/ubuntu/ trusty-updates main restricted universe multiverse  
deb [arch=amd64] http://[ip]:[port]/ubuntu/ trusty-proposed main restricted universe multiverse
deb [arch=amd64] http://[ip]:[port]/ubuntu/ trusty-backports main restricted universe multiverse

更新源
apt-get update 
apt-get upgrade
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容