我正在尝试安装 davmail,
我已经手动安装了 JAVA(tar.gz 文件)。尝试后ppa:webupd8团队回购并没有取得好的结果。不得不清理很多文件包等等。
无论如何,当尝试安装 davmail 时,我收到此错误
$ sudo dpkg -i davmail_4.4.1-2225-1_all.deb
Selecting previously unselected package davmail.
(Reading database ... 174785 files and directories currently installed.)
Preparing to unpack davmail_4.4.1-2225-1_all.deb ...
Unpacking davmail (4.4.1-2225-1) ...
dpkg: dependency problems prevent configuration of davmail:
davmail depends on openjdk-7-jre | openjdk-6-jre | oracle-java7-jre | sun-java6-jre; however:
Package openjdk-7-jre is not installed.
Package openjdk-6-jre is not installed.
Package oracle-java7-jre is not installed.
Package sun-java6-jre is not installed.
dpkg: error processing package davmail (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Errors were encountered while processing:
davmail
并且JAVA配置完毕
$ java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
$ javac -version
javac 1.7.0_55
$ which java
/usr/bin/java
$ echo $JAVA_HOME
/opt/java/jdk1.7.0_55/
有没有办法告诉davmail我们已经安装了JAVA?
或者解决这个问题的方法?
update-alternatives 选项也已配置。
$ update-alternatives --list java
/opt/java/jdk1.7.0_55/bin/java
$ update-alternatives --display java
java - auto mode
link currently points to /opt/java/jdk1.7.0_55/bin/java
/opt/java/jdk1.7.0_55/bin/java - priority 100
Current 'best' version is '/opt/java/jdk1.7.0_55/bin/java'.
$ update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /opt/java/jdk1.7.0_55/bin/java
Nothing to configure.
答案1
这是一个快速但肮脏的解决方案,但您可以告诉dpkg
不要使用该--force-depends
选项检查依赖项是否安装。
# This will install davmail regardless of of whether or not its dependencies
# are installed
sudo dpkg -i --force-depends davmail_4.4.1-2225-1_all.deb
请注意,联机帮助页中有此选项的警告:
--force-things, --no-force-things, --refuse-things
Force or refuse (no-force and refuse mean the same thing)
to do some things. things is a comma separated list of
things specified below. --force-help displays a message
describing them. Things marked with (*) are forced by
default.
Warning: These options are mostly intended to be used by
experts only. Using them without fully understanding their
effects may break your whole system.
[...]
depends: Turn all dependency problems into warnings.
尽管没有必要解决您眼前的问题,但请注意,在手动安装 Java 时,如果您的目标是安装“官方”Java 的 Oracle 发行版,您应该使用make-jpkg
将 Oracletar.gz
存档转换为 .deb 包(请参阅此Debian 维基页面了解更多信息) :
make-jpkg jre-7u55-linux-x64.tar.gz
sudo dpkg -i oracle-java7-jre_7u55_amd64.deb
这允许 Java 包向Debian 替代系统让系统知道您已经安装了 Java 环境,并避免在安装依赖于 Java 的包时出现依赖问题。