how to install grsecurity in Ubuntu 16.04

Solution 1:

You need to patch and compile your own kernel. The instructions are here: https://en.wikibooks.org/wiki/Grsecurity/Configuring_and_Installing_grsecurity

There is one caveat, however. Ubuntu normally uses its own kernel which is patched with useful fixes that haven't made it to mainline yet (like the MacBook Pro suspend/resume fix) and is compiled with an Ubuntu-approved config. Unfortunately, at the moment the Ubuntu patches aren't compatible with grsecurity. However, you should still grab the appropriate .config file, as explained here.