Home

About Us

Advertisement

Contact Us

PRIVACY POLICY

  • Facebook
  • X
  • Instagram
  • Pinterest
  • WhatsApp
  • RSS Feed
  • TikTok
ALT

Maalavs Blog

Your Trusted Voice Across the World.

  • NEWS
  • Linux Tech Blogs
  • Windows Tech Blogs
  • VIRTUALIZATION Blogs
Search

Removing Duplicate Packages in Linux

Duplicate packages can sometimes be present in a system due to incomplete or failed yum transactions. This can cause inconsistencies and unexpected behavior in package management. To resolve this issue, it is crucial to identify and safely remove duplicate packages from the system.


Issue Details

Identifying Duplicate Packages

You can check for duplicate packages using the following commands:

  1. Checking Specific Packages: rpm -qa | grep -i <package-name> Example: rpm -qa | grep -i git-1.8. Sample Output: perl-Git-1.8.3.1-24.el7_9.noarch perl-Git-1.8.3.1-25.el7_9.noarch git-1.8.3.1-24.el7_9.x86_64 git-1.8.3.1-25.el7_9.x86_64
  2. Checking for System-Wide Duplicate Packages: package-cleanup --dupes Sample Output: httpd-2.4.6-98.el7_9.7.x86_64 httpd-2.4.6-99.el7_9.1.x86_64 pki-base-java-10.5.18-27.el7_9.noarch pki-base-java-10.5.18-25.el7_9.noarch git-1.8.3.1-24.el7_9.x86_64 git-1.8.3.1-25.el7_9.x86_64

Steps to Remove Duplicate Packages

Step 1: Take a Snapshot of the VM

Before making any changes, take a full snapshot of the virtual machine to ensure you have a restore point in case of any issues.

Step 2: Remove the Duplicate Packages

Once the snapshot is taken, use the following command to remove the older or unwanted duplicate package:

rpm -e <package-name> --nodeps --justdb

Example:

rpm -e httpd-2.4.6-98.el7_9.7.x86_64 --nodeps --justdb

Explanation of Flags:

  • rpm -e: Removes the package.
  • --nodeps: Ignores dependency checks, which prevents removing dependent packages.
  • --justdb: Modifies the RPM database without actually deleting the package files from the filesystem.

Step 3: Verify the Removal

After removing the duplicates, verify that only the correct package versions remain:

rpm -qa | grep -i <package-name>

Example:

rpm -qa | grep -i git-1.8.

Reference Article

For more details on handling duplicate packages, refer to the following Red Hat Knowledge Base Article:

Title: How to remove duplicate packages from a failed yum transaction
Link: Red Hat Solution


Conclusion

Following the steps above, you can safely identify and remove duplicate packages from your system. Always ensure to take necessary backups or snapshots before proceeding with any package removal to avoid any disruptions.

Featured Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025
  • Manchester United Announces Job Cuts Amid Financial Restructuring

    Manchester United Announces Job Cuts Amid Financial Restructuring

    February 26, 2025
  • Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    February 26, 2025

Search

Author Details

Madhan Gopalakrishnan

I am a passionate “tech blogger” with a knack for breaking down complex topics into simple insights or exploring the latest trends in AI With 5 years of experience in IT Infra implementation and maintenance, I love to share knowledge through in-depth articles and practical tips. When not writing, you can find my hobby “traveling to offbeat destinations”.

  • X
  • Instagram
  • TikTok
  • Facebook

Follow Us on

  • Facebook
  • X
  • Instagram
  • VK
  • Pinterest
  • Last.fm
  • TikTok
  • Telegram
  • WhatsApp
  • RSS Feed

Categories

  • Article (15)
  • NEWS (73)

Archives

  • February 2025 (88)

Tags

About Us

Maalavs Magazine

It is your hub for the latest news across all domains, from technology and business to travel and innovation. We bring insightful updates, expert opinions, and engaging content to keep you informed and ahead. Whether you’re a tech enthusiast, a business professional, or a curious reader, we’ve got something for you. Stay updated with Maalavs Magazine!

Latest Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025

Categories

  • Article (15)
  • NEWS (73)
  • Instagram
  • Facebook
  • LinkedIn
  • X
  • VK
  • TikTok

Proudly Powered by Maalavs | Maalavs Magazine

Scroll to Top