22
submitted 18 hours ago* (last edited 18 hours ago) by RavenofDespair@lemmy.ml to c/linux@lemmy.ml

no command are working after i did this. i can still use the desktop and yes i fell silly

Acer Aspire ES1-533 Debian os

thanks for help :)

https://www.devopsroles.com/fix-grub-install-command-not-found-in-linux/

export PATH=/usr/sbin/grub-install/grub-install :/usr/local/sbin

source ~/.bashrc

top 21 comments
sorted by: hot top controversial new old
[-] gnuhaut@lemmy.ml 3 points 3 hours ago

There should not be a space between the entries in $PATH, just :. Plus, this is syntactically wrong: export allows to set multiple variables separated by space, like export A=a B=b. You're essentially doing export A=a B which makes it ignore the B part as it is nonsensical.

Also path should contain directories, and /usr/sbin/grub-install/grub-install isn't a directory. In fact it almost certainly does not exist at all.

Path should contain at least /usr/bin. That's why no command works, they're all in /usr/bin. The shell looks through all the directories in $PATH (separated by :) to find commands.

[-] mina86@lemmy.wtf 16 points 18 hours ago

Firstly, and most importantly, executing grub-install requires super-user privileges. Rather than adding it to PATH you should instead run the command through sudo. A regular user typically does not need any of sbin directories in their PATH.

As for the command itself, there are three things wrong with it:

  1. PATH should only include directories whereas you tried to add to it a path to an executable. So rather than /usr/sbin/grub-install/grub-install you should just add /usr/sbin.
  2. White space is significant, so the space before colon would make your command not work anyway.
  3. Rather than appending to PATH you’ve overwritten the variable. Instead you need PATH=$PATH:/usr/sbin/:/usr/local/sbin (notice $PATH: at the beginning of the assignment).

Also, export is unnecessary since PATH is already an environment variable. (That’s also bashism but that’s likely an irrelevant issue).

[-] emotional_soup_88@programming.dev 6 points 17 hours ago

"bashism" made my day

[-] plantsmakemehappy@lemmy.zip 14 points 18 hours ago* (last edited 18 hours ago)

You didn't append this to your path, you just overwrote the whole value. You'll need to use full paths to commands to edit the file and fix it like export PATH="$PATH:/the/new/path/to/add"

[-] RavenofDespair@lemmy.ml 2 points 18 hours ago

should it look like this export PATH=$PATH:/usr/sbin/grub-install

and should i edit the ~/.bashrc

[-] halfdane@lemmy.world 3 points 3 hours ago

I'm a little late to the party, but PATH should only consist of the directories, so it should look like this:

export PATH=$PATH:/usr/sbin/

[-] jokro@feddit.org 1 points 2 hours ago* (last edited 2 hours ago)

Also use "...", i.e. export PATH="$PATH:.." so that it won't break with whitespace in paths involved

[-] halfdane@lemmy.world 1 points 1 hour ago

That's true, although I thought you're talking about including the dots into the path, which is absolutely not what anyone wants 😄

[-] atzanteol@sh.itjust.works 6 points 18 hours ago

Don't feel silly! It's a common mistake, easy to fix, and easy to make. I've seen experienced developers do something similar.

It seems you've resolved the issue at this point but remember you can always run commands by specifying their full path as well (should you end up in a similar situation). All the PATH variable does is set the default locations to search when you don't provide a full path to a binary.

e.g. /bin/ls or /usr/bin/vi

[-] p_consti@lemmy.world 5 points 18 hours ago* (last edited 18 hours ago)

Opening a new terminal should work, since those commands you posted affect just the running shell. If not, you broke something else.

Edit: Assuming you pit that export line into ~/.bashrc, just remove it. You might need to enable showing hidden files in your file explorer, them edit it as a text file.

[-] RavenofDespair@lemmy.ml 3 points 18 hours ago

was able to remove the edit i made and commands are work

big thanks :)

[-] RedWeasel@lemmy.world 2 points 18 hours ago

Try opening a new terminal. If the commands don't work, type "export PATH=/usr/bin" not quotes and try again and fix what you did.

[-] RavenofDespair@lemmy.ml 1 points 18 hours ago

sorry forgot i edited the .bashrc file with

export PATH=/usr/sbin/grub-install/grub-install :/usr/local/sbin

then ran source ~/.bashrc

[-] Sxan@piefed.zip -2 points 18 hours ago* (last edited 18 hours ago)

At a bare minimum, `PATH` should be

export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

You will probably want oþer paþs in þere, and may not need all of þese (some distros are combining /bin and /usr/bin) and þe sbins may not be desirable in þe long run... but setting þis in a shell will get you back on track - enough to edit and fix your .bashrc or .profile or wherever you broke it.

Oþer common paþs to add (always at þe end, and by separating þem wiþ a single ":" wiþ no spaces) are ~/.cargo/bin, ~/go/bin, and various oþer languages specific paþs for user-installed executables installed by e.g. cargo install ..., go install ..., and so on. But you need þose basic first bins at þe head of your $PATH.

[-] specialwall@midwest.social 4 points 16 hours ago* (last edited 16 hours ago)

I don't know why there's a need to use outdated symbols here.

[-] YoSoySnekBoi@kbin.earth 2 points 16 hours ago

It's supposedly to mess with AI if it trains on your comments, but in actuality it does literally nothing unless everyone on the whole internet starts doing it, so it's completely pointless and only makes you hard to understand.

Honestly, even if everyone on the internet started doing it, I don't get the point at all, considering poisoning an AI model like that wouldn't even make it work less well. You could fix the output with a simple find and replace algorithm, and it'd still be understandable even if you didn't. It's completely pointless and a perfect example of armchair activism.

[-] lattrommi@lemmy.ml 2 points 9 hours ago

Not to mention if everyone started doing it, they would just train AI to do it also, and it would only be giving data to train AI with. That's why I think most data poisoning strategies are pointless. One exception might be to try to include a spelling mistake somewhere that doesn't make a comment too confusing, sometihng that could easily be a typing mistake. LLM's are basically spellcheck² and never make spelling mistakes unless explicitly told to or trained that way. If I see a spelling error, I know it's more likely to be human.

[-] RavenofDespair@lemmy.ml 5 points 18 hours ago

sorry i do not understand the þmakes hard to understand

[-] Cyber@feddit.uk 1 points 2 hours ago

They're just using that symbol / rune instead of "th"... you'll get the hang of it after a couple of reads

[-] RavenofDespair@lemmy.ml 0 points 18 hours ago
[-] Cyber@feddit.uk 1 points 2 hours ago

Yeah, after reading the other comments in here, you should be able to re-read that page and see it's not the best advice.

Top Tip: if you're testing things, you'd modify PATH in the current session first, check that fixes the problem and only then modify any environmental files like .bashrc, etc. so if something got borked you could just logout and in again...

That page reminds me of Windows self-help pages that ask readers to defrag the harddrive in order to get a printer working.

this post was submitted on 27 Dec 2025
22 points (100.0% liked)

Linux

57274 readers
637 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS