The extension is not in the Ubuntu repos, so you'll have to grab it from the developer's website. (http://www.ioncube.com/loaders.php).
If your Ubuntu system / server is 32-bit:
Here is how to install IonCube Loader on Ubuntu 12.04 (and other releases and editions of Ubuntu as well).
cd /usr/local
sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz sudo tar xzf ioncube_loaders_lin_x86.tar.gz
sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz sudo tar xzf ioncube_loaders_lin_x86.tar.gz
If your Ubuntu system / server is 64-bit:
cd /usr/local sudo wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz sudo tar xzf ioncube_loaders_lin_x86-64.tar.gz
echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" | sudo tee /etc/php5/conf.d/ioncube.ini
Then restart the webserver:
sudo service apache2 restart
That's it.