pkg: Unable to open ports directory /usr/ports: No such file or directory

Matthew Seaman m.seaman at
Sat Jul 13 13:02:59 UTC 2013

On 13/07/2013 11:17, Leslie Jensen wrote:

> 2013-07-12 13:25, Leslie Jensen skrev:
>> When I run
>> portsnap fetch update
>> pkg version -vIL=
>> It returns
>> pkg: Unable to open ports directory /usr/ports: No such file or directory
>> The directory is there and I can list the contents.
>> What's going on?

> I get this as well
> gunzip: can't stat:
> files/30173a70f7852dc247fda74d2d4babaae21067417fc17e67dc388c9ec85a8e8a.gz:
> No such file or directory
> gunzip: can't stat:
> /var/db/portsnap/files/845df3602aa1742b771872ffbe945ee60e0c834ae1540ba0dab02f224cce56f5.gz:
> No such file or directory
> pkg: Unable to open ports directory /usr/ports: No such file or directory
> I'm a bit lost. Do I have to remove something for this command to succeed?

Let's look at the command line you're using:

    pkg version -vIL=

That -I means it's going to try and read the ports INDEX specifically --
ie. /usr/ports/INDEX

Does that file exist?  Does it have sensible contents?

Now, given your further comments, it seems something relatively
significant is wrong.  There's on obvious (but fairly easy to fix) thing
it might be.  Have you run out of space on any of your partitions?
What goes 'df -h' report?  Any real partition reporting 100% full is a
problem.  (Don't worry about synthetic filesystems like devfs reporting
100% usage: that's normal.)  If some filesystem is full, then you need
to either delete stuff, or move it onto a filesystem with more space.

You also seem to be having problems with portsnap(8) -- be aware there
was a problem reported recently.  See the thread on freebsd-ports at ...
subject 'Latest snapshot' starting with this message:

but to summarize several people saw the problem, and the cure was to
delete the files portsnap was using by 'rm -Rf /var/db/portsnap/files'
and then re-run 'portsnap fetch' and 'portsnap extract' -- warning: this
will wipe out everything you have in /usr/ports and download a complete
set of replacements.



Dr Matthew J Seaman MA, D.Phil.

JID: matthew at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 268 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list