Rhyous

November 3, 2009

What are the first commands I run after installing FreeBSD? Or How to patch FreeBSD? Or How to install ports on FreeBSD?

Filed under: FreeBSD — J. Abram barneck @ 11:33 pm
Tags:

Ok, so you just installed FreeBSD, an maybe you are not familiar with it, so you think, “What now?”.

Well, think about what you do when you install any platform. You do three things:

  1. Apply patches/updates.
  2. Install software
  3. Post-installation configuration of system and software

For example, when you install a new windows operating system, it is common to go to Windows Update and update your server. Then you install software such as microsoft office, etc… The same for servers. You update the server, then maybe you add your server software. Then you configure it some more.

The order may vary for every install or you may even do this three step process multiple times.

Just because you are on FreeBSD does not mean the same three step process doesn’t apply. This three item process is operating system independent. It is the first thing I do on FreeBSD as well.

So here are the first commands that I run after logging into a new FreeBSD install.

$ su

Password:

ServerName#
ServerName#
ServerName#
ServerName#
freebsd-update fetch
freebsd-update install
portsnap fetch
portsnap extract

Same commands in a nice script/code box you can use to copy and paste.

freebsd-update fetch
freebsd-update install
portsnap fetch
portsnap extract

Let me explain what each command does:

  1. freebsd-update fetch – This download patches that have been released for the version of FreeBSD you have installed. It does not install the patches.
  2. freebsd-update install – This command installs the patches that were previously download.
  3. portsnap fetch – This download a compressed version of the ports tree. Ports means applications that have been ported or developed to compile and run on FreeBSD. So the ports tree is basically a database of available software that can be install on FreeBSD.
  4. portsnap extract – This extracts the compressed version of the ports tree.

So with these four commands you have your system updated/patched. You also have all the software that is available ready to be installed.

Update 1:

I am not sure why i didn’t know this before, but you can combine each pair of commands into one command:

ServerName#
ServerName#
freebsd-update fetch install
portsnap fetch extract
freebsd-update fetch install
portsnap fetch extract

Stay tuned for my article on searching the ports tree.

Update 2:

As you can read in the comments, it is good to know that you only have to “extract” the ports tree once and for every subsequent update to the ports tree, you should only run it with the “update” command as shown.

portsnap fetch update

Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

Advertisements

24 Comments »

  1. […] Now check out my post about the updating FreeBSD. What are the first commands I run after installing FreeBSD […]

    Pingback by How do I install FreeBSD? « Rhyous's 127.0.0.1 or ::1 — November 4, 2009 @ 9:44 pm | Reply

  2. […] Update FreeBSD and download the ports tree. What are the first commands I run after installing FreeBSD […]

    Pingback by How to install subversion 1.6.6 on FreeBSD 7.2 « Rhyous's 127.0.0.1 or ::1 — November 7, 2009 @ 1:47 pm | Reply

  3. […] Update FreeBSD and download the ports tree. What are the first commands I run after installing FreeBSD […]

    Pingback by How to install subversion 1.6.6 on FreeBSD 7.2 « Rhyous's 127.0.0.1 or ::1 — November 7, 2009 @ 1:47 pm | Reply

  4. […] Update FreeBSD and download the ports tree. What are the first commands I run after installing FreeBSD […]

    Pingback by How to configure Subversion to use Cyrus-SASL2 to authenticate to a MySQL database? « Rhyous's 127.0.0.1 or ::1 — November 10, 2009 @ 9:29 am | Reply

  5. […] Update FreeBSD and download the ports tree. What are the first commands I run after installing FreeBSD […]

    Pingback by How to install dotProject 2.1.2 on FreeBSD 7.2 with Apache 2.2, PHP5, and MySQL 5.1 Server? « Rhyous's 127.0.0.1 or ::1 — November 23, 2009 @ 6:20 pm | Reply

  6. […] 3 – Patch your new system Update and patch your system. I already have steps to do this here: What are the first commands I run after installing FreeBSD Important: While the ports tree is already installed, don’t skip this step. Updating the […]

    Pingback by How to install and configure a FreeBSD 8 Desktop with Xorg and KDE? « Rhyous's 127.0.0.1 or ::1 — December 18, 2009 @ 11:02 pm | Reply

  7. well this is the best I have seen … you are just a STAR

    portsnap fetch extract … is not so good … concider this portsnap fetch update …

    `portsnap fetch update` — this is much faster than `portsnap fetch extract` because it avoids extracting directories which haven’t changed.

    Comment by Wayne — December 27, 2009 @ 4:23 am | Reply

  8. on new installations you need to run portsnap fetch extract … there after the portsnap fetch update command will be good

    Comment by Wayne — December 27, 2009 @ 4:28 am | Reply

  9. […] Step 1 – Make sure you have ports installed and updated I already have a post on this. It is pretty short. Check it out here. How to install ports on FreeBSD? […]

    Pingback by How to update all your installed ports on FreeBSD using portupgrade? « Rhyous's 127.0.0.1 or ::1 — February 12, 2010 @ 12:14 am | Reply

  10. […] Step 1 – Make sure you have ports installed and updated I already have a post on this. It is pretty short. Check it out here. How to install ports on FreeBSD? […]

    Pingback by How to update all your installed ports on FreeBSD using portupgrade? « Rhyous's 127.0.0.1 or ::1 — February 12, 2010 @ 12:14 am | Reply

  11. First off – THANK YOU – thank you so much for putting this guide together. very helpful. I am installing freebsd on esx using your guide and I’m just happy the networking and updates are working.

    I found a few items that you may want to correct or change… You say the following:

    IR – when I copy and paste I get numbers in front of each line like so…
    Same commands in a nice script/code box you can use to copy and paste.
    1
    freebsd-update fetch
    2
    freebsd-update install
    3
    portsnap fetch
    4
    portsnap extract

    IR – I think this is a typo. You don’t mean that these two commands do the same thing, right? The commands seem pretty self-explanatory to me but your explanation leaves me wondering…

    Let me explain what each command does:
    freebsd-update fetch – This download patches that have been released for the version of FreeBSD you have installed. It does not install the patches.
    freebsd-update install – This download patches that have been released for the version of FreeBSD you have installed. It does not install the patches.

    I guess a one page how to guide on installing freebsd vm on esx would be pretty long, ehh?

    I b e n

    Comment by Iben Rodriguez — February 21, 2010 @ 9:59 pm | Reply

    • WordPress allows you to click a copy button or a display in editor button on the left. If you high-light and copy, you are correct, you will get numbers.

      Yes, I must have copied and pasted and not updated that line, because they of course do not do the same thing. I should update this.

      I haven’t used ESX but I do most my testing in VMWare Workstation. The VMWare tools are mostly for X installed. Click on FreeBSD Friday on the right and you should see a few articles on installing Xorg and KDE and installing VMWare tools.

      Comment by rhyous — February 22, 2010 @ 7:36 am | Reply

  12. echo > /etc/motd

    Comment by uminac — July 12, 2010 @ 8:22 pm | Reply

  13. […] What are the first commands I run after installing FreeBSD […]

    Pingback by Installing and Using Postgresql on FreeBSD « Rhyous's 127.0.0.1 or ::1 — August 27, 2010 @ 11:24 pm | Reply

  14. […] Download the latest ports tree. See this article: How to install ports on FreeBSD? […]

    Pingback by Making a package from a port on FreeBSD « Rhyous's 127.0.0.1 or ::1 — November 12, 2010 @ 6:49 am | Reply

  15. […] 3 – Patch your new system Update and patch your system. I already have steps to do this here: What are the first commands I run after installing FreeBSD Important: While the ports tree is already installed, don’t skip this step. Updating the […]

    Pingback by Rhyous » Blog Archive » How to install and configure a FreeBSD 8 Desktop with Xorg and KDE? — February 13, 2011 @ 3:23 pm | Reply

  16. […] Install ports on your system as follows: How to install ports on FreeBSD? […]

    Pingback by Rhyous » Blog Archive » Getting Java to work in Firefox 3.6 in PC-BSD 8.2 — March 17, 2011 @ 1:43 pm | Reply

  17. […] Update FreeBSD and download the ports tree. What are the first commands I run after installing FreeBSD […]

    Pingback by Rhyous » Blog Archive » How to install Bugzilla on a FreeBSD 7.2 with Apache + SSL and MySQL? — April 18, 2011 @ 10:31 pm | Reply

  18. have a big problem using the comand´

    -portsnap fetch extrac

    my system got stock at 52% of the download and did not do anything after that
    have the next words on screen

    66871b76452e32d3e5773efae757cfdfa1b7e2b546e5c3 52% of 64 MB 4617 Bps 01h56m

    could help me with this…?

    Comment by Lizeth — November 5, 2011 @ 1:35 pm | Reply

  19. […] Second update FreeBSD and install the ports tree. Instructions for this are in this article. What are the first commands I run after installing FreeBSD? […]

    Pingback by Installing an Apache + SSL on FreeBSD using the ports tree | Rhyous — January 20, 2012 @ 3:43 pm | Reply

  20. […] Second update FreeBSD and install the ports tree. Instructions for this are in this article. What are the first commands I run after installing FreeBSD? […]

    Pingback by How to install PHP5 and PHP5 Extensions on FreeBSD? | Rhyous — January 22, 2012 @ 1:14 pm | Reply

  21. […] Second update FreeBSD and install the ports tree. Instructions for this are in this article. What are the first commands I run after installing FreeBSD? […]

    Pingback by How to install MySQL on FreeBSD | Rhyous — January 23, 2012 @ 5:31 am | Reply

  22. […] What are the first commands I run after installing FreeBSD […]

    Pingback by Installing and Using Postgresql on FreeBSD | Rhyous — April 13, 2012 @ 4:09 pm | Reply

  23. […] Download the latest ports tree. See this article: How to install ports on FreeBSD? […]

    Pingback by Making a package from a port on FreeBSD | Rhyous — April 18, 2012 @ 3:26 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: