0%

Mac OS使用过程中遇到的问题

记录遇到的问题。

查看端口占用

1
2
3
4
5
netstat -an -p tcp
# 要等很久- -
sudo lsof -i -P | grep -i "LISTEN"

sudo netstat -an|grep "LISTEN"

homebrew

打开终端时出现compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask

问题

打开终端时有时候会出现

1
2
3
Last login: Fri Mar 19 18:44:46 on ttys004
compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask
compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask
修复方法
1
brew clenup

或者

手动修复这两个符号文件的链接地址。

来源:compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew #9602

metasploit

msfupdate

某次用msfupdate升级后出现以下错误

问题详情: expected file /opt/metasploit-framework/embedded/framework/lib/rex/time.rb to define constant Rex::Time, but didn’t (Zeitwerk::NameError) #14796

我的修复方法

1
2
msfremove
brew install metasploit-framework

1
2
3
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall

mactex

安装mactex后还是出现pdflatex not found.

重启终端。

1
2
$ which pdflatex
/Library/TeX/texbin/pdflatex