pkg reports 'advisory lock' error


Well-Known Member

Reaction score: 129
Messages: 389

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:


Good to know the base system does this for you!


Staff member

Reaction score: 8,741
Messages: 33,022

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

For example:
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

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.



Reaction score: 460
Messages: 1,213

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.