rathel
Posts: 3
Joined: Mon Mar 30, 2015 6:03 am

illegal instruction on sudo

Fri Jun 23, 2017 3:29 pm

I'm running a raspberry pi 3 with the lastest raspbian jessie and it was all working fine and good until a couple days ago and now I'm getting "illegal instruction" whenever I try to use the sudo command. How and why am I getting this? Could it have been a recent update? Would rpi-update do this?

SurferTim
Posts: 2054
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: illegal instruction on sudo

Fri Jun 23, 2017 3:59 pm

In a terminal, run groups. Check if you are a member of group sudo.
My advice applies to RaspiOS only. Please mention if you use another OS.

rathel
Posts: 3
Joined: Mon Mar 30, 2015 6:03 am

Re: illegal instruction on sudo

Fri Jun 23, 2017 6:03 pm

pi@raspberrypi:~ $groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
pi@raspberrypi:~ $

User avatar
B.Goode
Posts: 14297
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: illegal instruction on sudo

Fri Jun 23, 2017 6:19 pm

rpi-update is one possibility.

Modifying your apt sources to install some exotic item of software is another.

The Good News of sorts is that if it was running a couple of days ago then it is no longer the latest version of Raspbian Jessie, so this might be a good time to reinstall from scratch.
https://www.raspberrypi.org/blog/a-rasp ... ing-tools/

User avatar
DougieLawson
Posts: 42232
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: illegal instruction on sudo

Fri Jun 23, 2017 6:23 pm

B.Goode wrote:rpi-update is one possibility.

Modifying your apt sources to install some exotic item of software is another.

The Good News of sorts is that if it was running a couple of days ago then it is no longer the latest version of Raspbian Jessie, so this might be a good time to reinstall from scratch.
https://www.raspberrypi.org/blog/a-rasp ... ing-tools/
This week's rpi-update hasn't doing anything bad (that's not a recommendation to run it, most users should NEVER run rpi-update). Most likely it's going to be due to adding an incompatible repository to the /etc/apt/sources.list.d/ directory.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

rathel
Posts: 3
Joined: Mon Mar 30, 2015 6:03 am

Re: illegal instruction on sudo

Fri Jun 23, 2017 6:30 pm

B.Goode wrote:rpi-update is one possibility.

Modifying your apt sources to install some exotic item of software is another.

The Good News of sorts is that if it was running a couple of days ago then it is no longer the latest version of Raspbian Jessie, so this might be a good time to reinstall from scratch.
https://www.raspberrypi.org/blog/a-rasp ... ing-tools/
Yeah I was thinking I might have to. I didn't modify the sources this time around. I didn't have anything exotic. Not that this is big of deal I was hoping there was some way to fix it, before I resort to do a new install.

SurferTim
Posts: 2054
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: illegal instruction on sudo

Fri Jun 23, 2017 7:33 pm

Then it probably was the rpi-update that did it to you.
My advice applies to RaspiOS only. Please mention if you use another OS.

User avatar
DougieLawson
Posts: 42232
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: illegal instruction on sudo

Fri Jun 23, 2017 8:33 pm

SurferTim wrote:Then it probably was the rpi-update that did it to you.
How do you come to that conclusion?
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

annunal
Posts: 3
Joined: Fri May 23, 2014 12:46 pm

Re: illegal instruction on sudo

Wed Feb 28, 2018 4:57 pm

I see that this post has not yet been solved.

I have the problem of a remote machine (that I cannot update) that I can reach as terminal window. Any sudo command produces "Illegal instruction" so I cannot even reboot the device.

Looking at some posts I gave some commands for you to understand

file /usr/bin/sudo

/usr/bin/sudo: setuid ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=a3f35f61128ee889bdc3ce411d5b205c49479c2e, stripped

readelf -A /usr/bin/sudo| grep CPU
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_CPU_unaligned_access: v6 <<<<< What is this ???

sudo ls
Illegal instruction

groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi


How can I solve the problem ?

thanks
Alessandro

RobCranfill
Posts: 7
Joined: Sat Aug 18, 2018 4:47 pm
Location: Seattle, WA, USA

Re: illegal instruction on sudo

Thu Oct 25, 2018 8:49 pm

I just ran into this problem, and I didn't find any real solution.... except rebooting seems to have fixed it. I assume you probably tried that (it's kind of a Windows-y, half-assed solution, no?) but just in case this encourages someone else with the same problem to try rebooting, here it is.

Of course, you can't "sudo shutdown" in this case, so you gotta just cut the power. Whatevs.

/rob

Aqirito
Posts: 1
Joined: Wed Jan 23, 2019 2:59 pm

Re: illegal instruction on sudo

Wed Jan 23, 2019 3:06 pm

when i got this on my raspbian 2018, raspberrypi 2

i have got this problem by installing some software without typing sudo apt update and sudo apt upgrade.

if u are the same as me that that your raspbian cant find "sudo", u must reinstall raspbian again on your raspberryPi.

make sure we will not do the same mistake again...from polikk students

carlgonz
Posts: 1
Joined: Wed Feb 06, 2019 2:49 pm

Re: illegal instruction on sudo

Wed Feb 06, 2019 2:53 pm

Ok, same problem here. I almost reinstall Raspbian, but then I checked the SD card and noticed that it wasn't perfectly inserted. I retired and re-inserted the SD card, turned on the Raspberry and everything works fine now :/

In my experience, weird things can happen with faulty the SD cards

Return to “Troubleshooting”