The “package ‘xxx’ is not installed” error on Ubuntu occurs when you try to install an application or tool, but it has required dependencies that the system cannot automatically install when you run the command. This article will guide you on how to fix this error in the simplest and easiest way.

Causes of the Error
This error occurs because the Ubuntu system maintains a list of available software packages. If these packages have a version lower than the required version for the installation package, or if they have been replaced with a different package name, the system will throw an error, and you will need to install or upgrade those dependencies.
Steps to Fix the Error
Note: It’s important to correctly distinguish this error. This article specifically addresses the “package ‘xxx’ is not installed” error and does not deal with other errors.
Step 1: Update the System
First, ensure your system is up-to-date with the latest software packages and clean up any unnecessary packages by running the following command:
sudo apt update; sudo apt upgrade;
Step 2: Clean Up Software Packages
Run the following commands to clean up your system before installing new packages:
sudo apt-get clean
sudo apt-get autoremove
Step 3: Install Missing Dependencies
Typically, the “package ‘xxx’ is not installed” error occurs due to missing required dependencies.
Here’s a real-world example when installing Java on Ubuntu 22.04, where the error “package libc6-i386 is not installed” appears.

The screenshot below shows that Java 20 requires the libc6-i386
and libc6-x32
packages, but they have not been installed. Therefore, we need to install these two packages using the command:
sudo apt install libc6-i386 libc6-x32 -y

Once these dependencies are successfully installed, I will continue running the Java installation command, which previously encountered the error:
sudo dpkg -i jdk-20 linux-x64.deb
And the result is that Java has been successfully installed on my Ubuntu system.
This is an example of how to install Java software on Ubuntu. If you encounter a similar situation with another software, the solution is the same: When the terminal reports a missing package or a package that needs to be upgraded, simply install that package.
Basically,
“When the terminal reports that something is missing, just copy the exact package name and install it.”
By following these steps, you can easily fix the “package ‘xxx’ is not installed” error on Ubuntu. Remember to check the package name, regularly update your system, and ensure you install all necessary dependencies.