O comando mvn
No caso de mvn
, você pode instalar maven
(v3, não v1) e maven2
(v2) lado a lado com:
sudo apt-get install maven maven2
e você terá dois binários.
/usr/share/maven/bin/mvn
/usr/share/maven2/bin/mvn
Para alternar entre os dois binários, use:
sudo update-alternatives --config mvn
Exemplo
% mvn -version
Apache Maven 2.2.1 (rdebian-17)
Java version: 1.8.0_45
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.19.0-22-generic" arch: "amd64" Family: "unix"
% sudo update-alternatives --config mvn
There are 2 choices for the alternative mvn (providing /usr/bin/mvn).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/share/maven2/bin/mvn 200 auto mode
1 /usr/share/maven/bin/mvn 150 manual mode
2 /usr/share/maven2/bin/mvn 200 manual mode
Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/share/maven/bin/mvn to provide /usr/bin/mvn (mvn) in manual mode
% mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-22-generic", arch: "amd64", family: "unix"
O comando node
No caso de node
, isso não é possível ou apenas com maior esforço:
% sudo apt-get install node nodejs-legacy
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
node : Conflicts: nodejs-legacy but 0.10.25~dfsg2-2ubuntu1 is to be installed
nodejs-legacy : Conflicts: node but 0.3.2-7.4 is to be installed
E: Unable to correct problems, you have held broken packages.