Install Swapon On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

Install Swapon On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

swapon

Enables device or file for swapping.

Maintainer: LaMont Jones


Section: admin

Install swapon

  • Debian apt-get install mount Click to copy
  • Ubuntu apt-get install mount Click to copy
  • Alpine OS apk add util-linux Click to copy
  • Arch Linux pacman -S util-linux Click to copy
  • Kali Linux apt-get install mount Click to copy
  • CentOS yum install util-linux Click to copy
  • Fedora dnf install util-linux Click to copy
  • Raspbian apt-get install loop-aes-utils Click to copy
  • macOS brew install util-linux Click to copy

Enables device or file for swapping.

How to use swapon?

Below are few example commands for swapon that you can use in the terminal.

Get swap information:
swapon -sClick to copy
Enable a given swap partition:
swapon /dev/sdb7Click to copy
Enable a given swap file:
swapon path/to/fileClick to copy
Enable all swap areas:
swapon -aClick to copy
Enable swap by label of a device or file:
swapon -L swap1Click to copy
Install the latest version of swapon in Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS from terminal. To install the swapon just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of swapon from the respository and install it in your computer/server.