Introduction
In this tutorial we learn how to install libguice-java
on Ubuntu 18.04.
What is libguice-java
libguice-java is:
Guice provides support for dependency injection using annotations to
configure Java objects. Dependency injection is a design pattern whose
core principle is to separate behavior from dependency resolution.
Guice allows implementation classes to be programmatically bound to
an interface, then injected into constructors, methods or fields
using an @Inject annotation. When more than one implementation of
the same interface is needed, the user can create custom annotations
that identify an implementation, then use that annotation when
injecting it.
There are three methods to install libguice-java
on Ubuntu 18.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install libguice-java Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install libguice-java
using apt-get
by running the following command:
sudo apt-get -y install libguice-java
Install libguice-java Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install libguice-java
using apt
by running the following command:
sudo apt -y install libguice-java
Install libguice-java Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install libguice-java
using aptitude
by running the following command:
sudo aptitude -y install libguice-java
How To Uninstall libguice-java on Ubuntu 18.04
To uninstall only the libguice-java
package we can use the following command:
sudo apt-get remove libguice-java
Uninstall libguice-java And Its Dependencies
To uninstall libguice-java
and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:
sudo apt-get -y autoremove libguice-java
Remove libguice-java Configurations and Data
To remove libguice-java
configuration and data from Ubuntu 18.04 we can use the following command:
sudo apt-get -y purge libguice-java
Remove libguice-java configuration, data, and all of its dependencies
We can use the following command to remove libguice-java
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge libguice-java
References
Summary
In this tutorial we learn how to install libguice-java
package on Ubuntu 18.04 using different package management tools: apt
, apt-get
and aptitude
.