Score:0

sudo su not working as it should. Any ideas?

jp flag

I have searched this page for a similar question but found none. I use ubuntu 20.0 on hp workstation. Anytime I use $sudo su and input the root password the system gets stuck. Although when I use $Ctrl+c it gives me the root privilege but also returns an error (see below). I'm guessing this has something to do with the system configuration.

^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.
Nmath avatar
ng flag
I would ask under what circumstances are you using `sudo su` and why? I can't think of many situations where it would be prudent to do this and my guess is that you've messed something up in your previous actions when you have used it.
Score:1
de flag

Anytime I use $sudo su and input the root password

You should be entering your own password there - though that wouldn't cause the problem you describe.

The error message you're getting suggests that the root user has Anaconda installed - which is probably a mistake, and ought to be removed from the root user.

You might try changing to the root user in a different way so that it does not attempt to load /root/.bashrc which I think is the trouble you're having.

Alternatively, you might try to edit /root/.bashrc and comment out the parts which invoke Anaconda.

Ssap avatar
jp flag
Thank you James.. Your suggestion fixed the error. I comment out the anaconda part in the /root/.bashrc. Cheers
James S. avatar
de flag
Fantastic! glad I could help.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.