Cannot change size swap file

I’ve installed DietPi without UI on a 4 Gb micro sd. It runs on a PI model B. I want to decrease the size of the swap file. This is what I do:
log in as root
select / and press
I go to the option: Swap file : [X] |1822 Mib used. Select to change size.
I press and I get:
Failed: Insufficient free space /, a minimum of 2 Gb is required (527 Mib is available).
The only thing I can do is press . Then I am back in the previous menu. Type a number ore using the space bar doesn’t help.
What to do?


many thank’s for your request. Short question. What do you like to archive? Do you like to change size or disable SWAP?

you could try following

/boot/dietpi/func/dietpi-set_swapfile 512 # Sets swap size to 512 MiB
/boot/dietpi/func/dietpi-set_swapfile 0 # Removes the swap file completely