Error: Operation already in progress for pkg-config

Error: /Stage[main]/Main/Node[default]/Package[openssl]/ensure: change from absent to present failed: Execution of 'brew install openssl --appdir=/Applications --force' returned 1: Error: Operation already in progress for pkg-config

Another active Homebrew process is already using pkg-config.

Please wait for it to finish or terminate it to continue.

Here is the solution.

rm $(brew --cache)/Formula/*