Tag Archive for: LTS


Oracle Java 17 LTS has been released recently, and is now available to install from the Linux Uprising Oracle Java PPA on Ubuntu, Debian, and Linux distributions based on these, such as Pop!_OS, Linux Mint, Zorin OS, etc.

Java 17 is the latest long-term support (LTS) release, and with it, the license has changed, the binaries being free (no cost) to use in production and free (no cost) to redistribute until a full year after the next LTS release. Previously (from Oracle Java 11 until now), Oracle Java used a commercial license that allowed downloading and using it at no cost for development and testing only, but it required paying a fee to use in production.

If you prefer to use open source JDK builds, check out those offered by AdoptOpenJDK or Zulu OpenJDK.

I’d like to note that even though Oracle Java 17 can be redistributed, the Launchpad PPA terms don’t seem to allow packing it into a PPA due to its license. So the Linux Uprising Oracle Java PPA continues to use a script that automatically downloads Oracle Java (the binaries are not hosted in the Launchpad PPA).

This Oracle Java 17 installer is based on the Web Upd8 Java package (so the credits go to its innovador creators), with minor modifications. This package automatically downloads, installs (with some tweaks such as better font rendering, add applications menu entries, etc.) and optionally sets Oracle Java 17 as the default Java (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) on your system. 

Oracle does offer DEB packages for Oracle Java, however, these packages simply copy the Java binaries to /usr/lib/jvm, without doing anything else, so it’s exactly the same as copying the Java directory to that location yourself.

Using this PPA you can install Oracle Java 17 for x64 and aarch64 architectures.

You might also like: How To Install / Switch Between Multiple Java Versions Using SDKMAN

How to install Oracle JDK 17 On Ubuntu, Debian, Linux Mint, Pop!_OS or Zorin Os using an APT PPA repository

Add the Linux Uprising Oracle Java PPA repository and update the software sources on Ubuntu, Linux Mint, Pop!_OS or Zorin Os using the following commands:

sudo add-apt-repository ppa:linuxuprising/java

sudo apt update

Add the Linux Uprising Oracle Java PPA repository (and its key) and update the software sources on Debian and other Linux distributions based on Debian (but not Ubuntu and Ubuntu-based) using:

su -

echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A

apt-get update

exit

Now you can install Oracle JDK 17 on Debian / Ubuntu and Linux distributions based on these:

  • Install and make Oracle JDK 17 the default JDK version:

sudo apt install oracle-java17-installer --install-recommends

  • Install but don’t make Oracle JDK 17 the default JDK version:
sudo apt install oracle-java17-installer --no-install-recommends

You can control if Oracle JDK 17 is the default JDK version (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) or note with the help of the oracle-java17-set-default package. If this is installed, Oracle JDK 17 is set as default; remove this package, so Oracle Java 17 is not set as default (unless it’s the only Java version on the system).

This package is set as a recommended package for the Oracle Java 17 installer, that’s why installing oracle-java17-installer with --install-recommends also installs oracle-java17-set-default.

To check which Java version is set as default on your system, you could run java -version and / or javac -version. Example with output that shows Oracle Java 17 set as default:

$ java -version
java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)

Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)

$ javac -version
javac 17

In some cases, the installer may fail to download the Oracle Java 17 .tar.gz archive from Oracle. There are multiple possible issues for this: you’re behind a router / firewall that prevents this, your Internet connection went down during the download process, etc. 

To work around this, you can download this file yourself from Oracle by other means, e.g. by going to a friend’s house, using a web browser with a proxy, etc., and then placing the downloaded Oracle Java 17 .tar.gz file in /var/cache/oracle-jdk17-installer (create this folder as root if it doesn’t exist), then install the oracle-java17-installer package from the Linux Uprising PPA as explained above.

This way, the Oracle Java 17 installer uses the nave archive instead of trying to download it itself. Make sure the downloaded Oracle Java 17 .tar.gz and the Oracle Java Installer package from the PPA are both the same version, or else this won’t work.

