The “package ‘xxx’ is not installed” error on Ubuntu can be a major obstacle, preventing you from installing essential software for work or leisure. Don’t worry, this article will guide you through identifying the causes and fixing this error in detail.
Causes of the Error
This occurs when the Ubuntu system maintains a list of available dependencies. If these packages have lower versions than required by the installation package, or if they have been replaced with a different package name, your system will report an error, and you’ll need to install or upgrade those dependencies.
Troubleshooting Steps
Step 1: Update Your System
First, ensure your system is updated with the latest software packages and clean up any unnecessary packages by running the following commands in sequence:
sudo apt update; sudo apt upgrade;
Step 2: Clean Up Software Packages
Execute the commands to ensure a clean 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 because dependencies required by the main software package are not yet installed. Let’s look at a practical example:
I’ll illustrate this with a real-world scenario of installing Java on Ubuntu 22.04, where the error “package libc6-i386 is not installed” is encountered. Please refer to the screenshot below.
The screenshot indicates that Java 20 depends on the libc6-i38
6 and libc6-x32
packages, but they are not currently installed on the system. Therefore, we need to install these two packages:
sudo apt install libc6-i386 libc6-x32 -y
After successfully installing the dependencies, I will now proceed to run the command to install Java, which previously encountered an error.
sudo dpkg -i jdk-20 linux-x64.deb
And there you have it, Java has been successfully installed on my Ubuntu system. This serves as an example of how to install Java software on Ubuntu. If you encounter similar situations with other software, the approach is the same: when the Terminal indicates a missing package or the need to upgrade a package, simply install that package.
By following the steps above, you can easily resolve the “package ‘xxx’ is not installed” error on Ubuntu. Remember to double-check the package name, update your system regularly, and install all necessary dependencies.