linux – How to delete swap file in ubuntu?

I am trying to delete the swap file by the following link:

https://www.digitalocean.com/community/questions/delete-swap-file

However, when I type:

sudo rm /swapfile

I am getting the following error:

rm: cannot remove `swapfile': Operation not permitted

I have changed the permissions on the swap file to 777 and I believe I have root privileges, But still not able to delete it.