一、执行brew link pkg-config
返回结果Linking /usr/local/Cellar/pkg-config/0.29.1_2...
Error: Could not symlink bin/pkg-config
Target /usr/local/bin/pkg-config
already exists. You may want to remove it:
rm '/usr/local/bin/pkg-config'
To force the link and overwrite all conflicting files:
brew link --overwrite pkg-config
To list all files that would be deleted:
brew link --overwrite --dry-run pkg-config
二、移除
移除rm /usr/local/bin/pkg-config
继续执行brew link pkg-config
返回结果Could not symlink share/aclocal/pkg.m4
Target /usr/local/share/aclocal/pkg.m4
already exists. You may want to remove it:
rm '/usr/local/share/aclocal/pkg.m4'
To force the link and overwrite all conflicting files:
brew link --overwrite pkg-config
To list all files that would be deleted:
brew link --overwrite --dry-run pkg-config
三、继续移除
移除 rm /usr/local/share/aclocal/pkg.m4
继续执行brew link pkg-config
返回结果Linking /usr/local/Cellar/pkg-config/0.29.1_2...
Error: Could not symlink share/doc/pkg-config/pkg-config-guide.html
Target /usr/local/share/doc/pkg-config/pkg-config-guide.html
already exists. You may want to remove it:
rm '/usr/local/share/doc/pkg-config/pkg-config-guide.html'
To force the link and overwrite all conflicting files:
brew link --overwrite pkg-config
To list all files that would be deleted:
brew link --overwrite --dry-run pkg-config
四、依然移除
移除 rm /usr/local/share/doc/pkg-config/pkg-config-guide.html
会要求输入密码
继续执行brew link pkg-config
返回结果Linking /usr/local/Cellar/pkg-config/0.29.1_2...
Error: Could not symlink share/doc/pkg-config/pkg-config-guide.html
/usr/local/share/doc/pkg-config is not writable.
五、创建pkg-config
在/usr/local/share/doc/创建pkg-config
继续执行brew link pkg-config
返回结果Linking /usr/local/Cellar/pkg-config/0.29.1_2...
Error: Could not symlink share/man/man1/pkg-config.1
Target /usr/local/share/man/man1/pkg-config.1
already exists. You may want to remove it:
rm '/usr/local/share/man/man1/pkg-config.1'
To force the link and overwrite all conflicting files:
brew link --overwrite pkg-config
To list all files that would be deleted:
brew link --overwrite --dry-run pkg-config
六、删删删
移除 rm /usr/local/share/man/man1/pkg-config.1
会要求输入密码
继续执行brew link pkg-config
执行结果Linking /usr/local/Cellar/pkg-config/0.29.1_2... 4 symlinks created
终于成功啦~~~~