8000 fix/sudo-apt-install-sudo by asmrtfm · Pull Request #297 · omacom/omakub · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

fix/sudo-apt-install-sudo - #297

Merged
dhh merged 1 commit into
omacom:masterfrom
asmrtfm:fix/sudo-apt-install-sudo
Oct 13, 2024
Merged

dhh merged 1 commit into
omacom:masterfrom
asmrtfm:fix/sudo-apt-install-sudo

Conversation

@asmrtfm
@asmrtfm asmrtfm commented Oct 7, 2024
Copy link
Copy Markdown
Contributor

remove unnecessary package from prerequisites installation step

@Kasui92
Kasui92 commented Oct 7, 2024
Copy link
Copy Markdown
Contributor

This package is very useful when installing Omakub in containers. In fact, it is often missing here and it is useful to have it.

So, I don't think it's really unnecessary.

@asmrtfm
asmrtfm commented Oct 7, 2024 •
Copy link
Copy Markdown
Contributor Author

Could you elaborate on which containers you are referring to?
Let me provide a more detailed breakdown, in case it wasn't clear what this pull request changes and why.

Constraints

sudo is included with all Ubuntu Desktop derivatives.
Omakub's README states that it is intended for fresh installs of Ubuntu Desktop (emphasis on Gnome)
Accounting for the unlikely absence of sudo in arbitrary containers doesn't seem to align with Omakub's currently stated constraints.

Changes Made

I removed sudo from the line sudo apt install gpg **sudo** wget curl, because sudo apt install sudo is unnecessary and, more importantly, invalid.

Why It's Invalid

Note that if sudo were missing, the line in question wouldn't even run due to the preceding sudo apt update &&, which would fail with an error about the missing sudo package.

Take away

Even in a scenario where, if that preceding line were not present, and the line sudo apt install gpg sudo wget curl was ran, it would fail for the same reason: trying to use an uninstalled program throws an error. The line in question attempts to use sudo apt install in order to install sudo - the only reason this line does not trigger an error is because Ubuntu Desktop always ships with sudo.

TLDR

I just wanted to mention that I feel you, because I am also interested in expanding the current constraints. The primary intention of my fork of Omakub is to add support for gnome-like DEs such as budgie, which should literally only require changing the if $GNOME ... statements because it is gnome under the hood, and xfce4 which is very similar and vastly more performant than Gnome. So if you're doing something off the beaten path, why not do it in your own fork of the project and then contribute back anything useful you discover?

All of that said, if you're concerned that sudo won't be installed in one of your containers, then assuming you are running as root, you might do something like this:
[[ -x $(which sudo) ]] || apt-get install sudo
or maybe this:
command -v sudo || apt-get install sudo

But ideally you would just include the installation of sudo in your Dockerfile rather than account for the unlikely event of it's absence here.

@dhh
dhh merged commit 0e2ae69 into omacom:master Oct 13, 2024
burno-lima pushed a commit to burno-lima/omakdot that referenced this pull request May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0