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. 从暴力匹配到KMP算法

    前言 现在有两个字符串:\(s1\)和\(s2\),现在要你输出\(s2\)在\(s1\)当中每一次出现的位置,你会怎么做? 暴力匹配算法 基本思路 用两个指针分别指向当前匹配到的位置,并对当前状态进 ...

  2. 【CF1000C】Covered Points Count(离散化+差分)

    点此看题面 大致题意: 给出\(n\)条线段,分别求有多少点被覆盖\(1\)次.\(2\)次...\(n\)次. 正常的算法 好吧,这道题目确实有个很简单的贪心做法(只可惜我做的时候没有想到,结果想了 ...

  3. 【BZOJ3940】[USACO2015 Feb] Censoring (AC自动机的小应用)

    点此看题面 大致题意: 给你一个文本串和\(N\)个模式串,要你将每一个模式串从文本串中删去.(此题是[BZOJ3942][Usaco2015 Feb]Censoring的升级版) \(AC\)自动机 ...

  4. vuejs组件

    <div id='root'> <ul> <todo-item></todo-item> </ul> </div> <sc ...

  5. MySQL - RIGHT JOIN

    RIGHT JOIN 关键字 RIGHT JOIN 关键字会右表 (table_name2) 那里返回所有的行,即使在左表 (table_name1) 中没有匹配的行. RIGHT JOIN 关键字语 ...

  6. jsp页面:一个form,不同请求提交form

    需求:一个表单中有一个请求 action="url"发送数据地址: 在表单外有一个请求,请求form表单提交的数据 我们用js来写:通过每次请求传不同的action=url; 例如 ...

  7. 项目实战8.2-Linux下Tomcat开启查看GC信息

    本文收录在Linux运维企业架构实战系列 转自https://www.cnblogs.com/along21/ 一.开启GC日志 1.在Tomcat 的安装路径下,找到bin/catalina.sh  ...

  8. HTML5/CSS3 第三章页面布局

    页面布局 1 页面组成 2 布局相关的标签 <div></div> 定义文档中的分区或节 <span></span> 这是一个行内元素,没有任何意义 & ...

  9. 爬虫进阶之Selenium和chromedriver,动态网页(Ajax)数据抓取

    什么是Ajax: Ajax(Asynchronouse JavaScript And XML)异步JavaScript和XML.过在后台与服务器进行少量数据交换,Ajax 可以使网页实现异步更新.这意 ...

  10. relu函数为分段线性函数,为什么会增加非线性元素

    relu函数为分段线性函数,为什么会增加非线性元素 我们知道激活函数的作用就是为了为神经网络增加非线性因素,使其可以拟合任意的函数.那么relu在大于的时候就是线性函数,如果我们的输出值一直是在大于0 ...