6

I was wondering why the command do-release-upgrade doesn't require sudo? I mean, it does significantly change your system, so I would have guessed it requires sudo.

This is from ubuntu self, but it isn't that helpful. I just want to know how this is secure for the integrity for my system, if every user can access this command.

Thanks in advance.

[EDIT]:

I used a new terminal window, thus no sudo that wasn't expired yet, and I used the command do-release-upgrade NOT sudo do-release-upgrade.
So even with unexpired sudo I should be unable to upgrade.

[EDIT 2]:

enter image description here enter image description here

Dr_Bunsen
  • 4,713
  • 4
  • 28
  • 40
  • Same happened here: do-release-upgrade and I went from 16.10 to 17.04. No "sudo" but I'm not 100% sure if I was prompted for the password somewhere after the start. –  Apr 14 '17 at 16:01

2 Answers2

4

I just ran do-release-upgrade in my terminal and look what happened:

do-release-upgrade

So you don't have to worry about this anymore. do-release-upgrade is a python script located in /usr/bin which can be accessed by every user, but this script needs, as you can see, root privileges when it starts to perform actions on the system.

Radu Rădeanu
  • 169,590
  • How comes I updated from 12.10 > 13.04, and now from 13.04 > 13.10 without sudo? EDIT: O you are already in 13.10 :P – Dr_Bunsen Oct 17 '13 at 17:37
  • @Dr_Bunsen No, I'm still in 13.04. You probably entered before in terminal your password, and this didn't expired. There is a time limit in which you are not asked twice by password when you use sudo. See http://askubuntu.com/questions/14948/how-to-cancel-the-currently-applied-remaining-sudo-time-out. – Radu Rădeanu Oct 17 '13 at 17:48
  • I know this. It was a clean terminal, and I didn't enter a sudo infront of the command. – Dr_Bunsen Oct 17 '13 at 18:04
  • @Dr_Bunsen I don't think that something this is possible. For sure you used another command with sudo in front of it before to use this command or probably you was logged as root. – Radu Rădeanu Oct 17 '13 at 18:22
  • I was logged in as my user account, in wchich I have to sudo in order to let things change. – Dr_Bunsen Oct 18 '13 at 10:22
  • I had the same experience as @Dr_Bunsen: I have to use sudo at the start of those apt commands that update the system in any way, but I'm able to run do-release-upgrade without sudo, and without having to enter my password at any stage. This seems quite odd. (Note that even if I've just used sudo, i can't run one of those apt commands without sudo, but can run do-release-upgrade.) – Teemu Leisti Aug 11 '20 at 09:12
2

Put simply, do-release-upgrade implies sudo in the script so you don't have to type sudo yourself.

mmstick
  • 1,907
  • 1
    Thanks, but how is that an good idea? Now anyone can run the do-release-upgrade command..... – Dr_Bunsen Oct 18 '13 at 10:31
  • Sure, but they can not install or upgrade. That requires sudo. All the script does is tell you if there is or is not an upgrade if you are a normal user ;) – Rinzwind Oct 18 '13 at 10:35