4

I've installed a freenas server on a new server which I try to host on my own. Then I created a volume (ZFS) over 3*5TB harddisks. Last I logged in via ssh as root and tried to pkg upgrade all packages. This wouldn't work:

[root@kfreenas] ~# pkg update
Updating local repository catalogue...
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


[root@kfreenas] ~# pkg upgrade
Updating local repository catalogue...
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
All repositories are up-to-date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date

Somewhere I read that I've to do first pkg2ng. This resulted in many lines like this:

...
pkg: fstat() failed for(/usr/local/include/X11/Xalloca.h): No such file or directory
pkg: fstat() failed for(/usr/local/include/X11/Xarch.h): No such file or directory
pkg: fstat() failed for(/usr/local/include/X11/Xatom.h): No such file or directory
pkg: fstat() failed for(/usr/local/include/X11/Xdefs.h): No such file or directory
...

BTW: pkg -vv:

[root@kfreenas] ~# pkg -vv
Version                 : 1.7.2
PKG_DBDIR = "/var/db/pkg";
PKG_CACHEDIR = "/var/cache/pkg";
PORTSDIR = "/usr/ports";
INDEXDIR = "";
INDEXFILE = "INDEX-10";
HANDLE_RC_SCRIPTS = false;
DEFAULT_ALWAYS_YES = false;
ASSUME_ALWAYS_YES = false;
REPOS_DIR [
    "/etc/pkg/",
    "/usr/local/etc/pkg/repos/",
]
PLIST_KEYWORDS_DIR = "";
SYSLOG = true;
ABI = "FreeBSD:10:amd64";
ALTABI = "freebsd:10:x86:64";
DEVELOPER_MODE = false;
VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2";
FETCH_RETRY = 3;
PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [
]
DEBUG_SCRIPTS = false;
PLUGINS_CONF_DIR = "/usr/local/etc/pkg/";
PERMISSIVE = false;
REPO_AUTOUPDATE = true;
NAMESERVER = "";
HTTP_USER_AGENT = "pkg/1.7.2";
EVENT_PIPE = "";
FETCH_TIMEOUT = 30;
UNSET_TIMESTAMP = false;
SSH_RESTRICT_DIR = "";
PKG_ENV {
}
PKG_SSH_ARGS = "";
DEBUG_LEVEL = 0;
ALIAS {
    all-depends = "query %dn-%dv";
    annotations = "info -A";
    build-depends = "info -qd";
    cinfo = "info -Cx";
    comment = "query -i \"%c\"";
    csearch = "search -Cx";
    desc = "query -i \"%e\"";
    download = "fetch";
    iinfo = "info -ix";
    isearch = "search -ix";
    prime-list = "query -e '%a = 0' '%n'";
    leaf = "query -e '%#r == 0' '%n-%v'";
    list = "info -ql";
    noauto = "query -e '%a == 0' '%n-%v'";
    options = "query -i \"%n - %Ok: %Ov\"";
    origin = "info -qo";
    provided-depends = "info -qb";
    raw = "info -R";
    required-depends = "info -qr";
    roptions = "rquery -i \"%n - %Ok: %Ov\"";
    shared-depends = "info -qB";
    show = "info -f -k";
    size = "info -sq";
}
CUDF_SOLVER = "";
SAT_SOLVER = "";
RUN_SCRIPTS = true;
CASE_SENSITIVE_MATCH = false;
LOCK_WAIT = 1;
LOCK_RETRIES = 5;
SQLITE_PROFILE = false;
WORKERS_COUNT = 0;
READ_LOCK = false;
PLIST_ACCEPT_DIRECTORIES = false;
IP_VERSION = 0;
AUTOMERGE = true;
VERSION_SOURCE = "";
CONSERVATIVE_UPGRADE = true;
PKG_CREATE_VERBOSE = false;
AUTOCLEAN = false;
DOT_FILE = "";
REPOSITORIES {
}
VALID_URL_SCHEME [
    "pkg+http",
    "pkg+https",
    "https",
    "http",
    "file",
    "ssh",
    "ftp",
    "ftps",
    "pkg+ssh",
    "pkg+ftp",
    "pkg+ftps",
]
ALLOW_BASE_SHLIBS = false;
WARN_SIZE_LIMIT = 1048576;


Repositories:
  local: { 
    url             : "file:///usr/ports/packages",
    enabled         : yes,
    priority        : 0
  }

1 Answer 1

10

You aren't really supposed to use the shell on the main FreeNAS host, and so the pkg repositories are disabled.

If you want a shell on the machine you should look at creating a Jail (like a lightweight virtual machine) and use that for shell access.

If you really want to use pkgon the main FreeNAS host and you're confident that you can clean up any mess you make, look in /usr/local/etc/pkg/repos/FreeBSD.conf. But personally I'd use a Jail.

Also, it's generally considered bad practise to enable root ssh on a system.

3
  • 2
    This answer is top hit for several related topic searches outside SE. Helped, thanks. Source or reference for the first sentence? Or what one is 'supposed' to use rather than pkg from the host?
    – Joel Reid
    Jan 16, 2018 at 16:45
  • if you encounter the same issue reported by OP while trying to install a package inside a jail, try disabling IP6 by adding ipv6_enable="NO" in rc.conf. That helped in my case since I don't have ipv6 DNS configured.
    – Y.H.
    Apr 1, 2020 at 18:08
  • @JoelReid apologies, I’ve looked on and off for a reference since you asked. I can’t find a written one, but I recall Kris Moore staying it multiple times on the BSDNow podcast. I’ve not tracked it down, but it would be on an episode between 2014 and 2017 - a long period I know, hence why I’ve not gone back through to listen…
    – forquare
    Apr 1, 2020 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .