![启动 Ubuntu 18.04.2 LTS 时出现错误](https://linux22.com/image/1066679/%E5%90%AF%E5%8A%A8%20Ubuntu%2018.04.2%20LTS%20%E6%97%B6%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF.png)
我最近切换到了 ubuntu,一直在努力添加软件包等。现在,启动时我总是遇到以下错误。
Error found when loading /home/usr/.profile:
/home/usr/.profile:line 29: E:: command not found
/home/usr/.profile:line 30: Try: command not found
As a result the session will not be configured correctly.
You should fix the problem as soon as feasible.
有任何可行的解决方案吗?提前致谢。
我的 .profile 文件如下所示,
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
eval $(E: Linuxbrew directory detected, but it seems broken.
Try to remove '/home/linuxbrew/.linuxbrew' and install again./bin/brew shellenv)
答案1
在terminal
...
gedit /home/usr/.profile
打开 gedit 首选项,并启用行号...
找到 29-30 行。
将 25-35 行复制到剪贴板。
在这里编辑您的问题,粘贴到剪贴板,选择粘贴的文本,点击{}图标使文本变得易于阅读。
我会看一下并提出修复建议。
更新#1:
删除.profile末尾的两行...
eval $(E: Linuxbrew directory detected, but it seems broken.
Try to remove '/home/linuxbrew/.linuxbrew' and install again./bin/brew shellenv)