How to repair the swap partition in Ubuntu

There are situations when, after you just installed Ubuntu and properly configured the partitions, the swap is not recognized, meaning the system doesn't "see" it, so, you can't use that swap partition (the system will not perform as good as it should).

How can we repair it?
first, install GParted

sudo apt-get install gparted

open GParted, and search your swap (it should be named linux-swap or unknown) or choose a different partitions (like, for instance, you just observe a new unused 1/2/3 GB partition)

format the chosen partition (right-click on it-->Format to-->linux-swap)

and Apply All Operations

after this operation is completed, right-click on the new linux-swap-->Information--> and copy the text of the UUID and close GParted

open the terminal and type

sudo gedit /etc/fstab

and paste the copied text next to UUID=, then save

after that, make sure UUID= doesn't have # in front of it

Finally, restart your computer.