Ubuntu – ‘trying to overwrite file already in shotwell-common package’ while installing shotwell from the PPA

dpkg

I am trying to update my version of Shotwell. Well, my Ubuntu system is. I am getting the following apt-get error. Can anyone tell me how to resolve it? I have tried a few different things so now asking for help.

root@nathanr-XPS-630i:/home/nathanr# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  shotwell
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 25.5 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ppa.launchpad.net/yorba/ppa/ubuntu/ saucy/main shotwell i386 0.15.1-1~saucy1 [10.8 MB]
Fetched 10.8 MB in 2min 16s (79.5 kB/s)                                                                                                                                                
(Reading database ... 316303 files and directories currently installed.)
Preparing to replace shotwell 0.15.0-0ubuntu1 (using .../shotwell_0.15.1-1~saucy1_i386.deb) ...
Unpacking replacement shotwell ...
dpkg: error processing /var/cache/apt/archives/shotwell_0.15.1-1~saucy1_i386.deb (--unpack):
 trying to overwrite '/usr/share/icons/hicolor/24x24/apps/shotwell.svg', which is also in package shotwell-common 0.15.0-0ubuntu1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
No apport report written because MaxReports is reached already                                                              Processing triggers for     software-center ...
INFO:softwarecenter.db.update:translation information in database is up-to-date
Processing triggers for hicolor-icon-theme ...
Errors were encountered while processing:
 /var/cache/apt/archives/shotwell_0.15.1-1~saucy1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any suggestions what I need to do?

Best Answer

Try this command on terminal,

sudo dpkg -i --force-overwrite /var/cache/apt/archives/shotwell_0.15.1-1~saucy1_i386.deb

This error occurs when some file was moved from one package to another in a newer version.

In your case dpkg trying to extract shotwell.svg file from /var/cache/apt/archives/shotwell_0.15.1-1~saucy1_i386.deb to /usr/share/icons/hicolor/24x24/apps/ directory.But there was already a shotwell.svg file in that directory.So this type of error occurs.

By running dpkg -i --force-overwrite command,the previously located file shotwell.svg was forcely overwrited by the file from the /var/cache/apt/archives/shotwell_0.15.1-1~saucy1_i386.deb while installing.

Here is the source.

Related Question