How To Install Swapoff On Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Install swapoff
-
Debian
apt-get install mountClick to copy -
Ubuntu
apt-get install mountClick to copy -
Alpine OS
apk add util-linuxClick to copy -
Arch Linux
pacman -S util-linuxClick to copy -
Kali Linux
apt-get install mountClick to copy -
CentOS
yum install util-linuxClick to copy -
Fedora
dnf install util-linuxClick to copy -
Raspbian
apt-get install mountClick to copy -
macOS
brew install util-linuxClick to copy
Disables device or file for swapping.
How to use swapoff?
Below are few example commands for swapoff that you can use in the terminal.
Disable a given swap partition:swapoff /dev/sdb7Click to copyDisable a given swap file:swapoff path/to/fileClick to copyDisable all swap areas:swapoff -aClick to copyDisable swap by label of a device or file:swapoff -L swap1Click to copy
Installation of latest swapoff command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS. You can copy the command for your OS from above and paste it into your terminal. Once you run the command it will download the 2026 latest package from the repository and install it in your computer/server.