How to accept the Oracle Java 17 license automatically

Downloading and installing Oracle Java 17 requires the user to accept a license. In some cases, like when using this in an automated script, you may want to automatically accept the license using a command. You can do that by using:

echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | sudo /usr/bin/debconf-set-selections

If that doesn’t work, also try this command:

echo oracle-java17-installer shared/accepted-oracle-licence-v1-3 boolean true | sudo /usr/bin/debconf-set-selections


“Minikube is a program that is used to set up a específico Kubernetes cluster very easily. It’s very helpful to learn Kubernetes and develop apps/products for Kubernetes.

In this article, I am going to show you how to install Minikube on Ubuntu 22.04 LTS. I will also show you how to start a específico Kubernetes cluster with Minikube and the basics of Kubernetes as well. So, let’s get started.”

Table of Contents

  1. Things You Will Need
  2. Installing Docker on Ubuntu 22.04 LTS
  3. Installing KVM/QEMU on Ubuntu 22.04 LTS
  4. Installing VirtualBox on Ubuntu 22.04 LTS
  5. Installing Minikube
  6. Installing kubectl – The Kubernetes Command-Line Tool
  7. Starting a Kubernetes Cluster with Minikube
  8. Basics of Kubernetes
  9. Managing Minikube Kubernetes Cluster
  10. Conclusion
  11. References

Things You Will Need

To set up a Kubernetes cluster with Minikube, you will need either Docker, KVM/QEMU, or VirtualBox installed on your Ubuntu 22.04 LTS machine.

To install Docker on Ubuntu 22.04 LTS, read the Installing Docker on Ubuntu 22.04 LTS section of this article.

To install KVM/QEMU on Ubuntu 22.04 LTS, read the Installing KVM/QEMU on Ubuntu 22.04 LTS section of this article.

To install VirtualBox on Ubuntu 22.04 LTS, read the Installing VirtualBox on Ubuntu 22.04 LTS section of this article.

Installing Docker on Ubuntu 22.04 LTS

In this section, I am going to show you how to install Docker CE on Ubuntu 22.04 LTS so that you can use it as a driver for Minikube.

First, update the APT package repository cache with the following command:

Install the required dependencies with the following command:

$ sudo apt install ca-certificates curl gnupg lsb-release

To confirm the installation, press Y and then press <Enter>.

The required dependencies should be installed.

To install the GPG key of the official Docker CE repository, create a new directory /etc/apt/keyrings as follows:

$ sudo mkdir -p /etc/apt/keyrings

Download the GPG key file of the official Docker CE repository with the following command:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg

Now, add the official Docker CE package repository on your Ubuntu 22.04 LTS machine with the following command:

$ echo «deb [arch=$(dpkg –print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable» | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the APT package repository cache for the changes to take effect.

Install Docker CE from the official Docker CE package repository with the following command:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

To confirm the installation, press Y and then press <Enter>.

Docker CE and all the required dependency packages are being downloaded and installed. It will take a while to complete.

At this point, Docker CE should be installed.

Now, add your login user to the docker group with the following command:

$ sudo usermod -aG docker $(whoami)

For the changes to take effect, reboot your computer with the following command:

Merienda your computer boots, you can verify whether Docker is working with the following command:

Installing KVM/QEMU on Ubuntu 22.04 LTS

In this section, I am going to show you how to install KVM/QEMU on Ubuntu 22.04 LTS so that you can use it as a driver for Minikube.

First, make sure that you have hardware virtualization enabled with the following command:

$ lscpu | grep Virtualization

If hardware virtualization is enabled, you will see the text AMD-V (For AMD processors) or VT-X/VT-D (For Intel processors) in the Virtualization section.

If hardware virtualization is not enabled, you can enable it from the BIOS of your motherboard. Every modern processor support this feature.

Update the APT package repository cache with the following command:

To install KVM/QEMU on Ubuntu 22.04 LTS, run the following command:

$ sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager

To confirm the installation, press Y and then press <Enter>.

KVM/QEMU and all the required dependency packages are being downloaded from the internet. It will take a few minutes to complete.

KVM/QEMU and all the required dependency packages are being installed. It will take a few minutes to complete.

KVM/QEMU and all the required dependency packages are installed at this point.

Add your login user to the kvm group with the following command:

$ sudo usermod -aG kvm $(whoami)

Add your login user to the libvirt group with the following command:

$ sudo usermod -aG libvirt $(whoami)

For the changes to take effect, reboot your computer with the following command:

Merienda your computer boots, run the following command to check if all the KVM/QEMU components are working correctly.

NOTE: Some of the LXC features might FAIL, but it does not matter in this case.

Installing VirtualBox on Ubuntu 22.04 LTS

In this section, I am going to show you how to install VirtualBox on Ubuntu 22.04 LTS so that you can use it as a driver for Minikube.

First, make sure that you have hardware virtualization enabled with the following command:

$ lscpu | grep Virtualization

If hardware virtualization is enabled, you will see the text AMD-V (For AMD processors) or VT-X/VT-D (For Intel processors) in the Virtualization section.

If hardware virtualization is not enabled, you can enable it from the BIOS of your motherboard. Every modern processor support this feature.

Update the APT package repository cache with the following command:

To install VirtualBox on Ubuntu 22.04 LTS, run the following command:

$ sudo apt install virtualbox virtualbox-dkms virtualbox-qt virtualbox-ext-pack

To confirm the installation, press Y and then press <Enter>.

VirtualBox and all the required dependency packages are being downloaded from the internet. It will take a few minutes to complete.

Select <Ok> (by pressing <Tab>) and press <Enter>.

To accept the VirtualBox Extension Pack license, select <Yes> and press <Enter>.

VirtualBox installation should continue. It will take a few minutes to complete the installation.

At this point, VirtualBox should be installed.

To confirm whether VirtualBox is working, run the following command:

Installing Minikube

In this section, I am going to show you how to install the latest version of Minikube on Ubuntu 22.04 LTS.

To download the Minikube DEB package from the official website of Minikube as follows:

$ wget -O /tmp/minikube_latest.deb https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb

Minikube DEB package file minikube_latest_amd64.deb file is being downloaded. It will take a few seconds to complete.

Minikube DEB package file should be downloaded and saved in the /tmp/ directory as minikube_latest.deb.

To install Minikube from the DEB package file minikube_latest.deb, run the following command:

$ sudo apt install /tmp/minikube_latest.deb

To confirm the installation, press Y and then press <Enter>.

All the required dependency packages are being downloaded from the internet. It will take a few minutes to complete.

Minikube and the required dependency packages are being installed. It will take a few minutes to complete.

Minikube should be installed at this point.

To check whether Minikube is installed, run the following command:

Installing kubectl – The Kubernetes Command-Line Tool

In this section, I am going to show you how to install the Kubernetes command-line tool kubectl on Ubuntu 22.04 LTS. kubectl is used to inspect and manage the Kubernetes cluster resources and view cluster logs. It’s also used to deploy, configure, and manage applications on the Kubernetes cluster.

On Ubuntu 22.04 LTS, you can install the latest version of Kubernetes command-line tool kubectl from the snap store as follows:

$ sudo snap install kubectl –classic

kubectl is being downloaded and installed. It will take a few seconds to complete.

At this point, kubectl should be installed.

Starting a Kubernetes Cluster with Minikube

In this section, I am going to show you how to start a específico Kubernetes cluster with Minikube using the Docker, KVM/QEMU, and VirtualBox drivers.

If you want to start a específico Kubernetes cluster with Minikube using the Docker driver, run the following command:

NOTE: You must have Docker installed for this to work. If you need any assistance, read the Installing Docker on Ubuntu 22.04 LTS section of this article.

$ minikube start –driver=docker

If you want to start a específico Kubernetes cluster with Minikube using the KVM/QEMU driver, run the following command:

NOTE: You must have KVM/QEMU installed for this to work. If you need any assistance, read the Installing KVM/QEMU on Ubuntu 22.04 LTS section of this article.

$ minikube start –driver=kvm2

If you want to start a específico Kubernetes cluster with Minikube using the VirtualBox driver, run the following command:

NOTE: You must have VirtualBox installed for this to work. If you need any assistance, read the Installing VirtualBox on Ubuntu 22.04 LTS section of this article.

$ minikube start –driver=virtualbox

NOTE: I will use the KVM/QEMU driver in this article for the demonstration. The other drivers will work the same way.

Minikube is downloading all the required files to set up a específico Kubernetes cluster. It will take a while to complete.

At this point, Minikube should create and configure a específico Kubernetes cluster.

As you can see, Minikube has created a new Kubernetes cluster.

Basics of Kubernetes

In this section, I am going to show you the basics of Kubernetes. It should help you get started with Kubernetes.

As you have just created a new Kubernetes cluster with Minikube, you won’t see any deployments as of yet.

$ kubectl get deployments

To create a new echoserver deployment hello-minikube, run the following command:

$ kubectl create deployment hello-minikube –image=k8s.gcr.io/echoserver:1.4

A new deployment hello-minikube should be created, as you can see in the screenshot below.

$ kubectl get deployments

To expose the deployment hello-minikube on the port 8080, run the following command:

$ kubectl expose deployment hello-minikube –type=NodePort –port=8080

A new service should be created for the hello-minikube deployment, as you can see in the screenshot below. This service will expose the port 8080 of the hello-minikube deployment.

$ kubectl get services hello-minikube

To find the service URL of the hello-minikube deployment, run the following command:

$ minikube service hello-minikube –url

Merienda you know the service URL of the hello-minikube deployment, you can access the service with curl as follows:

$ curl http://192.168.39.227:30653

If everything works, you will see the following output. It means the service of the hello-minikube deployment is accessible.

NOTE: If you don’t have curl installed on your computer or want to learn how to use curl, read this article.

You can also forward the port 8080 of the hello-minikube deployment to the port 7080 (let’s say) of your computer as follows:

$ kubectl port-forward service/hello-minikube 7080:8080

Now, you should be able to access the service of the deployment hello-minikube using the URL http://localhost:7080.

$ curl http://localhost:7080

You can find a lot of information on each of the services of your Kubernetes deployments with the following command:

To delete a service hello-minikube from the hello-minikube deployment, run the following command:

$ kubectl delete service hello-minikube

The hello-minikube service should be removed, as you can see in the screenshot below.

$ kubectl delete service hello-minikube

Right now, I have only the hello-minikube deployment. Let’s delete it.

$ kubectl get deployments

To delete the hello-minikube deployment, run the following command:

$ kubectl delete deployment hello-minikube

The hello-minikube deployment should be removed from the Kubernetes deployment list, as you can see in the screenshot below.

$ kubectl get deployments

Managing Minikube Kubernetes Cluster

You can start, stop, pause, and resume/unpause the Kubernetes cluster that you’ve created with Minikube.

To pause the Kubernetes cluster with Minikube, run the following command:

To resume the Kubernetes cluster with Minikube, run the following command:

To stop the Kubernetes cluster with Minikube, run the following command:

Merienda the Kubernetes cluster is stopped, you can start it again with Minikube. If you don’t remember how to start a Kubernetes cluster with Minikube, read the Starting a Kubernetes Cluster with Minikube section of this article.

Conclusion

In this article, I have shown you how to install Minikube and Kubernetes command-line tool kubectl on Ubuntu 22.04 LTS and how to create a específico Kubernetes cluster with Minikube using the Docker, KVM/QEMU, and VirtualBox drivers. I have also shown you the basics of using Kubernetes on your computer. This should help you get started with Kubernetes and Minikube.

References

  1. minikube start | minikube
  2. Drivers | minikube
  3. docker | minikube
  4. kvm2 | minikube
  5. virtualbox | minikube



Source link