Error opening Hugin

Did you follow this for installation?

http://wiki.panotools.org/Hugin_Compiling_Ubuntu#Shortcut

Stable

This will install the latest stable version of the tools:

sudo add-apt-repository ppa:hugin/hugin-builds
sudo apt-get update
sudo apt-get install hugin enblend panini

Unstable

sudo add-apt-repository ppa:hugin/hugin-builds
sudo add-apt-repository ppa:hugin/nightly
sudo apt-get update
sudo apt-get install hugin enblend panini