Sudo not owned by uid 0

I just flashed my TK1 for the first time. I booted it and everything seemed fine until I opened the terminal and typed: sudo [whatever]. At which point I was greeted with the message: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set. So that was messed up, my user doesnt have control of sudo. So I looked online and found that I should use su to take control. Commands with su give an authentication failure because no password has been assigned. I seem to be in some kind of catch 22 where I need sudo to get sudo. Advice please!!!

It sounds like permissions were not preserved when unpacking the sample root file system, or when using that sample root file system to populate the image which is flashed.

What it comes down to is that unpacking the sample rootfs requires preserving the permissions of the files in the sample…if you do not use root (or sudo) to do the unpacking, you lose root ownership. If you run the “apply_binaries.sh” script without sudo, you’ll probably get some errors you don’t notice, and anything not giving an error will have the same problem. If you unpacked the sample rootfs onto a non-Linux file system, it becomes impossible to preserve permissions…other operating systems have no concept of Linux root permissions, e.g., VFAT and NTFS are guaranteed failures this way. Often a VM Linux install fails with this because it doesn’t have a native Linux file system under it.

Was the sample rootfs unpacked as root or sudo? Was the underlying file system a native Linux file system? Did the flash command itself run with root permissions?

The unpacking and the applying of the binaries were both run as sudo. However, I kept the files on an external drive because my ubuntu partition is very small. I believe the drive is NTFS. What do you think is the easiest way to proceed from here?

You would have to reformat the external hard drive. Something like mkfs.ext4 on that partition will do the job. The question is whether you have something on the drive you want to keep…and if you want to later use that partition again under windows you’d need to format it back again as NTFS at a later date. About the only alternative there is to split the drive into both an NTFS partition and an ext4 partition…but be warned that you’ll probably want the ext4 partition to be at least 50 GB (it has to store the driver package plus any temp files plus sample rootfs…50 GB would do the job, but probably less could be used…because of image file sizes I would not attempt using less than a 25 GB partition).

Btw, if you run “df -T” the file system type will be printed (along with size and usage info).