There are various ways to build a tile server mentioned on Switch2osm. We choose one in which instructions were given for our Ubuntu version 12.04 LTS. We followed instructions given on link:
Though we were able to setup a server easily, but importing data was creating a problem. We got errors there. Sir suggested us to remove the package that was creating a problem and to install them again.
Package can be removed with this command:
sudo apt-get purge “package_name”