Installing Memcache on Ubuntu 16.04 is a breeze. All you need are just the right commands and everything is installed.
apt install memcached php-memcached
After that, you just need to restart apache.
systemctl apache2 restart
That's it. You can verify that memcached is installed and working with phpinfo().