Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install a package from a PPA I've added. (Yes, I'm the author of the package if that helps in any way.)

Running a simple install command yields the following:

xxxxx@xxxxx:~$ sudo apt-get install opentracks
[sudo] password for xxxxx: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  opentracks
1 upgraded, 0 newly installed, 0 to remove
Need to get 1,834kB of archives.
After this operation, 184kB of additional disk space will be used.
(Reading database ... 218827 files and directories currently installed.)
Preparing to replace opentracks 0.0.2-1
    (using .../opentracks_0.0.5-1_amd64.deb) ...
Unpacking replacement opentracks ...
dpkg: error processing /var/cache/apt/archives/opentracks_0.0.5-1_amd64.deb
    (--unpack):
trying to overwrite directory '/usr/share/pixmaps' in package
    mysql-query-browser 5.0r14+openSUSE-2.1 with nondirectory
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/opentracks_0.0.5-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have emphasized the error... it seems like something is trying to overwrite /usr/share/pixmaps for some strange reason.

What could cause such an error?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Browsing the .deb package using File Roller and noticed /usr/share/pixmaps is not a directory, it is an image file (/usr/share/applications is also not a directory as it should be).

alt text

I believe the problem is with your Makefile, specifically these two lines:

cp -r images/* $(DESTDIR)/usr/share/pixmaps
cp other/opentracks.desktop $(DESTDIR)/usr/share/applications

Neither of the directories you are trying to copy to exist, so cp just creates new files $(DESTDIR)/usr/share/pixmaps and $(DESTDIR)/usr/share/applications

To fix this, modify your Makefile:

mkdir -p $(DESTDIR)/usr/share/pixmaps
mkdir -p $(DESTDIR)/usr/share/applications
cp -r images/* $(DESTDIR)/usr/share/pixmaps
cp other/opentracks.desktop $(DESTDIR)/usr/share/applications
share|improve this answer
    
Thanks... I should have known my Makefile would be responsible :) –  Nathan Osman Dec 14 '10 at 21:00
    
Well, its you Makefile being used to build the package in a clean chroot. Running make install, you probably won't run into this problem on most systems. But Debian packages are built in a minimal environment. –  andrewsomething Dec 14 '10 at 21:07

Type the following in terminal,

sudo dpkg -i --force-overwrite /var/cache/apt/archives/opentracks_0.0.5-1_amd64.deb
share|improve this answer
    
Is that really safe? This sounds like a fairly serious bug in the package. It seems to me that dpkg is doing the right thing. Overwriting /usr/share/pixmaps would cause quite a bit of data loss. –  andrewsomething Dec 14 '10 at 20:41
    
@andrewsomething: You're exactly right... most applications store their icon / image in that folder. Overwriting it would give... interesting... results :) –  Nathan Osman Dec 14 '10 at 21:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.