Mac installation software, error permission denied @ unlink_ internal

Problem 1.
On the MAC, I install Ansible with the following commands

# brew install Ansible

abnormal

Pouring gdbm-1.15.high_sierra.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ unlink_internal - /usr/local/bin/gdbm_dump
Error: Permission denied @ unlink_internal - /usr/local/bin/gdbm_dump

2. Solutions

# sudo chown -R $(whoami):admin /usr/local

# brew update

# brew link gdb

# brew install Ansible

Read More: