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. 【HHHOJ】NOIP模拟赛 捌 解题报告

    点此进入比赛 得分: \(30+30+70=130\)(弱爆了) 排名: \(Rank\ 22\) \(Rating\):\(-31\) \(T1\):[HHHOJ260]「NOIP模拟赛 捌」Dig ...

  2. PAT (Basic Level) Practise (中文)- 1002. 写出这个数 (20)

    http://www.patest.cn/contests/pat-b-practise/1002 读入一个自然数n,计算其各位数字之和,用汉语拼音写出和的每一位数字. 输入格式:每个测试输入包含1个 ...

  3. Redis学习记录(三)

    1.Redis集群的搭建 1.1redis-cluster架构图 架构细节: (1)所有的redis节点批次互联(PING-PONG机制),内部使用二进制协议优化传输速度和带宽. (2)节点的fail ...

  4. Linux MySQL 修改密码

    修改root本地登录密码 修改root默认的密码(方法一)1. 启动mysql之后systemctl start mysqld.service2. 修改mysql的配置文件 vi /etc/my.cn ...

  5. AngularJS1.X版本双向绑定九问

    前言 由于工作的原因,使用angular1.x版本已经有一段时间了,虽然angualr2升级后就完全重构了,但每个版本存在也有一定的道理.话不多说,进入正题. 1.双向绑定的原理是什么? Angual ...

  6. P4747 D’s problem(d)

    时间: 1000ms / 空间: 655360KiB / Java类名: Main 背景 冬令营入学测试题 描述 题目描述 小D是一名魔法师,它最喜欢干的事就是对批判记者了. 这次记者招待会上,记者对 ...

  7. gravity 使用操作。

    gravity 使用操作.最近我司有一个比较奇葩的需求,我们的环境是主从,因为数据量较大会定期的删除数据,最近不行了,要求新建出来一个库 同步正事环境的数据,但是要剔除 delete ,drop,tr ...

  8. django+xadmin在线教育平台(一)

    大家好,此教程为在慕学网的实战教程Python升级3.6 强力Django+杀手级Xadmin打造在线教育平台的学习笔记,不对望指正! 使用Django+Xadmin打造在线教育平台(Python2, ...

  9. nginx Keepalived高可用集群

    一.Keepalived高可用 1.简介 Keepalived软件起初是专为LvS负载均衡软件设计的,用来管理并监控LVS集群系统中各个服务节点的状态,后来又加入了可以实现高可用的VRRP功能.因此, ...

  10. 7款公认比较出色的Python IDE,你值得拥有!

    Python作为一款比较“简洁”的编程语言,它拥有很多性价比高的性能,造就了它现在比较火热的局面,很多人都来学习Python.Python 的学习过程少不了 IDE 或者代码编辑器,或者集成的开发编辑 ...