加载 /home/user/.profile 时发现错误:

加载 /home/user/.profile 时发现错误:

之前,我需要安装homebrew。我打开终端并执行命令。但是,它花费的时间太长,而且数据限制也不够。所以我在终端中中断了执行。当我重新启动系统时,我收到以下警告

/home/user/.profile: line 28 /bin/brew: No such file or directory
/home/user/.profile: line 29 /bin/brew: No such file or directory
/home/user/.profile: line 30 /bin/brew: No such file or directory
/home/user/.profile: line 31 /bin/brew: No such file or directory
/home/user/.profile: line 32 /bin/brew: No such file or directory

As a result the session will not be configured correctly.
You should fix the problem as soon as feasible

我不知道该如何解决这个问题。请提出一些建议。

当我执行时grep -i mesg .profile我什么也没得到。因为grep -i mesg .bash*我得到了.bash_history:grep -i mesg

系统运行一切正常,每次开机都会弹出警告,但是我的 openweather gnome 扩展无法使用。

编辑:grep -i brew .profile 给予

eval $(/bin/brew shellenv)
eval $(/bin/brew shellenv)
eval $(/bin/brew shellenv)
eval $(/bin/brew shellenv)
grep -i brew .bash*

给出

.bash_history:test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
.bash_history:test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
.bash_history:test -r ~/.profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
.bash_history:test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
.bash_history:test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenasasasasasasav)
.bash_history:test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
.bash_history:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
.bash_history:/bin/bash -c "$(sudo -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
.bash_history:/bin/bash -c "$(sudo wget -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
.bash_history:/bin/bash -c "$(sudo wget  https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
.bash_history:brew instal bf
.bash_history:test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
.bash_history:test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
.bash_history:test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
.bash_history:echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
.bash_history:test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
.bash_history:test -r ~/.profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
.bash_history:/usr/local/bin/brew doctor
.bash_history:/usr/local/bin/brew
.bash_history:sh -c "$(curl -fsSL https://raw.gtihubusercontent.com/linuxbrew/install/master/install.sh)"
.bash_history:sh -c "$(curl -fsSL https://raw.gtihubusercontent.com/linuxbrew/install/master/install.sh)"
.bash_history:sh -c "$(curl -fsSL https://raw.githubusercontent.com/linuxbrew/install/master/install.sh)"
.bash_history:sh -c "$(curl -fsSL https://raw.githubusercontent.com/linuxbrew/install/master/install.sh)"
.bash_history:Command 'brew' not found, did you mean:
.bash_history:test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
.bash_history:echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile

答案1

编辑配置文件~/.profile。从文本编辑器中打开它,或使用终端命令打开编辑器并输入文件:

gedit ~/.profile

然后,您可以删除指向未安装的二进制文件的行/bin/brew。除了删除之外,您现在还可以通过#在行前放置注释符号来停用它们。这样您就可以在需要时轻松地重新激活这些命令。

出现四次相同的行eval $(/bin/brew shellenv)可能是由于错误安装造成的,因此我会删除三次,只留下一次注释掉:

#eval $(/bin/brew shellenv)

完成这些更改后,保存文件并关闭编辑器。如果稍后您发现不再需要该行,您仍然可以将其完全删除。

相关内容