Pkg_add not working properly



  • hey. i've run into problems installing packages through pkg_add on my embedded board (alix w/ 256mb ram).
    in specific, there seems to be a lack of free space on /var
    i've solved this for now by simply disabling write protection, then creating a directory /1 on the root partition (enough space there) and then creating a symbolic link

    /etc/rc.conf_mount_rw
    mkdir /1
    ln -s /1 /var/tmp
    

    after the installations were done i simply removed /1 and the symbolic link i created.

    packages i needed to install were: wget, nano and syslog-ng - which also lead to the installation of perl and python among some others.
    python and perl by themselves gave me some sort of  "not enough space" msg.

    pkg_add -r python
    

    i realize my solution ain't pretty but it worked for the time being.
    if someone knows another workaround, please post here - i'd be interested.

    –---------------------

    uname -a
    FreeBSD demo.pfsense 8.3-RC2 FreeBSD 8.3-RC2 #0: Sat Apr  7 21:57:20 EDT 2012     root@FreeBSD_8.3_pfSense_2.1.snaps.pfsense.org:/usr/obj./usr/pfSensesrc/src/sys/pfSense_wrap.8.i386  i386
    
    

  • Netgate Administrator

    Just FYI, you can use fetch and ee instead of wget and nano. They are already installed.

    Steve


  • Rebel Alliance Developer Netgate

    When we add packages on NanoBSD for gitsync or the package system, we do a little dance to make sure it works properly and doesn't run /var out of space:

    Here is the snippet from gitsync to load git:

    
            echo "Cannot find git, fetching...";
            if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) {
                    $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ ";
                    $pkgstagingdir = "/root/tmp";
                    if (!is_dir($pkgstagingdir))
                            mkdir($pkgstagingdir);
                    $pkgstaging = "-t {$pkgstagingdir}/instmp.XXXXXX";
            }
            system("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -r git");
    
    

    By setting PKG_TMPDIR and passing a staging directory, it will process things in another place.


  • Rebel Alliance Developer Netgate

    @stephenw10:

    Just FYI, you can use fetch and ee instead of wget and nano. They are already installed.

    ^ that too.



  • I'm just used to nano + wget … they're not that important anyway since i won't be needing them on a production system anyway.

    So setting that variable I still also need to make sure the directory I have it point to is not read-only, I guess. Thanks for the info though. I remember using pkg_add with no problems on prior versions of pfsense (1.2 I think).


  • Rebel Alliance Developer Netgate

    Not on embedded you wouldn't have. On a full install it always works fine. :-)


Log in to reply