Building packages on Ubuntu and CentOS
How to deploy software on multiple identical systems?
tar/gzip + scp or rsunc is a possibility. However
they lack of the version and dependency control as well as clean uninstall.
.rpm and .deb packaging is the best solution: clean install/uninstall, version control, dependency control.
Introduction to building .deb packages.
Introduction to building .rpm packages.