jeffzumwalt32
Posts: 2
Joined: Fri Sep 16, 2016 5:00 pm

Pi 3 sudo rm issue

Fri Sep 16, 2016 5:20 pm

First time here and new to the Pi world. I have updated my pi 3, just wanted to put that out there. I have installed apache2 and php5 libapache2. My issue is when i try to delete the old index.html file using sudo rm index.html I get a return of rm: connot remove 'index.html': no such file or directory.

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

Re: Pi 3 sudo rm issue

Fri Sep 16, 2016 6:21 pm

If the file does not exist you do not need to be concerned about deleting it.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Pi 3 sudo rm issue

Fri Sep 16, 2016 7:18 pm

jeffzumwalt32 wrote:First time here and new to the Pi world. I have updated my pi 3, just wanted to put that out there. I have installed apache2 and php5 libapache2. My issue is when i try to delete the old index.html file using sudo rm index.html I get a return of rm: connot remove 'index.html': no such file or directory.
It's probably best to use

ls

to see what is in a directory before trying to delete things. It might be that the file is really called

index.htm

in which case you'll get the error and it will still be there potentially interfering with whatever you were worried about.

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: Pi 3 sudo rm issue

Sat Sep 17, 2016 3:47 am

If you're running this within a script, and the script dies at this point due to the failure, you can use 'sudo rm -f <filename>' instead (which succeeds even if the file doesn't exist).

User avatar
rpdom
Posts: 16800
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi 3 sudo rm issue

Sat Sep 17, 2016 7:16 am

Did you check in the right place for the file index.html?

In old instructions (for Raspbian Wheezy) it is in /var/www, but currently (for Raspbian Jessie) it will be in /var/www/html

Return to “Troubleshooting”