我在本页面搜索了类似的问题,但一无所获。我在 hp 工作站上使用 ubuntu 20.0。每次我使用$须藤苏并输入 root 密码后系统就卡住了。虽然当我使用$Ctrl+c它给了我 root 权限但也返回了一个错误(见下文)。我猜想这和系统配置有关。
^CTraceback (most recent call last):
File "/software/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/software/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 139, in main
from ..activate import main as activator_main
File "/software/anaconda3/lib/python3.8/site-packages/conda/activate.py", line 22, in <module>
from .base.context import ROOT_ENV_NAME, context, locate_prefix_by_name
File "/software/anaconda3/lib/python3.8/site-packages/conda/base/context.py", line 29, in <module>
from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
File "/software/anaconda3/lib/python3.8/site-packages/conda/common/configuration.py", line 37, in <module>
from .serialize import yaml_round_trip_load
File "/software/anaconda3/lib/python3.8/site-packages/conda/common/serialize.py", line 30, in <module>
yaml = get_yaml()
File "/software/anaconda3/lib/python3.8/site-packages/conda/_vendor/auxlib/decorators.py", line 59, in _memoized_func
result = func(*args, **kwargs)
File "/software/anaconda3/lib/python3.8/site-packages/conda/common/serialize.py", line 19, in get_yaml
import ruamel_yaml as yaml
File "/software/anaconda3/lib/python3.8/site-packages/ruamel_yaml/__init__.py", line 13, in <module>
from .cyaml import * # NOQA
File "/software/anaconda3/lib/python3.8/site-packages/ruamel_yaml/cyaml.py", line 5, in <module>
from ruamel_yaml.ext._ruamel_yaml import CParser, CEmitter # type: ignore
File "ruamel_yaml/ext/_ruamel_yaml.pyx", line 20, in init ruamel_yaml.ext._ruamel_yaml
File "/software/anaconda3/lib/python3.8/site-packages/ruamel_yaml/parser.py", line 81, in <module>
from ruamel_yaml.events import * # NOQA
File "/software/anaconda3/lib/python3.8/site-packages/ruamel_yaml/events.py", line 118, in <module>
class AliasEvent(NodeEvent):
KeyboardInterrupt.
答案1
任何时候我使用 $sudo su 并输入 root 密码
你应该输入您自己的密码那里 - 尽管那不会导致您所描述的问题。
您收到的错误消息表明 root 用户已安装 Anaconda - 这可能是一个错误,应该从 root 用户中删除。
您可以尝试以不同的方式更改为 root 用户,这样它就不会尝试加载,/root/.bashrc
我认为这是您遇到的麻烦。
或者,您可以尝试编辑/root/.bashrc
并注释掉调用 Anaconda 的部分。