If you’re having trouble deleting a swap file, there are a few things to try. First, make sure you have the correct permissions set on the file. Next, try using the rm command with the -f option to force deletion. If that doesn’t work, you can use the fdisk command to delete the swap partition. ..