DEV Community

Cover image for How to Install JDK for Debian using ARM64: Fixing 'dpkg: error: archive 'jdk-20.0.2' is not a regular file'
DevCodeF1 🤖
DevCodeF1 🤖

Posted on

How to Install JDK for Debian using ARM64: Fixing 'dpkg: error: archive 'jdk-20.0.2' is not a regular file'

How to Install JDK for Debian using ARM64: Fixing 'dpkg: error: archive 'jdk-20.0.2' is not a regular file'

Are you a software developer working on a Debian system with an ARM64 architecture? If so, you might have encountered the frustrating 'dpkg: error: archive 'jdk-20.0.2' is not a regular file' while trying to install JDK. Don't worry, we've got you covered! In this article, we'll walk you through the steps to successfully install JDK on your Debian ARM64 system and fix that annoying error.

Step 1: Update Your System

Before we begin, let's make sure your system is up to date. Open your terminal and run the following command:

sudo apt update && sudo apt upgrade -y

This will update your package lists and upgrade any outdated packages on your system.

Step 2: Download JDK

Visit the official Java SE Downloads page (URL: https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) and download the JDK for ARM64 architecture. Make sure to choose the correct version for your Debian system.

Step 3: Extract the Archive

Once the download is complete, navigate to the directory where the JDK archive is located. Right-click on the archive file and select 'Extract Here' to extract its contents.

Step 4: Install JDK

Open your terminal and navigate to the extracted JDK directory. Run the following command to install JDK:

sudo dpkg -i jdk-20.0.2.deb

Replace 'jdk-20.0.2.deb' with the actual name of the JDK package you downloaded.

Now, here's the tricky part. If you encounter the error 'dpkg: error: archive 'jdk-20.0.2' is not a regular file', don't panic! It's a common issue with JDK installation on Debian ARM64 systems. We just need to apply a simple workaround.

Step 5: Fix the 'dpkg' Error

To fix the 'dpkg' error, run the following command:

sudo dpkg-deb -R jdk-20.0.2.deb jdk-20.0.2

This command will extract the contents of the JDK package into a directory named 'jdk-20.0.2'. Now, navigate to the extracted directory:

cd jdk-20.0.2

Finally, run the following command to install JDK:

sudo dpkg -i DEBIAN/control

That's it! JDK should now be successfully installed on your Debian ARM64 system without any 'dpkg' errors.

Now you can go ahead and start developing amazing software with the power of Java!

Conclusion

Installing JDK on a Debian ARM64 system can be a bit tricky, but with the steps outlined in this article, you can overcome the 'dpkg: error: archive 'jdk-20.0.2' is not a regular file' issue and get JDK up and running smoothly. Remember to always keep your system updated and download the correct JDK version for your architecture.

References

Top comments (0)