Clang format is not available in Ubuntu-exact 12.04, but is available in Ubuntu Saucy http://packages.ubuntu.com/saucy/clang-format-3.4 .
To find this package with apt cache, we need to add the list below to our list of repositories. In fact, the list below is generated for Singapore servers, but if you want to search your country, you can use http://repogen.simplylinux.ch/generate.php
After creating your list, you should add them to your repository, you can find out how to do this by looking here. https://help.ubuntu.com/community/Repositories/CommandLine
There is a list of packages;
deb http://sg.archive.ubuntu.com/ubuntu/ saucy main restricted universe multiverse deb-src http://sg.archive.ubuntu.com/ubuntu/ saucy main restricted universe multiverse deb http://sg.archive.ubuntu.com/ubuntu/ saucy-security main restricted universe multiverse deb http://sg.archive.ubuntu.com/ubuntu/ saucy-updates main restricted universe multiverse deb http://sg.archive.ubuntu.com/ubuntu/ saucy-proposed main restricted universe multiverse deb http://sg.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse deb-src http://sg.archive.ubuntu.com/ubuntu/ saucy-security main restricted universe multiverse deb-src http://sg.archive.ubuntu.com/ubuntu/ saucy-updates main restricted universe multiverse deb-src http://sg.archive.ubuntu.com/ubuntu/ saucy-proposed main restricted universe multiverse deb-src http://sg.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse
Then you must first find the clang format using the command below
sudo apt-cache search in clang format
Then you can install which version you want to install, for example;
sudo apt-get install clang-format-3.3
user2760375
source share