Update of java-11-openjdk-headless or java-17-openjdk-headless fails with unpacking error: cpio: File from package already exists as a directory

Solution Verified - Updated -

Issue

  • Attempting to update or reinstall the java-11-openjdk-headless or java-17-openjdk-headless package on RHEL fails with unpacking errors.:

    # yum update java-11-openjdk-headless
    . . .
    Error unpacking rpm package java-11-openjdk-headless-1:11.0.25.0.9-7.el9.x86_64
    error: unpacking of archive failed on file /usr/lib/jvm/java-11-openjdk-11.0.25.0.9-7.el9.x86_64/conf;...: 
    cpio: File from package already exists as a directory in system
    
  • A similar error may occur for Java 17:

    error: unpacking of archive failed on file /usr/lib/jvm/java-17-openjdk-17.0.16.0.8-2.el8.x86_64/conf;
    cpio: File from package already exists as a directory in system
    

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • java-11-openjdk-headless
  • java-17-openjdk-headless

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content