← Back to team overview

kubuntu-council team mailing list archive

[Bug 2110168] [NEW] Use `sudo -i` to have root privileges temporarily

 

Public bug reported:

In the useful ["Upgrade Kubuntu from 24.10 to 25.04"](https://help.ubuntu.com/community/PluckyUpgrades/Kubuntu) guide (is "immutable" for me), we can see `sudo software-properties-qt` although: 
    - [“You should never use normal sudo to start graphical applications as root”](https://help.ubuntu.com/community/RootSudo#Graphical_sudo).
    - On <https://unix.stackexchange.com/questions/35338/su-vs-sudo-s-vs-sudo-i-vs-sudo-bash/35342#35342> it's written that using normal `sudo` "causes the normal user problems later on such as not being able to run certain graphical apps through cron. [...] The bottom line is `sudo -i` is the proper command to run when you want a root shell that is untainted by the user's environment".

So, we'd better use `-i`, like in `sudo -i software-properties-qt`.
Note: I have used it many times, without seeing a problem.

About the advantages of `sudo -i`, we can read:
    - https://unix.stackexchange.com/questions/35338/su-vs-sudo-s-vs-sudo-i-vs-sudo-bash
    - https://unix.stackexchange.com/questions/98531/difference-between-sudo-i-and-sudo-su
    - https://www.kubuntuforums.net/forum/archives/eol-releases/-18-04/software-support-az/67748-kdesudo?p=596936#post596936
    - https://www.baeldung.com/linux/sudo-i-vs-sudo-su

** Affects: kubuntu-website
     Importance: Undecided
         Status: New


** Tags: kubuntu software-properties-qt sudo upgrade

-- 
You received this bug notification because you are a member of Kubuntu
website administrators, which is subscribed to Kubuntu Website.
https://bugs.launchpad.net/bugs/2110168

Title:
  Use `sudo -i` to have root privileges temporarily

To manage notifications about this bug go to:
https://bugs.launchpad.net/kubuntu-website/+bug/2110168/+subscriptions



Follow ups