Open Source update software in freebsd

Discussion in 'Software' started by brighty22, 21 Jan 2011.

  1. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    I've been happily running a FreeNAS box with PHP and MySQL, but it has dawned on me they've gone a while without any updates - simply because I don't know how to go about it. I'm familiar with linux and the command line etc. but am pretty new with FreeBSD. Can anyone give me a command that will show me what versions of each package (or are they ports?) I currently have installed? I've done some googling and believe it's something like "portversion -l", but would appreciate someone with a bit more experience confirming :)

    I followed a portion of this guide, starting at step 2 in the advanced section (about a third of the way down) to install the software when I built the machine - "pkg_add -r mysql50-server" and several of "pkg_add -r php5-xxx" for all the php extensions.

    Thanks for any help :thumb:
     
  2. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
    This page should tell you all you need to know about Ports in FreeBSD.

    http://www.freebsd.org/doc/handbook/ports-using.html

    The CVSUP method isn't as good IMO as the portsnap method, but that's down to preference.

    To upgrade installed ports, I'd recommend the ports-mgmt/portupgrade port. See section "4.5.4.2 Upgrading Ports using Portupgrade" in the above handbook link.
     
  3. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    thanks for the reply :) Although it seems I don't have portsnap... I only get 'command not found' errors. How do I fetch it?? All I can find are instructions for downloading the latest collection files...
     
  4. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    ooh hang on. in /var/db/pkg/ there are a load of folders beginning with 'php5-' and 'mysql-' that look like what I'm trying to update... does that change anything? There is no 'ports' or 'portsnap' folder within '/var/db/' or '/usr/'..
     
  5. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
    Ah okay in that case you will probably be better with portmaster.

    Try "pkg_add portmaster"?
     
  6. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    had to use -r, but thanks :)

    Code:
    bright2a-nas:~# pkg_add portmaster
    pkg_add: can't stat package file 'portmaster'
    bright2a-nas:~# pkg_add -r portmaster
    Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.3-release/Latest/portmaster.tbz... Done.
    but where's it downloaded to? I'm guessing some sort of 'make install' thing is required next..
     
  7. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
    Should be somewhere under /var/db/pkg I think?

    Oh - just noticed you're using FreeNAS. I've got several FreeBSD8 boxes, but I haven't used FreeNAS.
     
  8. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    freenas is bsd.. essentially :) and what you've said works so far...


    Code:
    bright2a-nas:/var/db/pkg/portmaster-2.19# install
    usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
                   [-o owner] file1 file2
           install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
                   [-o owner] file1 ... fileN directory
           install -d [-v] [-g group] [-m mode] [-o owner] directory ...
    bright2a-nas:/var/db/pkg/portmaster-2.19# cd ../
    bright2a-nas:/var/db/pkg# install -d portmaster-2.19
    bright2a-nas:/var/db/pkg# cd /
    bright2a-nas:/# portmaster
    /usr/local/sbin/portmaster: /usr/bin/make: Permission denied
    
    ===>>> The value of PORTSDIR cannot be empty
    ===>>> Aborting update
    
    bright2a-nas:/#
    any ideas?
     
  9. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
  10. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    all I'm getting is 'portsnap: command not found', 'pkg_version: command not found' etc. basically nothing is there. I didn't build it from source...

    don't worry about it... I'm completely out of my depth. thanks for all your help though :)
     
  11. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
    Hmm try pkg_add -r portsnap? Then portsnap fetch extract?
     
  12. brighty22

    brighty22 What's a Dremel?

    Joined:
    19 Aug 2010
    Posts:
    178
    Likes Received:
    5
    Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.3-release/Latest/portsnap.tbz: File unavailable (e.g., file not found, no access)
    pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.3-release/Latest/portsnap.tbz' by URL

    :rolleyes:
     
  13. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    6,088
    Likes Received:
    944
    Humbug.

    I'd suggest posting on FreeNAS' own forums about it tbh.
     

Share This Page