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. 谷歌SwitchySharp && SwitchyOmega插件

    http://pan.baidu.com/s/1jOwgu 谷歌SwitchySharp插件 http://pan.baidu.com/s/1mgl7e2k SwitchySharp的升级版Switc ...

  2. Sql优化器究竟帮你做了哪些工作?

    关系型数据库的一大优势之一,用户无需关心数据的访问方式,因为这些优化器都帮我们处理好了,但sql查询优化的时候,我不得不要对此进行关注,因为这牵扯到查询性能问题. 有经验的程序员都会对一些sql优化了 ...

  3. django 图片上传与显示

    由于图片上传的需要,学习了一波上传 1. 上传 前端代码 <form action="写上相应的定向位置" method="post" enctype=& ...

  4. 六、Linux 文件基本属性

    Linux 文件基本属性 Linux系统是一种典型的多用户系统,不同的用户处于不同的地位,拥有不同的权限.为了保护系统的安全性,Linux系统对不同的用户访问同一文件(包括目录文件)的权限做了不同的规 ...

  5. k8s使用自定义证书将客户端认证接入到API Server

    自定义证书使用kubectl认证接入API Serverkubeconfig是API Server的客户端连入API Server时使用的认证格式的客户端配置文件.使用kubectl config v ...

  6. PHP 工厂模式介绍

    工厂模式,顾名思义,如同工厂一样,你把原材料放入工厂中,出来的是成品,而你并不需要知道工厂里做了什么.代码中也类似,把主要参数放入一个工厂里,返回的是处理好的数据,我们并不需要工厂里做了什么,只需要知 ...

  7. tcl之string操作

  8. Matlab数据转化至python端,并写入数据库

    因工作原因,一些获取的行业数据以已知的结构体存储在.mat文件中, 现需要将其存储在数据库中并且能够灵活调用至python dataframe里进行操作 原数据的一个例子如下 目标如上: 然后是转化代 ...

  9. 致敬wusir懒孩子自有懒孩子的生存之道之二

    https://www.cnblogs.com/wupeiqi/ https://www.cnblogs.com/Eva-J/ https://www.cnblogs.com/wupeiqi/p/90 ...

  10. 简单聊聊四层/七层模型到HTTP

    本文内容借鉴这篇博客:https://blog.csdn.net/agzhchren/article/details/79173491 但是这篇博客也是该博主转载的,文章具体出处我没有找到,如果有人知 ...