Re: Some simple/basic things that do not work during or after "pkg delete -a" in a PkgBase based chroot

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sun, 11 May 2025 22:41:16 UTC
On May 11, 2025, at 15:09, Mark Millard <marklmi@yahoo.com> wrote:

> Inside a PkgBase based chroot I did:
> 
> # pkg delete -a 2>&1 | tee ~/pkg-del-a.txt
> 
> After that pkg (dynamic) no longer works:
> 
> # pkg info pkg
> ld-elf.so.1: Shared object "libarchive.so.7" not found, required by "pkg"
> 
> By contrast, "pkg-static info pkg" still works. But
> any scripting that uses pkg instead of pkg-static
> would be broken for the pkg usage.
> 
> Also, when I tried to summarize some error
> messages, I found uniq was not present:
> 
> # grep "cannot open" ~/pkg-del-a.txt | sort | uniq -c
> /bin/sh: uniq: not found
> 
> Nor was wc :
> 
> # grep "cannot open" ~/pkg-del-a.txt | sort | wc -l
> /bin/sh: wc: not found
> 
> (I can not tell what is expected vs. what is not.
> So some of the above may well be considered normal
> and might end up documented to some degree or in
> some way.)
> 
> 
> During the delete (POST-DEINSTALL notice summary):
> 
> Note: I'd only had a few hundred packages installed,
> so the variety tested is rather limited.
> 
> Of note: the port packages were not deleted before the
> PkgBase system packages were. This ordering seems
> problematical to me.
> 
> # grep -B1 "POST-DEINSTALL" ~/pkg-del-a.txt | sort -u
> --
> .: cannot open /etc/rc.subr: No such file or directory
> pkg: POST-DEINSTALL script failed
> 
> 
> Done from outside the chroot to get an idea of the
> counts:
> 
> # grep -B1 "POST-DEINSTALL" /usr/obj/DESTDIRs/main-armv7-chroot-ports-main-dup/root/pkg-del-a.txt | sort | uniq -c
>  87 --
>  88 .: cannot open /etc/rc.subr: No such file or directory
>  88 pkg: POST-DEINSTALL script failed
> 

Looks like there is some more related to
even pkg-static operation with official
package distriubtion by FreeBSD (shown
from inside the chroot after the delete
-a):

# ls -loaT /etc/pkg/
ls: /etc/pkg/: No such file or directory

So: No FreeBSD repository.

(I had not created/populated a
/usr/local/etc/pkg/repos/ so that was untested.)


poudriere/poudriere-devel side note (mostly):

# ls -loaT /usr/local/etc/poud*
ls: /usr/local/etc/poud*: No such file or directory

# ls -loaT /usr/local/etc/
total 44
drwxr-xr-x  4 root  wheel -  1024 May 11 21:49:42 2025 .
drwxr-xr-x  9 root  wheel -   512 May 11 21:49:42 2025 ..
drwxr-xr-x  2 root  wheel -   512 May 11 21:49:40 2025 bash_completion.d
-rw-r--r--  1 root  wheel -   813 Apr 22 21:11:28 2025 mke2fs.conf
drwxr-xr-x  5 root  wheel -   512 May 11 05:00:15 2025 periodic
-rw-r--r--  1 root  wheel -  2553 Apr 22 06:00:03 2025 pkg.conf
-rw-r--r--  1 root  wheel -  2553 Apr 22 06:00:03 2025 pkg.conf.sample
-rw-r-----  1 cyrus mail  - 16384 May 11 05:12:38 2025 sasldb2.db

Note: What I started with had:

# ls -loaT /etc/pkg/ /usr/local/etc/poud*
-rw-r--r--  1 root wheel - 15545 Apr 27 07:28:10 2025 /usr/local/etc/poudriere.conf
-rw-r--r--  1 root wheel - 15545 Apr 27 07:28:10 2025 /usr/local/etc/poudriere.conf.sample
-rw-r--r--  1 root wheel -   655 Apr 27 07:28:10 2025 /usr/local/etc/poudriered.conf
-rw-r--r--  1 root wheel -   655 Apr 27 07:28:10 2025 /usr/local/etc/poudriered.conf.sample

/etc/pkg/:
total 12
drwxr-xr-x   2 root wheel -  512 May 11 04:44:41 2025 .
drwxr-xr-x  23 root wheel - 2048 May 11 05:14:39 2025 ..
-rw-r--r--   1 root wheel -  424 May 11 04:49:51 2025 FreeBSD.conf

/usr/local/etc/poudriere.d:
total 12
drwxr-xr-x   3 root wheel -  512 May 11 05:13:23 2025 .
drwxr-xr-x  18 root wheel - 1024 May 11 05:16:22 2025 ..
drwxr-xr-x   2 root wheel -  512 May 11 05:13:23 2025 hooks

None of that survived.


===
Mark Millard
marklmi at yahoo.com