Because of the great variety of systems, this installation guides may be outdated quickly. So if this guide is not working for you please open an issue on github.com/UG4/docs
Additionally to the pages below, please have a look at https://github.com/UG4/ughub. Installation and usage of UG4's package manager is detailed there.