自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

如何創(chuàng)建和使用本地UbuntuSource鏡像服務(wù)器?

運(yùn)維 系統(tǒng)運(yùn)維
本文介紹了創(chuàng)建和使用本地UbuntuSource鏡像服務(wù)器的方法,從需求開始,也詳細(xì)介紹了筆者選擇sohu的UbuntuSource服務(wù)器作為復(fù)制的source的原因,希望能夠?qū)ψx者有素幫助。

創(chuàng)建和使用本地UbuntuSource鏡像服務(wù)器可能還有很多用戶并不知道方法,下文就給出了詳細(xì)的描述,具體內(nèi)容如下所述。

什么需要?jiǎng)?chuàng)建Ubuntu本地鏡像

Ubuntu發(fā)行版光盤中都只有少數(shù)常用軟件包。Ubuntu上要安裝的軟件,常常需要到Ubuntu源服務(wù)器上下載。

使用如下命令可以搜索和安裝可用的軟件包。

 

  1. apt-cachesearchpackageName  
  2.  
  3. sudoapt-getinstallpackageName 

 

apt-get實(shí)際使用wget命令,從/etc/apt/sources.list配置文件指定的源上下載對應(yīng)的.deb軟件包,然后使用dpkg-ipackageName.deb安裝軟件。

如果Ubuntu電腦所在的環(huán)境網(wǎng)絡(luò)性能較差,或者不能連接互聯(lián)網(wǎng),那么就很難安裝UbuntuSource服務(wù)器上的海量軟件包。

此時(shí),你可以在局域網(wǎng)內(nèi)創(chuàng)建自己的UbuntuSource服務(wù)器,從而節(jié)省大量網(wǎng)絡(luò)流量,并且可以大大提高安裝軟件的速度!

本文將介紹如何創(chuàng)建UbuntuSource的本地鏡像。

創(chuàng)建Ubuntu本地鏡像

需求

為了創(chuàng)建Ubuntumirror服務(wù)器,你需要至少60G硬盤剩余空間。Ubuntu每一個(gè)版本分為32bit和64bit兩個(gè)版本,有兩組deb包。***的ubuntu版本兩組deb包需要大約90GB的空間。

你可以創(chuàng)建Ubuntu一個(gè)版本的32或者64bit服務(wù)器,也可以創(chuàng)建同時(shí)服務(wù)于32和64bit的服務(wù)器。也可以創(chuàng)建服務(wù)于所有ubuntu版本的source服務(wù)器。根據(jù)你的硬盤剩余空間和你的需要而定。

使用sohu的UbuntuSource服務(wù)器作為源服務(wù)器

Sohu公司提供了多種Linux和BSD操作系統(tǒng)發(fā)行版的source服務(wù)器。點(diǎn)擊下面鏈接

http://mirrors.sohu.com/

可以看到sohu公司提供的所有種類的source服務(wù)器。

點(diǎn)擊http://mirrors.sohu.com/help/Ubuntu.html頁面可以看到UbuntuSource服務(wù)器的使用幫助。

你可以直接修改/etc/apt/sources.list文件,添加上sohu的source服務(wù)器,從而使用sohu的source服務(wù)器,這比使用國外的Ubuntu官方source服務(wù)器速度要快很多。

我接下來,要根據(jù)sohu的UbuntuSource服務(wù)器,構(gòu)建本地的UbuntuSource服務(wù)器。

我選擇sohu的UbuntuSource服務(wù)器作為復(fù)制的source的原因:

1,sohu的UbuntuSource服務(wù)器速度相當(dāng)快。如果我使用ubuntu官方的source服務(wù)器作為復(fù)制的源,顯然會(huì)花費(fèi)更多的時(shí)間。

2,sohu的UbuntuSource服務(wù)器每天都會(huì)和ubuntu官方source服務(wù)器同步一次。因此可以保證我www.linuxidc.com能夠使用***版本的deb包。

我構(gòu)建的UbuntuSource服務(wù)器也會(huì)每天和sohu的UbuntuSource服務(wù)器同步一次。

使用apt-mirror創(chuàng)建UbuntuSource服務(wù)器的本地鏡像服務(wù)器

 

  1. Sudoapt-getinstallapt-mirror  
  2.  
  3. sudoapt-getinstallapache2 

 

我們需要上面這兩個(gè)軟件來構(gòu)建我們的本地UbuntuSource服務(wù)器。

我現(xiàn)在以構(gòu)建Ubuntu10.10和ubuntu10.04的32和64位版本的本地ubuntsource服務(wù)器為例進(jìn)行介紹。

如果你需要服務(wù)于其他版本,請修改對應(yīng)的配置。

/etc/apt/mirror.list配置文件修改為如下:

 

  1. #############config###################  
  2.  
  3. #setbase_path/var/spool/apt-mirror  
  4.  
  5. #  
  6.  
  7. #setmirror_path$base_path/mirror  
  8.  
  9. #setskel_path$base_path/skel  
  10.  
  11. #setvar_path$base_path/var  
  12.  
  13. #setcleanscript$var_path/clean.sh  
  14.  
  15. #setdefaultarch  
  16.  
  17. #setpostmirror_script$var_path/postmirror.sh  
  18.  
  19. #setrun_postmirror0  
  20.  
  21. setnthreads20  
  22.  
  23. set_tilde0  
  24.  
  25. ##############endconfig##############  
  26.  
  27. debhttp://mirrors.sohu.com/Ubuntulucidmainmain/debian-installerrestrictedrestricted/debian-installeruniversemultiverse  
  28.  
  29. debhttp://mirrors.sohu.com/Ubuntumaverickmainmain/debian-installerrestrictedrestricted/debian-installeruniversemultiverse  
  30.  
  31. debhttp://mirrors.sohu.com/Ubuntulucid-securitymainrestricteduniversemultiverse  
  32.  
  33. debhttp://mirrors.sohu.com/Ubuntumaverick-securitymainrestricteduniversemultiverse  
  34.  
  35. debhttp://mirrors.sohu.com/Ubuntulucid-updatesmainrestricteduniversemultiverse  
  36.  
  37. debhttp://mirrors.sohu.com/Ubuntumaverick-updatesmainrestricteduniversemultiverse  
  38.  
  39. #debhttp://archive.Ubuntu.com/ubuntumaverick-proposedmainrestricteduniversemultiverse  
  40.  
  41. #debhttp://archive.Ubuntu.com/ubuntumaverick-backportsmainrestricteduniversemultiverse  
  42.  
  43. deb-srchttp://mirrors.sohu.com/Ubuntulucidmainrestricteduniversemultiverse  
  44.  
  45. deb-srchttp://mirrors.sohu.com/Ubuntumaverickmainrestricteduniversemultiverse  
  46.  
  47. deb-srchttp://mirrors.sohu.com/Ubuntulucid-securitymainrestricteduniversemultiverse  
  48.  
  49. deb-srchttp://mirrors.sohu.com/Ubuntumaverick-securitymainrestricteduniversemultiverse  
  50.  
  51. deb-srchttp://mirrors.sohu.com/Ubuntulucid-updatesmainrestricteduniversemultiverse  
  52.  
  53. deb-srchttp://mirrors.sohu.com/Ubuntumaverick-updatesmainrestricteduniversemultiverse  
  54.  
  55. #deb-srchttp://archive.Ubuntu.com/ubuntumaverick-proposedmainrestricteduniversemultiverse  
  56.  
  57. #deb-srchttp://archive.Ubuntu.com/ubuntumaverick-backportsmainrestricteduniversemultiverse  
  58.  
  59. deb-i386http://mirrors.sohu.com/Ubuntulucidmainmain/debian-installerrestrictedrestricted/debian-installeruniversemultiverse  
  60.  
  61. deb-i386http://mirrors.sohu.com/Ubuntumaverickmainmain/debian-installerrestrictedrestricted/debian-installeruniversemultiverse  
  62.  
  63. deb-i386http://mirrors.sohu.com/Ubuntulucid-securitymainrestricteduniversemultiverse  
  64.  
  65. deb-i386http://mirrors.sohu.com/Ubuntumaverick-securitymainrestricteduniversemultiverse  
  66.  
  67. deb-i386http://mirrors.sohu.com/Ubuntulucid-updatesmainrestricteduniversemultiverse  
  68.  
  69. deb-i386http://mirrors.sohu.com/Ubuntumaverick-updatesmainrestricteduniversemultiverse  
  70.  
  71. #debhttp://archive.Ubuntu.com/ubuntumaverick-proposedmainrestricteduniversemultiverse  
  72.  
  73. #debhttp://archive.Ubuntu.com/ubuntumaverick-backportsmainrestricteduniversemultiverse  
  74.  
  75. #deb-srchttp://mirrors.sohu.com/Ubuntulucidmainrestricteduniversemultiverse  
  76.  
  77. #deb-srchttp://mirrors.sohu.com/Ubuntumaverickmainrestricteduniversemultiverse 

 

說明:

maverick和lucid分別是Ubuntu10.10和10.04的代號。

debhttp://*表示下載64位版本的deb軟件。

deb-i386http://*表示下載32位版本的deb軟件。

然后執(zhí)行:sudoapt-mirror

這會(huì)啟動(dòng)20個(gè)線程【上面文件中配置】運(yùn)行wget到http://mirrors.sohu.com/Ubuntu下面下載相應(yīng)的deb包。

sudoapt-mirror執(zhí)行完成后,/var/spool/apt-mirror目錄下就有了所有需要的deb包和相應(yīng)的配置文件。

因?yàn)槲椰F(xiàn)在是從sohu下載的,所以實(shí)際的文件在:/var/spool/apt-mirror/mirror/mirrors.sohu.com/Ubuntu目錄下。

如果你選擇其他UbuntuSource服務(wù)區(qū),那么會(huì)下載到其他對應(yīng)的目錄下。

總結(jié):

希望本文介紹的創(chuàng)建和使用本地UbuntuSource鏡像服務(wù)器的方法能夠?qū)ψx者有所幫助,更多有關(guān)linux系統(tǒng)的知識還有待于讀者去探索和學(xué)習(xí)。

【編輯推薦】

  1. Ubuntu10.04下如何移植QtE?
  2. 如何在Ubuntu下訪問局域網(wǎng)服務(wù)器?
  3. 如何在Ubuntu下安裝媒體中心XBMC?
  4. 在Ubuntu下如何編譯***個(gè)內(nèi)核模塊? 
  5. Ubuntu10.10下MySQL5.1如何進(jìn)行集群配置? 
責(zé)任編輯:韓亞珊 來源: 雨林木風(fēng)
相關(guān)推薦

2012-12-03 14:21:02

服務(wù)器群集

2010-09-29 15:00:04

DHCP服務(wù)器

2010-08-31 17:33:24

DHCP服務(wù)器

2010-08-03 15:31:42

Ubuntu NFS服

2018-01-22 09:04:06

鏡像服務(wù)器作用

2022-12-13 10:45:12

無服務(wù)器架構(gòu)物聯(lián)網(wǎng)工具

2022-03-11 06:47:30

MSSQL數(shù)據(jù)庫MySQL

2010-03-16 13:47:48

Java多線程服務(wù)器

2012-05-09 10:30:29

RHEL5.7DHCP服務(wù)器

2012-05-09 10:33:56

RHEL5.7DNS服務(wù)器

2014-03-06 09:23:19

Git服務(wù)器Github

2010-08-05 13:23:05

NFS協(xié)議

2010-07-05 11:14:32

2020-03-16 09:10:41

bindDNS服務(wù)器系統(tǒng)運(yùn)維

2011-03-23 15:13:08

Nagios監(jiān)控oracle

2021-10-28 19:08:29

Python虛擬環(huán)境

2019-09-16 11:40:49

Linux交換文件

2010-05-18 13:37:03

IIS服務(wù)器

2010-08-26 11:01:05

DHCP服務(wù)器

2010-08-04 11:04:48

UbuntuNFS服務(wù)器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號