1

I installed gradle by typical way:

sudo apt install gradle
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gradle is already the newest version (3.5-0ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 8 not to upgrade.

Next I wanted to use this program:

$ gradle 
The program 'gradle' is currently not installed. You can install it by typing:
sudo apt install gradle

I was trying to remove java, purge gradle, remove it from anywhere and install again. Nothing helps... The most confusing is that this package was working correctly some days earlier without troubles.

Below some debug:

$ which gradle
$ whereis gradle
gradle:
$ apt-cache policy gradle
gradle:
  Installed: 3.5-0ubuntu1
  Candidate: 3.5-0ubuntu1
  Version table:
 *** 3.5-0ubuntu1 500
        500 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status
     2.10-1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages
     1.4-2ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu trusty/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu trusty/universe i386 Packages

How to revert system to state, when this package will be correctly detected?

Update

I found command:

sudo apt-get clean

Now i obtain:

sudo apt install gradle
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gradle is already the newest version (3.5-0ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 8 not to upgrade.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-pl) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1

Update2

dpkg -L gradle
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/gradle
/usr/share/doc/gradle/changelog.Debian.gz
/usr/share/doc/gradle/copyright

namei -lx /usr/bin/gradle
f: /usr/bin/gradle
Drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
                     gradle - No such file or directory
9
  • 1
    Try reinstalling it sudo apt-get install --reinstall gradle
    – muru
    May 17, 2017 at 5:52
  • Unfortunately the same effect.
    – Daniel
    May 17, 2017 at 6:01
  • 2
    Add the output of dpkg -L gradle and namei -lx /usr/bin/gradle, please.
    – muru
    May 17, 2017 at 6:02
  • 1
    So whichever PPA you're using for gradle doesn't provide the binary in the gradle package. It seems they have a separate gradle-3.5 package.
    – muru
    May 17, 2017 at 6:14
  • 1
    Then I suggest asking whoever made the PPA.
    – muru
    May 17, 2017 at 6:23

1 Answer 1

2

Finally thanks to comments of @muru I done the following steps:

I removed ppa:cwchien/gradle:

sudo rm -rf /etc/apt/sources.list.d/cwchien-ubuntu-gradle-xenial.*
sudo apt-get update

I installed old gradle from official repo:

sudo apt-get install gradle

Then all dependencies was installed correctly. Then I append cwchien-ubuntu-gradle-xenial again and installed again:

sudo apt-get install gradle-ppa gradle

Finally in website https://gradle.org/install I found command:

export PATH=$PATH:/opt/gradle/gradle-3.5/bin

That finally solved my problems, and now:

gradle -v

------------------------------------------------------------
Gradle 3.5
------------------------------------------------------------

Update

Now I installing gradle by sdkman.io by these commands:

Install sdkman

curl -s "https://get.sdkman.io" | bash 

Install gradle

sdk install gradle 4.0.2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .