How to fix “trying to overwrite …, which is also in package …” issue in linux

APT/DPKG error because of fileoverwrite

Let’s see how to solve the problem of apt or dpkg failing to install packages due to errors like the following. This is happening because the new package you are trying to install is overwriting a file that is part of another installed package.

dpkg_error trying to overwrite '/usr/lib/x86_64-linux-gnu/libldacBT_enc.so.2.0.2.3', which is also in package libldac:amd64 2.0.2.3~r26478861

Sample Error Message

dpkg: error processing archive /tmp/apt-dpkg-install-rf5BLm/15-libldacbt-enc2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libldacBT_enc.so.2.0.2.3', which is also in package libldac:amd64 2.0.2.3~r26478861
Preparing to unpack .../16-libldacbt-abr2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb ...
Unpacking libldacbt-abr2:amd64 (2.0.2.3.r4.gaf2dd23-5~ubuntu20.04) over (2.0.2.3+git20200429+ed310a0-5) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rf5BLm/16-libldacbt-abr2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libldacBT_abr.so.2.0.2.3', which is also in package libldac:amd64 2.0.2.3~r26478861

How to resolve the “trying to overwrite” Issue?

There are multiple solutions below based on when the error occurred. If you got the issue while running an apt command, then check the apt section. If it happened while running a dpkg command, then check the dpkg section.

With DPKG

If the error occurred while you were executing the apt command, then use the command as follows.

sudo dpkg -i --force-overwrite theDebYouWantToInstall.deb
sudo apt-get --fix-broken install

This command will install the deb file with file overwriting when needed.

With APT

If the error occurred while you were executing the dpkg command, then use the command as follows.

sudo apt-get -o Dpkg::Options::="--force-overwrite" [YourAptActionCommand]

#An Example
sudo apt-get -o Dpkg::Options::="--force-overwrite" dist-upgrade

#Another Example
sudo apt-get -o Dpkg::Options::="--force-overwrite" apt-get install nmap

This command will install the deb file with file overwriting when needed.

Comments

53 responses to “How to fix “trying to overwrite …, which is also in package …” issue in linux”

  1. … [Trackback]

    […] Find More here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  2. … [Trackback]

    […] Read More Information here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  3. … [Trackback]

    […] Information on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  4. … [Trackback]

    […] Find More Information here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  5. … [Trackback]

    […] Read More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  6. … [Trackback]

    […] There you will find 43963 additional Info on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  7. … [Trackback]

    […] Read More on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  8. … [Trackback]

    […] Read More Information here to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  9. … [Trackback]

    […] Read More Information here to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  10. … [Trackback]

    […] Find More Information here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  11. … [Trackback]

    […] There you can find 44563 additional Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  12. … [Trackback]

    […] Information on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  13. … [Trackback]

    […] Here you will find 32553 additional Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  14. … [Trackback]

    […] There you will find 17936 additional Information on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  15. … [Trackback]

    […] Read More Information here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  16. … [Trackback]

    […] Read More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  17. … [Trackback]

    […] Find More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  18. … [Trackback]

    […] There you can find 23466 more Information to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  19. … [Trackback]

    […] Here you will find 84474 more Information to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  20. … [Trackback]

    […] Read More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  21. … [Trackback]

    […] Here you can find 1344 additional Information to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  22. … [Trackback]

    […] Read More Information here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  23. … [Trackback]

    […] Find More here to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  24. … [Trackback]

    […] Read More on on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  25. … [Trackback]

    […] There you will find 32588 additional Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  26. … [Trackback]

    […] Info on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  27. … [Trackback]

    […] There you can find 99701 more Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  28. … [Trackback]

    […] Here you can find 63881 more Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  29. … [Trackback]

    […] Info on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  30. … [Trackback]

    […] There you will find 56300 additional Information on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  31. … [Trackback]

    […] Read More Info here on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  32. … [Trackback]

    […] Find More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  33. … [Trackback]

    […] Find More on that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  34. … [Trackback]

    […] Find More to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  35. … [Trackback]

    […] There you will find 10826 additional Info to that Topic: genuinecoder.com/how-to-fix-trying-to-overwrite-which-is-also-in-package-issue-in-linux/ […]

  36. cheapest buy enclomiphene canadian online pharmacy

    cheapest buy enclomiphene purchase australia

  37. online order androxal generic from canadian pharmacy

    get androxal generic alternative

  38. purchase flexeril cyclobenzaprine generic now

    buy flexeril cyclobenzaprine cheap canada

  39. buy cheap dutasteride price generic

    buy cheap dutasteride generic pharmacy online

  40. gabapentin comprar

    online order gabapentin generic order

  41. discount itraconazole canada over the counter

    buy cheap itraconazole generic buy online

  42. purchase fildena without a script

    fildena from canada

  43. cheap staxyn without a rx

    discount staxyn australia price

  44. online order avodart price in canada

    ordering avodart generic health

  45. rifaximin and overnight

    cheapest buy rifaximin how to purchase viagra

  46. online order xifaxan low cost

    purchase xifaxan generic india

  47. kamagra bez lテゥkaナ冱kテゥho pナ册dpisu pナ册s noc

    kde mナッナセete zテュskat kamagra bez lテゥkaナ冱kテゥho pナ册dpisu

Leave a Reply