New to Linux - I'm using Debian 9.

I want to run a script to install pwndbg, following the tutorial here. I'm using my root account to do so and want to install it to my root account's home directory. The output is as follows:

root@My-Debian-PC:~/pwndbg# ./setup.sh
+ osx
+ uname
+ grep -i Darwin
+ '[' '' == --user ']'
+ PYTHON='sudo '
+ linux
+ uname
+ grep -i Linux
+ sudo apt-get update
./setup.sh: line 24: sudo: command not found
+ true
+ sudo apt-get -y install gdb python-dev python3-dev python-pip python3-pip libglib2.0-dev libc6-dbg
./setup.sh: line 25: sudo: command not found

Evidentally the script is presumed to be ran as an account with sudo priveliges, hence giving the error because the root account can't use the sudo command.

So is there a way of removing the errors? Should I simply edit the script and remove the word sudo from lines 24 and 25, or is it bad practice to do so? Or is it possible to add my root account to the sudo user group in case I come across the error with another script in the future? Or should I just run the script as-is, then afterwards run apt-get update and then apt-get -y install gdb python-dev python3-dev python-pip python3-pip libglib2.0-dev libc6-dbg?


  • Instead of using sudo inside the script, please execute sudo apt-get update manually as a command. please give the result. Apr 5, 2018 at 15:38

2 Answers 2


If you can edit the script and remove the sudo commands, running the script as the root user should work as expected.

Installing the sudo command would also be a way to get the command to execute successfully.

apt install sudo
  • Never knew you can just install sudo. It worked though - thanks :)
    – adam
    Apr 5, 2018 at 15:39

I would try to run this as a non-root user. These security constructs exist for a reason.

If you're already root, sudo is redundant. Scripts often use "sudo" to effecively ask regular users "Are you really sure you want to do this?", or to differentiate between changes made for a particular user and changes made system-wide. So if you're just messing around on a test box, go for it, but definitely make sure you understand in particular what the "sudo" line is doing.

I would also caution against using your root account for extensive use outside of administration. If you want to actually use the library you're installing to develop software, it makes sense to have a non-admin user that you use as your daily login. See here for why it's a bad idea to log in regularly to run applications as root. Understanding this should be particularly important if you're interested in security.

  • Cheers - I'm only using this as a secondary system to practice CTF and other cyber security things on. I use root just for the ease of not having to type my password constantly. I'll bear your point for future though - cheers :)
    – adam
    Apr 5, 2018 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .