0

Due to an error made when partitioning the system disk of my OpenBSD box, I'm running out of space on /usr now.

openbsd$ df
Filesystem  512-blocks      Used     Avail Capacity  Mounted on
/dev/sd0a      2057756    141352   1813520     7%    /
/dev/sd0k     30699004     66384  29097672     0%    /home
/dev/sd0d      5202236    746020   4196108    15%    /tmp
/dev/sd0f      4122108   3002484    913520    77%    /usr
/dev/sd0g      2057756    387016   1567856    20%    /usr/X11R6
/dev/sd0h     11366780    552236  10246208     5%    /usr/local
/dev/sd0j     12379516         4  11760540     0%    /usr/obj
/dev/sd0i      3857212   2060552   1603800    56%    /usr/src
/dev/sd0e      8218940     67776   7740220     1%    /var

I was trying to install a higher version of GCC, only to get a No space left on device error.

openbsd$ cd /usr/ports/lang/gcc/6
openbsd$ doas make install
{{ ... thouands of lines omitted for brevity ... }}
tar: Unable to create gcc-6.4.0/install-sh: No space left on device
tar: Unable to create gcc-6.4.0/ylwrap: No space left on device
tar: Unable to create gcc-6.4.0/LAST_UPDATED: No space left on device
tar: Unable to create gcc-6.4.0/NEWS: No space left on device
tar: Unable to create gcc-6.4.0/MD5SUMS: No space left on device
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2555 'do-extract': @PATH=/usr/ports/pobj/gcc-6.4.0/bin:/usr/bin:/bin:/usr/sbin:/s...)
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2528 '/usr/ports/pobj/gcc-6.4.0/.extract_done')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2003 '/usr/ports/packages/amd64/all/gcc-6.4.0p0.tgz')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2465 '_internal-package')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2444 'package')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2021 '/var/db/pkg/gcc-6.4.0p0/+CONTENTS')
*** Error 1 in /usr/ports/lang/gcc/6 (/usr/ports/infrastructure/mk/bsd.port.mk:2444 'install')

Is it possible to build the object files to another directory, so that it doesn't take a lot of space in /usr/ports? I've tried something like cd /tmp/build && make -C /usr/ports/lang/gcc/6 install, but the intermediate files are still generated in the directory in which Makefile resides.

3

You may set the variable WRKOBJDIR to a directory where the build should take place. This variable is described in bsd.port.mk(5).

You may, for example, use

cd /usr/ports/lang/gcc/6
doas env WKOBJDIR=/tmp/build make install

or set the variable in /etc/mk.conf if you always want to compile ports in a different place from /usr/ports/pobj.

Also be aware that the lang/gcc/6 port was removed from the ports tree today (2019-04-25) as it was obsoleted by GCC 8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.