As you may know, Gradle is a tool that can automate the building, testing, publishing, deployment for generating static websites, documentation and others.
The latest version available is Gradle 4.10.2, which has been recently released, coming with a big list of changes. For more information, please consult the changelog.
In order to successfully install the latest version of gradle available, you need to add the ppa to your system, update the local repository index and install the gradle package. Like this:
$ sudo add-apt-repository ppa:cwchien/gradle
$ sudo apt-get update
$ sudo apt-get install gradle
Optional, to remove gradle, do:
$ sudo apt-get remove gradle
The installation instructions work for Ubuntu 18.10 Cosmic Cuttlefish, Ubuntu 18.04 Bionic Beaver, Linux Mint, Elementary OS and other Ubuntu derivative systems.