1、add source
lwk@qwfys ~ $ apt add-repository ppa:cwchien/gradle
[sudo] password for lwk:
You are about to add the following PPA:
Gradle is a Groovy based build system.
Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.
Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults. Gradle is quickly becoming the build system of choice for many open source projects, leading edge enterprises and legacy automation challenges.
More info: <http://gradle.org/>
More info: https://launchpad.net/~cwchien/+archive/ubuntu/gradle
Press Enter to continue or Ctrl+C to cancel
Executing: /tmp/tmp.IebOmCEavf/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
9D06AF36
gpg: requesting key 9D06AF36 from hkp server keyserver.ubuntu.com
gpg: key 9D06AF36: public key "Launchpad PPA for Cheng-Wei Chien" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
lwk@qwfys ~ $
2、update
lwk@qwfys ~ $ apt update
Hit:1 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease
Ign:2 http://mirrors.ustc.edu.cn/linuxmint sylvia InRelease
Hit:3 http://mirrors.ustc.edu.cn/ubuntu xenial InRelease
Hit:4 http://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease
Hit:5 http://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease
Hit:6 http://download.virtualbox.org/virtualbox/debian xenial InRelease
Hit:7 http://mirrors.ustc.edu.cn/linuxmint sylvia Release
Hit:9 http://archive.canonical.com/ubuntu xenial InRelease
Get:10 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial InRelease [17.5 kB]
Hit:11 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:12 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
Get:14 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main Sources [2,620 B]
Get:15 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 Packages [1,328 B]
Get:16 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main i386 Packages [1,328 B]
Get:17 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main Translation-en [936 B]
Fetched 23.7 kB in 5s (4,291 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.
lwk@qwfys ~ $
2、install
lwk@qwfys ~ $ apt list |grep gradle
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gradle/xenial,xenial 4.7-0ubuntu1 all
gradle-3.5.1/xenial,xenial 1.0-0ubuntu1 all
gradle-4.3.1/xenial,xenial 1.0-0ubuntu1 all
gradle-4.4.1/xenial,xenial 1.0-0ubuntu1 all
gradle-4.5.1/xenial,xenial 1.0-0ubuntu1 all
gradle-4.6/xenial,xenial 1.0-0ubuntu1 all
gradle-4.7/xenial,xenial 1.0-0ubuntu1 all
gradle-debian-helper/xenial,xenial 1.1 all
gradle-doc/xenial,xenial 2.10-1 all
gradle-ppa/xenial,xenial 4.7-0ubuntu1 all
gradle-propdeps-plugin/xenial,xenial 0.0.7-2 all
libgradle-core-java/xenial,xenial 2.10-1 all
libgradle-jflex-plugin-java/xenial,xenial 0.0.2-1 all
libgradle-plugins-java/xenial,xenial 2.10-1 all
lwk@qwfys ~ $ apt install -y gradle
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gradle-4.7 gradle-ppa
The following NEW packages will be installed:
gradle gradle-4.7 gradle-ppa
0 upgraded, 3 newly installed, 0 to remove and 9 not upgraded.
Need to get 75.3 MB of archives.
After this operation, 84.9 MB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 gradle-4.7 all 1.0-0ubuntu1 [75.3 MB]
Get:2 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 gradle-ppa all 4.7-0ubuntu1 [3,238 B]
Get:3 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 gradle all 4.7-0ubuntu1 [2,964 B]
Fetched 59.2 MB in 7min 29s (132 kB/s)
Selecting previously unselected package gradle-4.7.
(Reading database ... 207938 files and directories currently installed.)
Preparing to unpack .../gradle-4.7_1.0-0ubuntu1_all.deb ...
Unpacking gradle-4.7 (1.0-0ubuntu1) ...
Selecting previously unselected package gradle-ppa.
Preparing to unpack .../gradle-ppa_4.7-0ubuntu1_all.deb ...
Unpacking gradle-ppa (4.7-0ubuntu1) ...
Selecting previously unselected package gradle.
Preparing to unpack .../gradle_4.7-0ubuntu1_all.deb ...
Unpacking gradle (4.7-0ubuntu1) ...
Setting up gradle-4.7 (1.0-0ubuntu1) ...
update-alternatives: using /usr/lib/gradle/4.7/bin/gradle to provide /usr/bin/gradle (gradle) in auto mode
Setting up gradle-ppa (4.7-0ubuntu1) ...
Setting up gradle (4.7-0ubuntu1) ...
lwk@qwfys ~ $ gradle -v
------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------
Build time: 2018-04-18 09:09:12 UTC
Revision: b9a962bf70638332300e7f810689cb2febbd4a6c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_171 (Oracle Corporation 25.171-b11)
OS: Linux 4.8.0-53-generic amd64
lwk@qwfys ~ $
参考文献