0

** I was trying to upgrade ubuntu but getting this while running command ( sudo apt-get update && sudo apt-get upgrade -f)

Do you want to continue? [Y/n] Y Get:1 http://europe-west4-b.gce.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 google-compute-engine all 20201222.00-0ubuntu216.04.0 [12.9 kB] Fetched 12.9 kB in 0s (44.1 kB/s) (Reading database ... 175234 files and directories currently installed.) Preparing to unpack .../google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb ... Unpacking google-compute-engine (20201222.00-0ubuntu216.04.0) ... dpkg: error processing archive /var/cache/apt/archives/google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb (--unpack): trying to overwrite '/etc/dhcp/dhclient-exit-hooks.d/google_set_hostname', which is also in package gce-compute-image-packages 20201222.00-0ubuntu216.04.0 Errors were encountered while processing: /var/cache/apt/archives/google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

**

karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

0

You need to remove the offending package first, which in the case of your example is gce-compute-image-packages, so your command would be:

sudo apt remove gce-compute-image-packages
Serj Sagan
  • 99
  • 2