<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Leptians Times &#187; cvsup</title>
	<atom:link href="http://blog.leptians.net/tag/cvsup/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.leptians.net</link>
	<description>Just My Rambling Thoughts</description>
	<lastBuildDate>Tue, 25 May 2010 07:33:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>HowTo: Using FreeBSD Ports</title>
		<link>http://blog.leptians.net/tutorials/howto-using-freebsd-ports/</link>
		<comments>http://blog.leptians.net/tutorials/howto-using-freebsd-ports/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 07:16:42 +0000</pubDate>
		<dc:creator>Leptians</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[csup]]></category>
		<category><![CDATA[cvsup]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[portsnap]]></category>
		<category><![CDATA[portupgrade]]></category>

		<guid isPermaLink="false">http://blog.leptians.net/?p=98</guid>
		<description><![CDATA[Synopsis Just like RPM Package Manager, FreeBSD Ports collection is where users and administrators to install application that has been ported for FreeBSD. At the time of writing, there are more than 19,000 ports available. Ports can be searched via official FreeBSD ports page or use one of the following commands on your FreeBSD machine [...]]]></description>
			<content:encoded><![CDATA[<h2>Synopsis</h2>
<p>Just like RPM Package Manager, FreeBSD Ports collection is where users and administrators to install application that has been ported for FreeBSD. At the time of writing, there are more than 19,000 ports available. Ports can be searched via official <a href="http://www.freebsd.org/ports/">FreeBSD ports</a> page or use one of the following commands on your FreeBSD machine :</p>
<pre># make search name=[port's name]
example: make search name=vim</pre>
<p>or</p>
<pre># make search key=[keywords]
example: make search key="text editor"</pre>
<p>In this tutorial, you will learn how to install Ports Tree and keeping it up-to-date, as well as install application from ports.</p>
<p><span id="more-98"></span></p>
<h2>Install Ports Tree</h2>
<p>If you did not install ports during <a href="http://blog.leptians.net/tutorials/howto-install-freebsd/">FreeBSD Installation</a>, it can be installed using sysinstall command:</p>
<ul>
<li>sysinstall</li>
<li>Configure</li>
<li>Distributions</li>
<li>Ports (space to select) then click OK</li>
<li>and follow the rest of the instructions</li>
</ul>
<h2>Keep Ports Tree Up-To-Date</h2>
<p>In software development world, everything is ever-changing. Software always get updated because of new features or bug fixes. Your Ports Tree might no longer be up-to-date. In order to ensure your ports tree has the latest collection, it needs to be updated. There are 2 common ways to update Port Trees:</p>
<h4>CVSup/csup Method</h4>
<p>The example ports-supfile can be found in <em>/usr/share/examples/cvsup/ports-supfile</em>, copy that file to <em>/root/</em> so that you can modify to fit your setup.</p>
<p>Open /root/ports-supfile and modify <em>CHANGE_THIS.FreeBSD.org </em>to a CVSup near you. After save the file, run the following command:</p>
<pre># csup -L 2 /root/ports-supfile</pre>
<p>If you want to use different CVSup server without modifying the ports-supfile, run the following command instead:</p>
<pre><samp class="PROMPT">#</samp> <kbd class="USERINPUT">csup -L 2 -h <tt class="REPLACEABLE"><em>cvsup.FreeBSD.org</em></tt> /root/ports-supfile</kbd></pre>
<h4>Portsnap Method</h4>
<p>It is an alternative application for distributing ports collection. It&#8217;s more secured and faster since each snapshot is digitally signed and compressed. If Portsnap is not installed on your system, it can be found in <em>/usr/ports/ports-mgmt/portsnap</em>.</p>
<p>There are 3 basic and common portsnap command:</p>
<ol>
<li><strong>portsnap fetch</strong>: to download latest snapshot</li>
<li><strong>portsnap extract</strong>: only need if you are running Portsnap for the first time</li>
<li><strong>portsnap update</strong>: to update your existing Ports Tree from your recent fetched snapshot</li>
</ol>
<p>To update your Ports Tree on demand, you can run the following command to fetch and update:</p>
<pre># portsnap fetch update</pre>
<p>To update your Ports Tree regularly, you need to add the following line in your root&#8217;s crontab entries:</p>
<pre>0 3 * * * /usr/sbin/portsnap cron</pre>
<h2>Install New Application from Ports</h2>
<p>There are many ways to install new application, such as compile from source, packages system, or sysinstall. I will show you how to do it for the first two.</p>
<h4>Compile From Source</h4>
<p>Compiling from source can be as easy as <em>make install</em>. First you need to locate where the application is located inside /usr/ports. If you are not sure, you can use search (see <em>Synopsis</em>).</p>
<p>Example on how to install vim:</p>
<pre>cd /usr/ports/editors/vim/ &amp;&amp; make <strong>install</strong></pre>
<p>This method will download the source code and install it from source.</p>
<p>To deinstall  vim:</p>
<pre># cd /usr/ports/editors/vim/ &amp;&amp; make <strong>deinstall</strong></pre>
<p>To reinstall vim:</p>
<pre># cd /usr/ports/editors/vim/ &amp;&amp; make <strong>reinstall</strong></pre>
<p>Please keep in mind, every time you install an application using this method, it will take up some time and space. It will create all the compiled objects in <em>working</em> directory inside its folder. This eventually can fill up your partition. All the downloaded source code also will retain in <em>/usr/ports/distfiles</em>. To clean those files, you need to run this command:</p>
<pre># cd /usr/ports/editors/vim/ &amp;&amp; make clean distclean</pre>
<p><em>clean </em>is to clean its working files and <em>distclean </em>is to clean its distribution file(s). Isn&#8217;t that pretty straight forward?</p>
<h4>Using Packages System</h4>
<p>Example on how to install vim:</p>
<pre># pkg_add -r vim</pre>
<p>To deinstall vim, you need to know its version number:</p>
<pre># pkg_delete vim-7.2.14</pre>
<p>To find out what version vim is installed on your system:</p>
<pre># pkg_info | grep vim
vim-7.2.14          Vi "workalike", with many additional features</pre>
<h2>Upgrading Installed Application Using Portupgrade</h2>
<p>To determine if there is any newer version of installed application in your system, run the following command:</p>
<pre># pkg_version -vIL=
vim-7.2.14                          &lt;   needs updating (index has vim-7.2.14_2)
fusefs-kmod-0.3.9.p1_2              &lt;   needs updating (index has 0.3.9.p1.20080208_3)</pre>
<p>This command is to compare all the installed application with your local ports tree. If it has different version (newer or older), it will be listed. Therefore, it&#8217;s recommended to keep your ports tree updated.</p>
<p>If you do not have <em>Portupgrade</em> installed in your system, it can be found at <em>/usr/ports/ports-mgmt/portupgrade</em>.</p>
<p>To upgrade <em>all </em>outdated application, run the following command:</p>
<pre># portupgrade -a</pre>
<p>To upgrade a specific application, run the following command:</p>
<pre># portupgrade vim</pre>
<h2>Further Reading</h2>
<ul>
<li><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html">Using the Ports Collectio</a></li>
<li><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html">Using CVSup</a></li>
<li><a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-portsnap.html">Using Portsnap</a></li>
<li><a href="http://www.freebsd.org/doc/en/books/handbook/packages-using.html">Using the Packages System</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.leptians.net/tutorials/howto-using-freebsd-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
