Can't uninstall package, trying to "overwrite" a file

Solution 1:

To resolve your current situation run the commands below:

sudo dpkg --purge --force-all gtk2-devel
sudo dpkg --configure -a
sudo apt-get install -f

and then install normally available development package for Gtk2+:

sudo apt-get update
sudo apt-add-repository universe
sudo apt-get install libgtk2.0-dev

Please do not invent RPM-based abstractions on top of normal mature and fully functional APT system. Next time please visit https://packages.ubuntu.com/ first to prevent such situations.

Stuff to read:

  • https://help.ubuntu.com/lts/ubuntu-help/addremove.html.en
  • man apt locally or online
  • man dpkg locally or online