FreeBSD利用 ports 來安裝軟體

 
利用 ports 來安裝軟體
FreeBSD 的 ports 就是別人已經編譯過,安裝測試沒問題了,他們將軟體編譯時所需的組態設定、編譯程序及安裝程序,都依照固定的格式擺在一起,當這些東西經由維護小組認可後即加入軟體蒐集中,對一般使用者而言, 我們只要先將某個軟體 ports 目錄下的檔案抓回來,然後很輕鬆的下:
make
make install
即可自動完成軟體的編譯和安裝 (也可以只用一行 make all install 來代替)。
用過 FreeBSD 的 ports 後,大部份的人都會被它這個完美的機制給吸引了, 這也是很多人喜歡用 FreeBSD 的主因之一哦。
 
一般 ports 在編譯時的運作流程:
fetch 抓取軟體的原始碼(source code),它會依下面的順序搜尋:
先找 /usr/ports/distfiles
找 /etc/make.conf 中設定的網站
找 Makefile 中 MASTER_SITES 設定的網站
checksum 檢查原始檔的 checksum 吻不吻合
depends 檢查並自動安裝須先安裝的相關軟體
extract 檢查 source,並將它解開到 works 的目錄中
patch 對 source 做 patch,修改以符合 FreeBSD 的環境需求
configure 產生設定檔
build 開始編譯
install 將編譯好的東西安裝到系統中
 
 
1.生成配置文件
make config
2.删除配置文件
make rmconfig
3.抓取源码包
make fetch
4.抓取所有源码包(包括需要到的所有包)
make fetch-recursive
5.校验源码包
make checksum
6.编译、安装并删除临时文件
make install clean
7.编译、安装、将所有需要的port打包、安装、并删除临时文件
make depends_target=package package clean 
mkdir -p /usr/ports/packages/All/
生成的package会自动放到里面,否则放在port的当前目录
8.仅解开源码包
make extract
9.仅解开并打上patch
 make patch
10.删除临时文件及源码包
make distclean
11.查询port的依赖关系
make all-depends-list #显示所有相关的套件
make pretty-print-build-depends-list #显示编译期间所需要的套件
make pretty-print-run-depends-list #显示此套件要执行时所需要的套件
12.删除已经安装的port
 make deinstall
13.删除已经安装的port及其依赖
make deinstall-depends
14.重新安装port
 make reinstall
15.搜索port
 make search key=keyword
 make search name=nameword
16.指定port安装目录
make PREFIX=path install
17.更新port MK
 cd /usr/src/share/mk
 make install
18.解决安装时的sed -i 错误
make -DUSE_REINPLACE install
19.更新port index对照表
cd /usr/ports/
 make index
20.更新index html
 cd /usr/ports/
 make readmes
 
port的make命令参数信息
fetch - Retrieves $ (and $ if defined) into $ as necessary. 
fetch-list - Show list of files that would be retrieved by fetch. 
fetch-recursive - Retrieves $ (and $ if defined), for port and dependencies into $ as necessary. 
fetch-recursive-list - Show list of files that would be retrieved by fetch-recursive. 
fetch-required-list - Show list of files that would be retrieved by fetch-required. 
fetch-required - Retrieves $ (and $ if defined), for port and dependencies that are not already installed into $. 
all-depends-list - Show all directories which are dependencies for this port. 
build-depends-list - Show all directories which are build-dependencies for this port. 
package-depends-list - Show all directories which are package-dependencies for this port. 
run-depends-list - Show all directories which are run-dependencies for this port. extract - Unpacks $ into $. 
patch - Apply any provided patches to the source. 
configure - Runs either GNU configure, one or more local configure scripts or nothing, depending on what's available. 
build - Actually compile the sources. 
install - Install the results of a build. 
reinstall - Install the results of a build, ignoring "already installed" flag. 
deinstall - Remove the installation. 
deinstall-all - Remove all installations with the same PKGORIGIN. package - Create a package from an _installed_ port. 
package-recursive - Create a package for a port and _all_ of its dependancies. 
describe - Try to generate a one-line description for each port for use in INDEX files and the like. 
checkpatch - Do a "patch -C" instead of a "patch". Note that it may give incorrect results if multiple patches deal with the same file. 
checksum - Use distinfo to ensure that your distfiles are valid. 
checksum-recursive - Run checksum in this port and all dependencies. 
makesum - Generate distinfo (only do this for your own ports!). 
clean - Remove $ and other temporary files used for building. 
clean-depends - Do a "make clean" for all dependencies. 
config - Configure options for this port (using $). Automatically run prior to extract, patch, configure, build, install, and package. 
showconfig - Display options config for this port 
rmconfig - Remove the options config for this port

FreeBSD利用 ports 來安裝軟體的更多相关文章

  1. [Xamarin] 取得所有已安裝軟體清單 (转帖)

    最近會用到,簡單記錄一下,抓取所有該手機已經安裝的軟體清單 結果圖: 首先介紹一下Layout :  \Resources\Layout\Main.axml <?xml version=&quo ...

  2. FreeBSD 安裝 Tomcat JAVA JDK1.6 筆記

    首先是安裝軟體 cd /usr/ports/java/jdk16/ make 在這一步,需要你手動到sun.com上下載幾個安裝包,按提示下載好後加入到 /usr/ports/distfiles/,再 ...

  3. 鸟哥之安裝 CentOS7.x

    http://linux.vbird.org/linux_basic/0157installcentos7.php since 2002/01/01 新手建議 開始閱讀之前 網站導覽 Linux 基礎 ...

  4. [SharePoint 2010] 如何安裝啟用多國語系支援的SharePoint網站

    SharePoint 2010的多國語系支援與前一版的SharePoint 2007有所不同,SharePoint 2010內允許使用者自行決定使用介面語系的選擇. SharePoint 2010的多 ...

  5. win2003的IIS無法使用,又一次安裝提示找不到iisadmin.mfl文件

    我的系統是win2003 繁體版 sp2,現在iis無法使用,我同事的也是,也不知道是不是跟在網域中有關係,因為我用虛擬機的繁體系統win2003 R2版iis能够正常使用,不過曾经那台電腦也是在網域 ...

  6. kali 安裝虛擬機VMware

    0x00前言 由於之前已經安裝過虛擬機,這次爲了寫博客又重新安裝了一邊,有些地方直接按照之前的默認的設置來了,省了設置,中間又換了一個實驗環境.完成了文章中的演示,整個過程多次實驗是沒問題的,若有疑問 ...

  7. [Windows Server] 在 Windows Server 2012 上安裝 .NET Framework 3.5 - 摘自网络

    官方: Applies To: Windows 8, Windows 8.1 For a Windows Server® 2012 core installation that is not conn ...

  8. 在VPS上安裝BT軟體Transmission

    在VPS上安裝BT軟體Transmission   作者: 窮苦人家的小孩 | 2009-12-04 55 Comments   VPS 還能怎玩?! 裝Proxy,裝VPN,這還不夠,我還用來掛種子 ...

  9. 安裝開源BBS軟件YAF時碰到的問題

    1.下載 http://yetanotherforum.net/download.aspx 安裝說明 http://www.drreddys.com/quest/readme.htm 其實只要打開根目 ...

随机推荐

  1. python_36_文件操作4

    f=open('test.txt','a',encoding='utf-8') #f.truncate()#截断,不指定将清空所有内容 f.truncate(5)#从头开始截断,截断5个字符 注:使用 ...

  2. Unity的sendmessage用法

    刚学完sendmessage用法,自己也尝试测试了一下,用法如下: 1.在unity2017新建一个场景test 2.在场景中添加一个立方体cube作为主角,另添加一个胶囊体capsule,调整为如图 ...

  3. 张量 (tensor) 是什么?

    对于大部分已经熟练的数学和物理工作者, 这实在是一个极为基础的问题. 但这个问题在我刚接触张量时也困扰了我很久. 张量的那么多定义, 究竟哪些是对的? (显然都是对的. ) 它们的关系是什么? 我尽可 ...

  4. JS let和const关键字

    ES2015 引入了两个重要的 JavaScript 新关键词:let 和 const. Let关键字 1.用于作用域:块作用域,循环作用域,函数作用域,全局作用域, 在 ES2015 之前,Java ...

  5. 基于GMap.NET地图下载器的开发和研究

    基于GMap.NET地图下载器的开发和研究 软件下载地址:https://pan.baidu.com/s/1ay0aOm3fiZ35vlfD8kFYFw 1.地图浏览功能 可以浏览谷歌地图.百度.ar ...

  6. 认识mysql(2)

    1.表字段的操作 1.语法 :alter table 表名 执行动作; 2.添加字段(add) alter table 表名 add 字段名 数据类型; alter table 表名 add 字段名 ...

  7. 认识mysql(1)

    ---恢复内容开始--- 1.MySQL概述 1.什么是数据库? 存储数据的仓库 2.都有哪些公司在用数据库? 金融机构.游戏公司.购物网站.论坛网站... 3.提供数据库服务的软件? 1.软件分类 ...

  8. python 使用uuid 出现重复

    同时保存入数据库时候 ,使用  uuid.uuid1() 后出现 重复的 id , 现在  修改为 (uuid.uuid5(uuid.NAMESPACE_DNS, str(uuid.uuid1()) ...

  9. 无线Web开发

    http://am-team.github.io/amg/dev-exp-doc.html

  10. 浅谈MapReduce工作机制

    1.MapTask工作机制 整个map阶段流程大体如上图所示.简单概述:input File通过getSplits被逻辑切分为多个split文件,通通过RecordReader(默认使用lineRec ...