AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 915980
Accepted
Daniel
Daniel
Asked: 2017-05-17 21:44:10 +0800 CST2017-05-17 21:44:10 +0800 CST 2017-05-17 21:44:10 +0800 CST

软件包已安装但未检测到。(毕业)

  • 772

我通过典型方式安装了 gradle:

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.

接下来我想使用这个程序:

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

我试图删除 java,清除 gradle,从任何地方删除它并重新安装。没有任何帮助......最令人困惑的是,这个包几天前可以正常工作,没有任何问题。

下面是一些调试:

$ 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

当正确检测到这个包时,如何将系统恢复到状态?

更新

我找到了命令:

sudo apt-get clean

现在我得到:

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

更新2

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
software-installation
  • 1 1 个回答
  • 4596 Views

1 个回答

  • Voted
  1. Best Answer
    Daniel
    2017-05-17T22:52:25+08:002017-05-17T22:52:25+08:00

    最后感谢@muru 的评论,我完成了以下步骤:

    我删除了ppa:cwchien/gradle:

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

    我从官方仓库安装了旧的 gradle:

    sudo apt-get install gradle
    

    然后正确安装了所有依赖项。然后我再次追加cwchien-ubuntu-gradle-xenial并再次安装:

    sudo apt-get install gradle-ppa gradle
    

    最后在网站https://gradle.org/install我找到了命令:

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

    这终于解决了我的问题,现在:

    gradle -v
    
    ------------------------------------------------------------
    Gradle 3.5
    ------------------------------------------------------------
    

    更新

    现在我通过sdkman.io通过这些命令安装 gradle:

    安装 sdkman

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

    安装 gradle

    sdk install gradle 4.0.2
    
    • 2

相关问题

  • 如何在没有 root 访问权限的情况下安装软件包?

  • 设置 LAMP 堆栈的最简单方法是什么?

  • 我应该在哪里安装 sagemath?

  • How do I install Adobe Flash player?对于 11.10 及更高版本明确修复 11.10 上的 64 位 Flash

  • 如何设置软件中心为非 root 用户安装软件?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve