pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Fail to install base packages. Memory exhausting.

Open ant5 opened this issue 5 months ago • 7 comments

Recently I tried to install FreeBSD on baremetal. I've got recent 14.3 LiveUSB stick with own basepackages (builded from 14-STABLE via make packages). On bare-metal server I booted from LiveUSB then go to live system. Then I prepared server's disk, mount it

Image

and run something like pkg -r /mnt -o IGNORE_OSVERSION=yes add /media/basepkgs/FreeBSD:14:amd64/14.snap20250717082520/FreeBSD-at-14.snap20250717082520.pkg

Then I have long time of running strings:

Image

Examining this process shows that pkg eat all memory and after all memory exhausted killed by system.

I was doing such a things on virtual machine with pkg 1.21 and that was fine.

ant5 avatar Jul 18 '25 08:07 ant5

pkg version 2.0.5 is unaffected.

ant5 avatar Jul 18 '25 09:07 ant5

why are you using pkg add instead of pkg install ?

bapt avatar Jul 21 '25 12:07 bapt

Because I use packages stored in a local media.

ant5 avatar Jul 22 '25 08:07 ant5

  • https://github.com/freebsd/pkg/issues/2478#issue-3242339655

LiveUSB stick

Try:

sysctl vm.pageout_oom_seq=120

grahamperrin avatar Aug 31 '25 18:08 grahamperrin

. . .

Try:

sysctl vm.pageout_oom_seq=120

An earlier screen shot shows evidence of an unbound recursion. vm.pageout_oom_seq will do no good in such cases.

markmi avatar Sep 07 '25 16:09 markmi

Because I use packages stored in a local media.

Normal repositories can be on local media and handled in normal upgrade and install ways. For example I use:

# cat /usr/local/etc/pkg/repos/main-ZNV4-default.conf
main-ZNV4-default: {
        url: "file:///usr/local/poudriere/data/packages/main-ZNV4-default",
        enabled: yes,
}

I use commands like:

# pkg upgrade -rmain-ZNV4-default
# pkg install -rmain-ZNV4-default     `cat ~/origins/amd64-pkgs.txt`

markmi avatar Sep 07 '25 16:09 markmi

My command was:

pkg -r /mnt -o IGNORE_OSVERSION=yes add /media/basepkgs/FreeBSD:14:amd64/14.snap20250717082520/FreeBSD-at-14.snap20250717082520.pkg

It failed same way with any base package I try. So no "FreeBSD-at" specific. Pkg 2.05 do things well invoked by the same command.

ant5 avatar Sep 09 '25 13:09 ant5