<?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>Scienco.org &#187; Debian</title>
	<atom:link href="http://www.scienco.org/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scienco.org</link>
	<description>Life&#039;s too short to be unenthusiastic</description>
	<lastBuildDate>Thu, 07 Jul 2011 13:47:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<atom:link rel="next" href="http://www.scienco.org/tag/debian/feed/?page=2" />

		<item>
		<title>Installing FreeBSD 7 from the view of a Debian user</title>
		<link>http://www.scienco.org/2008/installing-freebsd-7-from-the-view-of-a-debian-user/</link>
		<comments>http://www.scienco.org/2008/installing-freebsd-7-from-the-view-of-a-debian-user/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 17:50:04 +0000</pubDate>
		<dc:creator>Mikkel Meyer Andersen</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.scienco.org/?p=85</guid>
		<description><![CDATA[I've been using both Debian and Ubuntu on both server and desktop for some years now, but I think it's time to try something new so I'm not getting stuck and reject everything that's new (not that I tend to!). I think I'll have a closer look on FreeBSD: installation, updating, etc. - seen from [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using both Debian and Ubuntu on both server and desktop for some years now, but I think it's time to try something new so I'm not getting stuck and reject everything that's new (not that I tend to!). I think I'll have a closer look on FreeBSD: installation, updating, etc. - seen from a Debian/Ubuntu user's point of view.<span id="more-85"></span></p>
<p>On the server-side I've never doubted my choice - I've been very pleased with Debian and later on Ubuntu Server. On the desktop-side I've used Windows, too, and had some habituation to do before feeling home with Debian/Ubuntu: not on the GUI but when configuring the system and when locating errors (application errors, <code>apt-get install</code> failing, <code>xorg.conf</code> etc.). But now I feel free and more well-equipped when using Ubuntu than I do on Windows.</p>
<p>Well, this entry is not about the desktop-side but about the server-side. But why look into FreeBSD when I'm so pleased with Debian/Ubuntu? Well first of all because I've heard a lot of nice things about FreeBSD from both friends and read a lot of praise of FreeBSD. Furthermore I feel that it's time to evolve - try something else so I don't get stuck. I want to learn something more. So now I'm going to play a bit with FreeBSD and let you guys get my first impressions about it. To get some general information about FreeBSD, refer to [1].</p>
<h3>The installation</h3>
<p>The FreeBSD installer looks a bit like the Debian or Ubuntu alternate ones. I'm going to go with a standard installation. Let me say this at once: I think I'll try the installation process a few time so I'll get to know it, avoid mistakes when moving to a production environment, view additional configuration parameters, and first afterwards start playing with the system. Well, as said: I chose standard installation.</p>
<p>When I came to choosing distributions, I only chose the minimal-distribution. I think that's the most suitable for a server - I want control of the components on the server, so I'll install the necessary ones manually after the installation.</p>
<p>I think this is the time for a short sidekick. Whereas Debian/Ubuntu has it's main focus on precompiled packages (.debs), FreeBSD has it's focus on so-called ports. It's just bare naked  source code (including Makefiles etc.). To install a port, the first thing the operating system does is to compile the program and afterwards copy all the files to the right places. This means that I'll the programs get customized for precisely your system, but it takes some extra time to perform installation of application. I might say this now: FreeBSD also offers packages (as opposed to ports) that's precomiled binaries one can use. Well, I like the idea of ports - and the compilation time won't be a problem for be because I'm not going to compile Gnome or similar: I think Apache, PHP, MySQL, Postfix, Courier, and a couple of other would do. So I'm definitely going for ports. If you hoped for packages, I'm sorry - please use your preferred search engine to find something about that. One of the thinks I'm really exited to see, is how well and easy the process of updating installed ports is. It's not required to be <code>apt-get upgrade</code>-easy, but something like it would be top notch!</p>
<p>Well, let's continue with the installation! I chose to install from the CD. Normally I'd install from FTP so get the newest version at once, but I'd really like to review the update/upgrade process of FreeBSD et al., so I'll pick the CD this time.</p>
<p>At a time you have to decide whether to enable "Linux Binary Compatibility". To quote from [2]:</p>
<blockquote><p>At this point, you may be asking yourself why exactly, does FreeBSD need to be able to run Linux binaries? The answer to that question is quite simple. Many companies and developers develop only for Linux, since it is the latest â€œhot thingâ€ in the computing world. That leaves the rest of us FreeBSD users bugging these same companies and developers to put out native FreeBSD versions of their applications. The problem is, that most of these companies do not really realize how many people would use their product if there were FreeBSD versions too, and most continue to only develop for Linux. So what is a FreeBSD user to do? This is where the Linux binary compatibility of FreeBSD comes into play.</p></blockquote>
<p>So whether you should enable it or not is up to you, but if you're in doubt, I'd recommend to enable it. Please refer to [2] for further information about the "Linux Binary Compatibility".</p>
<p>Then I created a normal user to ordinary non-system work (before creating the user, create a group with the same name as your username). I might add, that if you enabled SSH-logins, an ordinary user account cannot <code>su</code> through SSH; for that, the user has to be in the <code>wheel</code>-group (thanks, [3]). You might as well do this while creating this new user like this:<br />
<a href="http://www.scienco.org/wp-content/freebsd-create-user.png"><img class="aligncenter" title="Create a FreeBSD user" src="http://www.scienco.org/wp-content/freebsd-create-user-300x166.png" alt="" width="300" height="166" /></a></p>
<p>Please be aware that FreeBSD is like Debian, not Ubuntu, in root/sudo regards. In Ubuntu you never login as root, you simply <code>sudo</code>. This approach is made to make it more secure for ordinary users. In FreeBSD and Debian you <code>su</code> to become root, do some administrative stuff, end then exit into the world of ordinary user privileges.</p>
<p>After the installation is done, you see the main menu again from where to do a standard installation. At this point eject the CD and reboot the system.</p>
<p>To install the <code>man</code>- and <code>info</code>-pages (thanks again, [3]), you should execute the following as root (either log in or <code>su</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sysinstall</pre></div></div>

<p>In this utility you choose "Configure" -&gt; "Distributions" -&gt; and select "man" and "info" by hitting space -&gt; "OK". Now you can just exit the sysinstall tool.</p>
<p>Well, now the installation is done! Let's see how to upgrade this bastard!</p>
<h3>How to use ports and upgrade the base system</h3>
<p>As mentioned earlier, I'm going to bet everything on ports!</p>
<p>When making system work, as we are going to do now, you must use <code>su</code> and not <code>sudo</code>! Please read [4] for an excellent review of how to use ports (you might as well wait to after reading my short recap of [4]). It may relevant for you to read [3], too. I'm now going to show one approach of getting and updating the ports tree, namely the <code>portsnap</code>-tool, and afterwards I'm going to show how to update the ports tree, how to install, upgrade, and remove new applications, and how to upgrade the binary base system.</p>
<p>Remember we chose the minimal installation, so we don't even got the ports collection (or tree as it's also called) yet.</p>
<p>First let's fetch the ports tree:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portsnap fetch
portsnap extract</pre></div></div>

<p>Or simply</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portsnap fetch extract</pre></div></div>

<p>In the daily administration we don't want to extract it, because we've already got the tree. Instead we want to update it. Therefore you're only going to issue the extract-part right after installation, and after that you need only to execute this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portsnap fetch update</pre></div></div>

<p>And now your ports tree (recall that it's source code for a lot of programs you are able to install) is up to date! But what about the programs from the ports tree you've already installed? They are not updated by the <code>portsnap</code>-command. But before going through that, let's first install a new program. The <code>lsof</code> (list open files) is used in the example in [4] and I'm going to use it here, too. Well, ports are located in <code>/etc/ports</code> - but it's a directory system based on categories, so first we will need to find the source directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">whereis</span> lsof</pre></div></div>

<p>Wonderful - navigate to this directory and let's install it. Assuming you are in the directory returned by the <code>whereis</code>-command, just execute:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>This will compile the program, but don't install it. The binaries are in the same directory - nothing has been copied! So lets copy the binaries:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>And now you are able to run the program (you might need to log in and out if it doesn't work straightaway):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">lsof</pre></div></div>

<p>Because compiling takes up a lot of workspace with temporary files, we clean up afterwards:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> clean</pre></div></div>

<p>Well, nerds are lazy, so an abbreviation of <code>make</code>, <code>make install</code>, and <code>make clean</code> is this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>

<p>I would recommend sticking to this command so that you remember to <code>make clean</code>. There is a but in this regard: dependencies require the make-files, so if you always clean up, compilation will take longer since the whole dependency tree has to be build, too. So please consider this before cleaning up. This is basically the way to install new applications. It's really not that hard! During compilation, errors may arise. It's important that you don't just think they are irrelevant. They might be crucial.</p>
<p>One of the benefits with <code>apt-get</code> is both it's good at cleaning up and resolving dependency issues. The cleaning up part when removing programs is in both cases with <code>apt-get</code> and ports based on the fact that the maintainer of the program has specified which files are copied when issuing the <code>apt-get install</code> or <code>make install</code>, so that they all can be delete when removing the program. Because of this there's no reason why apt-get should clean up in a better way than the ports' way of doing it. Well, we'll get back to that shortly. Let's first upgrade the <code>lsof</code>. As mentioned in [4], you should read <code>/usr/ports/UPDATING</code> before every update because it describes issues in regards to upgrading certain ports.</p>
<p>Basically there are three different tools to upgrade ports with: <code>portupgrade</code>, <code>portmanager</code>, and <code>portmaster</code>. <code>portmaster</code> does not depend on any other ports, only programs in the base system [4] - that I like! In addition it seems like a reasonable way it handles dependencies (so <code>apt-get</code> gets real competition at this point, too!). So that's the tool I'll use - feel free to choose another. Please refer to "4.5.4.4 Upgrading Ports using Portmaster" in [4] to see how update is done. It's straightforward! And I like the part that it's able to install ports, too (as I said, read [4] - important facts is reveal themselves by reading documentation!). </p>
<p>If you haven't read "4.5.4.4 Upgrading Ports using Portmaster" in [4], you might have difficulties understanding the next part. For a cronjob I'd recommend to update the ports tree (but only the index file - please read on) and mail the <code>portmaster -L</code> output to yourself. Something like a cronjob like (edit the <code>/etc/cronjob</code> - and maybe configure the <code>mail</code> more properly):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> root portsnap <span style="color: #660033;">-I</span> cron update <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> portmaster <span style="color: #660033;">-L</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Available updates&quot;</span> your<span style="color: #000000; font-weight: bold;">@</span>host.tld</pre></div></div>

<p>The -I option tells the <code>portsnap</code> to update the index only and not the ports tree itself, and only be used with the update command. In this way it's possible to find out which ports needs to be upgraded without destroying/overwriting your current ports tree. The cron command is like fetch, but it starts by sleeping for a random period of time before making the fetch - this way it's avoided that several machines perform the fetch simultaneously. And update is like before (but remember the -I option). Well, you did of course read the --help and man, so you already knew this, right?</p>
<p>To remove a port you just type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pkg_remove</pre></div></div>

<p>It's actually the same way as remove a package. Well done, FreeBSD!</p>
<p>To update the FreeBSD binary base system, simply use the tool <code>freebsd-update</code>. To get available updates:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update fetch</pre></div></div>

<p>And to apply those:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">freebsd-update <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>So in FreeBSD the ports and the system is updated separately. Actually I like this approach. My fear of ports and keeping FreeBSD updated has almost gone away!</p>
<h3>General impression of FreeBSD</h3>
<p>That I cannot give you after this short term of usage, but I must say that I really like the rocks on which FreeBSD is build! I like the ideas, principles etc., and I'm really looking forward to play with it in the near future! And I have to mention their great documentation, see [5] (I've used a part of it, [4], a bit, but there's a lot of great documentation)! Normally I use Google, but when dealing with FreeBSD I consult the documentation as the first thing. That's actually rather comfortable!</p>
<p>I was bit nervous about maintaining a FreeBSD-system based on ports, that fear is completely gone! Actually the tools like <code>portsnap</code> and <code>portmaster</code> have made me really confident about the whole concept of ports. But when so many people use FreeBSD, FreeBSD must - after all - do something right!</p>
<p>When it all comes down to choose between Ubuntu and FreeBSD, I have a hard time recommending one on behalf of the other. FreeBSD seems to do everything right, reliable and secure. No easy solutions. And the documentation is great! I like the whole architecture. So what's the drawback compared to Ubuntu? Well, you have to work a little harder to make it as user-friendly: install bash etc. But on the other hand - I'm going to use it for a reliable server. So Ubuntu is easy and great with a lot of reasonable standard choices, but compared to FreeBSD, at some points it seems like Ubuntu not that idealistic, e.g. about placing configuration files consistent.</p>
<p>So what am I going to do? I think it's time for me to try FreeBSD for real!</p>
<h3>Sources</h3>
<p>[1]: <a href="http://en.wikipedia.org/wiki/FreeBSD">http://en.wikipedia.org/wiki/FreeBSD</a><br />
[2]: <a href="http://www.freebsd.org/doc/en/books/handbook/linuxemu.html">http://www.freebsd.org/doc/en/books/handbook/linuxemu.html</a><br />
[3]: <a href="http://www.afterschool.dk/documents/freebsd/freebsd-7-0-install/">http://www.afterschool.dk/documents/freebsd/freebsd-7-0-install/</a><br />
[4]: <a href="http://www.freebsd.org/doc/en/books/handbook/ports-using.html">http://www.freebsd.org/doc/en/books/handbook/ports-using.html</a><br />
[5]: <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scienco.org/2008/installing-freebsd-7-from-the-view-of-a-debian-user/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

