Skip to content
Justin SilverTECHNOLOGY, TRAVEL & EVERYTHING IN BETWEEN

Random

Fix pkg on FreeNAS 11.2

April 1, 2019

I upgraded to FreeNAS 11.2, and then was unable to run pkg with an error about being unable to find the local repo file.

pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No such file or directory


[root@freenas ~]# pkg install ca_root_nss
Updating local repository catalogue...
pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No such file or directory
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!

This can be fixed by editing the configuration files in /usr/local/etc/pkg/repos/, setting toggling the "enabled" parameter to "no" for local.conf and to "yes" for FreeBSD.conf.


sed 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf
sed 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf

You should now be able to install and update using pkg.

Conversation 16

KoenMay 14, 2019
This solved the issue for me too, but needed to change the yes/no with the text editor 'nano' nano /usr/local/etc/pkg/repos/local.conf nano /usr/local/etc/pkg/repos/FreeBSD.conf
HappyCactusMay 22, 2019
Yes, this indeed solves the issue, but on the new FreeNAS it isn't supposed to work this way. Additional packages should be used in Jails / iocages only. See this post: https://www.ixsystems.com/community/threads/new-in-freenas-unable-to-do-pkg-update.49672/#post-342411
Justin SilverMay 22, 2019
I was actually trying to install packages into a jail but it was failing because of the error above. I had to fix it outside the jail, but the packages were ultimately added to the jail, not the base system. Thanks!
ChrisJune 6, 2019
Thank you. Been struggling with getting python2 to install in a brand new jail. This instantly fixed my issue.
malcolmJuly 16, 2019
thank you, pkg wasn't working inside my jail, edited similar files, now it does. thank you
imronAugust 25, 2019
[EFAULT] Exception: CallError:[EFAULT] pkg error: - pkg-static: /var/db/pkg permissions (0777) too lax Please check your network occured, destroyed plex.
Justin SilverSeptember 3, 2019
Hi Imron - I think that this is a different error than I posted about. A quick search turned up this post which might be helpful though, good luck! https://www.ixsystems.com/community/threads/permissions-too-lax.72074/
Marcos FerreiraSeptember 25, 2019
This solved the issue for me too, but needed to change the yes/no with the text editor ‘nano’ nano /usr/local/etc/pkg/repos/local.conf nano /usr/local/etc/pkg/repos/FreeBSD.conf
Fictional HistorianFebruary 13, 2020
Thanks. I wanted to test the new FreeNAS reporting graphs and couldn't figure out how to peg the CPU until I used this to be able to install stress
RichieMay 26, 2020
Try the following two commands: [shell] sed -i -e 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf sed -i -e 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf [/shell]