You are not logged in.

#1 2019-04-21 03:37:55

sb8623
Member
Registered: 2018-09-11
Posts: 18

No basic commands in terminal are working

No basic commands like

sudo

or

ls

is not working. Every time I try to execute a command,

bash: sudo: command not found

I didn't do anything funny. I just switched off the computer before it shut down once and this happened. Should I use fsck  to solve this?

Offline

#2 2019-04-21 04:16:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: No basic commands in terminal are working

sb8623 wrote:

I just switched off the computer before it shut down once

What does this mean?  You switched it off, then it shut down again after restarting, or are you just saying it shut down when you switched it off?

When you boot up, do you log into a tty?  I assume you are not running a graphical session with this problem.  Are you fully booted into a tty, or are you in a recovery shell of the initramfs?

What is the output of `echo $PATH`?

EDIT: was this the first reboot after your partial upgrades resulting from unsupported repo selections reported in your previous thread?  Or had you fixed your pacman.conf and updated since then?

Last edited by Trilby (2019-04-21 04:19:02)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-04-21 05:13:31

sb8623
Member
Registered: 2018-09-11
Posts: 18

Re: No basic commands in terminal are working

Trilby wrote:

What does this mean?

I meant that I turned the switch off before the shutdown process was complete. But should that affect anything? 

Trilby wrote:

I assume you are not running a graphical session with this problem.

Yes, I am running a graphical session. Just no basic commands are working. ('cd' is working fine.)

Trilby wrote:

What is the output of `echo $PATH`?

The output of

echo $PATH

is

$HOME/.local/bin:$PATH
Trilby wrote:

Or had you fixed your pacman.conf and updated since then?

Yes, I fixed my previous problem and have updated since then.

Offline

#4 2019-04-21 05:21:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: No basic commands in terminal are working

sb8623 wrote:

The output of

echo $PATH

is

$HOME/.local/bin:$PATH

Without /usr/bin in your PATH, none of the system binaries will work. How did you manage to break $PATH?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2019-04-21 05:24:46

sb8623
Member
Registered: 2018-09-11
Posts: 18

Re: No basic commands in terminal are working

jasonwryan wrote:

How did you manage to break $PATH?

No idea . That's my question too. I installed some packages for setting up haskell. But how can I solve the problem now? sad

Last edited by sb8623 (2019-04-21 05:36:34)

Offline

#6 2019-04-21 05:38:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: No basic commands in terminal are working

Look at your shell and pacman history and work out what broke it. I'd start with the haskell packages.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2019-04-21 09:50:01

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: No basic commands in terminal are working

where is your path set? if you're unsure you can do something like

grep -ir "path=" $HOME

if nothing comes up, expand that beyond your home (but it shouldn't need to)

Offline

#8 2019-04-21 09:54:12

sb8623
Member
Registered: 2018-09-11
Posts: 18

Re: No basic commands in terminal are working

HiImTye wrote:
grep -ir "path=" $HOME

grep is not working too. How am I supposed to do that?

bash: grep: command not found

Offline

#9 2019-04-21 10:08:22

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: No basic commands in terminal are working

export PATH=/usr/bin

Offline

#10 2019-04-21 10:16:37

sb8623
Member
Registered: 2018-09-11
Posts: 18

Re: No basic commands in terminal are working

loqs wrote:
export PATH=/usr/bin

It works but I have to do it every time I open a new session in terminal.

Offline

#11 2019-04-21 10:21:38

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: No basic commands in terminal are working

I suggested it so you could follow.

jasonwryan wrote:

Look at your shell and pacman history and work out what broke it. I'd start with the haskell packages.

Once you have found the cause of the breakage you can address it.

Offline

#12 2019-04-21 10:53:24

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,933
Website

Re: No basic commands in terminal are working

sb8623 wrote:
HiImTye wrote:
grep -ir "path=" $HOME

grep is not working too. How am I supposed to do that?

bash: grep: command not found

Just prepend /usr/bin/ to all executables. I.e.

/usr/bin/grep -r PATH=

Please provide its output.

Last edited by schard (2019-04-21 10:53:59)

Offline

#13 2019-04-21 12:31:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: No basic commands in terminal are working

Thanks for clarifying the shutdown statement - In hindsight that makes perfect sense the way it was written, perhaps I was undercaffeinated and seeing various possible readings of it.  In any case, that now looks irrelevant.

I'd bet in one of your shell configs you set PATH with single quotes.  The following two are completely different:

export PATH='$HOME/.local/bin:$PATH'
export PATH="$HOME/.local/bin:$PATH"

You likely wanted the second one of those, but put the first in your bashrc or bash_profile.

Last edited by Trilby (2019-04-21 12:33:10)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#14 2019-04-21 13:51:47

sb8623
Member
Registered: 2018-09-11
Posts: 18

Re: No basic commands in terminal are working

schard wrote:

Please provide its output.

The partial output of

/usr/bin/grep -r PATH=

is

Binary file .cache/kio_http/9c33c9df530cd42c0df02375e2250d9ef55559a4 matches
Binary file .cache/mozilla/firefox/hvcq7jsl.default-1550988949401/cache2/entries/2823186B3F9DB2BA6010ACFAC56C35752CA08C6B matches
Binary file .cache/go-build/ed/ed31bf9eb1e326b8d707a3438ef1e9466d7caf37bc1a3d43fb1af1a25732910c-d matches

The rest is taking a long time and is pretty big.

Offline

Board footer

Powered by FluxBB