pkg reports 'advisory lock' error

unitrunker

Well-Known Member

Reaction score: 102
Messages: 264

This was a small surprise the other evening. Typing 'pkg install some-thing' reported an error that an 'advisory lock' was held by another process. Checked the process list and found that cron was running a nightly housekeeping script on pkg. After a few minutes had passed, the cron job finished and I was able to resume installing / upgrading packages.

You can see the housekeeping scripts here:

/usr/local/etc/periodic/daily/411.pkg-backup
/usr/local/etc/periodic/daily/490.status-pkg-changes

Good to know the base system does this for you!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,302
Messages: 32,149

The daily security emails provide some useful package information. It runs at 3:01am.

For example:
Code:
Checking for packages with security vulnerabilities:
Fetching vuln.xml.bz2: .......... done
python36-3.6.8_2 is vulnerable:
python 3.6 -- multiple vulnerabilities
CVE: CVE-2019-9740
CVE: CVE-2019-9948
WWW: https://vuxml.FreeBSD.org/freebsd/18ed9650-a1d6-11e9-9b17-fcaa147e860e.html

1 problem(s) in 1 installed package(s) found.

Checking for packages with mismatched checksums:

-- End of security output --
It tells me I need to update my Python.
 

sidetone

Daemon

Reaction score: 451
Messages: 1,185

My periodic script was running pkg check, from /usr/local/etc/periodic/security/. I did doas ps ax | grep pkg.

I was compiling from ports using portmaster starting before 3am, and there was an error that occurred. When I tried to restart compiling, there was lock. Then, I looked at the time, past 3 am.

I thought the periodic script interrupted my portbuild at first, but the error was about a pkg conflict. And the lock from that build perhaps would prevent the periodic script from running, unless portmaster didn't hold that lock between building different ports.
 
Top