Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

apt-get upgrade package without backup

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
gibi
Posts: 2
Joined: 2017-04-19 07:51

apt-get upgrade package without backup

#1 Post by gibi »

Hi all,

I maintain a debian package which contains several files for my embedded board

Code: Select all

>dpkg --contents myBootloader_1.0-3_armhf.deb
drwxr-xr-x root/root         0 2017-03-14 13:54 ./
drwxr-xr-x root/root         0 2017-03-14 13:53 ./boot/
-rw-r--r-- root/root     10284 2017-03-14 13:53 ./boot/devicetree.dtb
-rw-r--r-- root/root       230 2017-03-14 13:53 ./boot/uEnv.txt
...
Later I updated the devicetree.dtb. and changed the version of the package from 1.0-2 to 1.0-3. Because the boot partition is formatted as vfat, I got an error when I ugraded the package by apt-get.

Code: Select all

dpkg: error processing archive /var/cache/apt/archives/myBootloader_1.0-3_armhf.deb (--unpack):
 unable to make backup link of `./boot/devicetree.dtb' before installing new version: Operation not permitted
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/myBootloader_1.0-3_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The problem is that dpkg tries to create a link on the boot partition to backup the old files. But since the boot partition is vfat no links can be created.
So I had the following ideas:
  • in debian/control add a conflict to the own package so apt-get removes first the old version (does not work)
  • install the files in another temporary place of the ext4 partition and copy the files from /boot in the postinst script (is not really a clean and solution)
Do you have any other ideas to handle this problem? Or is there an official way to do it? To upgrade the package without removing the old one manually before?

bigrigdriver
Posts: 145
Joined: 2014-09-01 17:04
Location: East Central Illinois, USA

Re: apt-get upgrade package without backup

#2 Post by bigrigdriver »

Have you looked at the possibility of using dpkg-divert to handle that?
Registered GNU/Linux user #170078

Go ask google before you ask on these boards.

It it isn't broken, Tweak It !!!

gibi
Posts: 2
Joined: 2017-04-19 07:51

Re: apt-get upgrade package without backup

#3 Post by gibi »

Thanks for the reply.

I haven't but dpkg-divert is to prevent another specific package to update a file, in my example the devicetree.dtb
Because I do not need this prevention I also just can move the devicetree in the preinst script and remove/copy it back in the postinst depending on the success of the installation.

Anyhow it looks like there is no way to get around the pre- and postinst scripts :)

Post Reply