Skip to main content
Home
Dave Lane

Main navigation

  • Abilities
  • Blog
  • CV
  • About
    • About
    • This Site
    • Commercial Terms
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home

Fixing the 'trying to overwrite' error when updating a GNU/Linux system via apt/apt-get

Profile picture for user dave
By dave , 16 November 2021

I recently ran into an issue upgrading a Ubuntu 18.04-powered server I run. I usually run the following command:

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt list --upgradable && df -h && sudo service nginx reload

but it failed trying to install, of all things, an upgrade 'vim-tiny' package with an error:

dpkg: error processing archive /var/cache/apt/archives/vim-tiny_2%3a8.0.1453-1ubuntu1.7_amd64.deb (--unpack):
trying to overwrite '/usr/share/vim/vim80/doc/help.txt', which is also in package vim-runtime 2:8.0.1453-1ubuntu1.7
Errors were encountered while processing:
/var/cache/apt/archives/vim-tiny_2%3a8.0.1453-1ubuntu1.7_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I was stuck. A quick search suggested that I try the command:

sudo apt --fix-broken  install

but that didn't work either, failing with precisely the same error as above.

Finally, after much searching, I found the right answer:

sudo dpkg --configure --force-overwrite -a

I hope this helps someone!

 

 

The content of this field is kept private and will not be shown publicly.
About text formats

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

C A Exton (not verified)

3 years 3 months ago

Very good! Thanks a lot!

Very good! Thanks a lot!

  • Reply

MarcG (not verified)

2 years 9 months ago

In reply to Very good! Thanks a lot! by C A Exton (not verified)

thanks!! that got me going on

thanks!! that got me going on jammy upgrade !!

  • Reply
  • Add new comment

Note to commenters: due to problems with spam comments, your comment will only appear on this site after it's been deemed (by me) to be legitimate.

Blog posts

Why Slack is better, and why open communities shouldn't use it
7 Mar 2018 - 14:16
Modern Trade Agreements and the Mega-corporate End Game
26 Jan 2018 - 09:06
Why should we open source our code?
18 Nov 2017 - 21:19
Understanding Free and Open Source Software
10 Oct 2017 - 10:00
How NZ National could partner with the NZ Greens
30 Sep 2017 - 17:53
NZFuelFail - Worthy of further investigation?
22 Sep 2017 - 15:01
NZ 2017 Election Voting Advice
13 Sep 2017 - 15:12

Pagination

  • Previous page
  • 6
  • Next page
More posts...
RSS feed

Creative Commons License - CC By attribution, Share alike - International 4.0

Contact Dave!
Download Dave's CV
Eliminate DRM!

Contact Modes

Social Media

Software

Terms of Engagement
Terms of Reference
Powered by Drupal