O pacote está instalado e não é detectado. (gradle)

1

Eu instalei gradle pela maneira típica:

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.

Em seguida, eu queria usar este programa:

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

Eu estava tentando remover o java, purge gradle, removê-lo de qualquer lugar e instalar novamente. Nada ajuda ... O mais confuso é que este pacote estava funcionando corretamente alguns dias antes sem problemas.

Abaixo de alguns erros:

$ 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

Como reverter o sistema para o estado, quando este pacote será detectado corretamente?

Atualizar

Eu encontrei o comando:

sudo apt-get clean

Agora eu obtenho:

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
    
por Daniel 17.05.2017 / 07:44

1 resposta

2

Finalmente, graças aos comentários do @muru, fiz os seguintes passos:

Eu removi ppa:cwchien/gradle :

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

Eu instalei o gradle antigo do repositório oficial:

sudo apt-get install gradle

Então todas as dependências foram instaladas corretamente. Então eu adiciono cwchien-ubuntu-gradle-xenial novamente e instalei novamente:

sudo apt-get install gradle-ppa gradle

Finalmente, no site link , encontrei o comando:

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

Isso finalmente resolveu meus problemas e agora:

gradle -v

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

Atualizar

Agora eu estou instalando gradle sdkman.io por esses comandos:

Instale o sdkman

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

Instale o gradle

sdk install gradle 4.0.2
    
por Daniel 17.05.2017 / 08:52