ubuntu下使用本地軟件包APT

 =====================================================================

配置:

lenovo

product: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
64 bits
8G內存

OS:Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic x86_64)

======================================================================

公司搭建了一些編譯服務器,這些服務器平常事不連接外網,只限於局域網內,時常有安裝新軟件的需求。去Ubuntu packages 下載下來後使用dpkg -i 安裝,但是有時候需要一些依賴,容易出錯,於是在source.list中添加本。


1.創建本地包目錄:

mkdir -p /var/cache/apt/localdeb

2.添加source.list precise就是ubuntu 12.04的版本

mv sources.list sources.list.net
vim sources.list.local
         #use local deb
         #ln -s sources.list.net sources.list
         #use initnet
         #ln -s sources.list.local sources.list

         deb file:///var/cache/apt/localdeb precise main

3. 使用軟連接添加本地源爲默認使用源

ln -s sources.list.local sources.list

好了,試試安裝

/etc/apt# apt-get install gitweb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package gitweb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  git

E: Package 'gitweb' has no installation candidate


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章