1

My USB stick is now full of backups, and I need to delete at least one to upgrade Nextcloud. I cant.

I try rm -f ./nextcloud-bkp_2017* and I get:

rm: cannot remove './nextcloud-bkp_20171211.tar': Permission denied

So I try sudo rm -f ./nextcloud-bkp_2017* and get:

-bash: sudo: command not found

I then try su And, it asks for a password.

I have tried every password I know, and some I didn't.

It always comes up:

su: Authentication failure

I even try (without knowing if it's the correct app):

apt install sudoer

and, of course, get:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Is there anything I can do?

Where did sudo go?

user256787
  • 11
  • 1
  • 3

1 Answers1

4

If sudo is not installed and you don't know the root password, the only way would be to attach your USB stick to another PC and clean it up.

If sudo is installed, then it may be a path setting problem. The "sudo" binary should normally be in "/usr/bin". You can search for it:

find / -name sudo 2>/dev/null

(the "2>/dev/null" part is to get rid of all "Permission denied" warnings you get in the result)

And then use the path:

/usr/bin/sudo rm -f ./nextcloud-bkp_2017*

If it works, you need to see what is wrong in "/etc/profile" file (where the PATH is originally set) and fix it.

It would help if you mention you RasPi and OS versions. And also what user you are logged on with.

Sohail
  • 163
  • 6