2

I have some packages from Ubuntu that cannot be installed as root account which is the default on Colab.

I have tried the following:

  • !sudo useradd -m ted
  • !passwd ted (set the new password)
  • !su ted

This generates an error: sh: 0: can't access tty; job control turned off

I am not a linux person so I am not sure what does that mean.

user2471214
  • 729
  • 9
  • 17

3 Answers3

3

Don't forget to use ! in google colab.

Add a newuser:

adduser username 
usermod -aG sudo username

Switch user:

su username

Installing package:

sudo -S apt install pkg_name
Rajan saha Raju
  • 794
  • 7
  • 13
1

You just can type the command without the sudo part like this !adduser tedand it will work Then switch to the new user by !su ted then a textbox will appear in it u can write your commands

lofy
  • 35
  • 8
0

I just used the commands !adduser username and then !su username.

Also type in the commands in the prompt you get after doing this (not in the new notebook cell).

william3031
  • 1,653
  • 1
  • 18
  • 39