0

I tried the following, since I apply custom patches to some packages:

When apt-get upgrade shows packages to upgrade, I download the sources using apt-get source, apply my patches, rebuild, install (using dpkg -i). Then the latest version is installed. But even after apt-get update the packages I built manually and installed using dpkg still shows up in the upgrades and therefore would be overwritten again.

How can I fix that?

5
  • 4
    Give your custom packages a higher number then the original Ubuntu package. Are you manually patching each update to the package ? Which package ?
    – Panther
    Sep 19, 2014 at 21:04
  • bodhi.zazen: hm ... how would I do that in an automated manner? I let a script do this for me. (example package: apport). Why on earth would earth upgrade a package that has already the latest version number? Okay manually downloading the latest package and installing dpkg -i works as expected, but I checked the numbers ... package was build with "dpkg-buildpackage -j8 -rfakeroot -b"
    – Esokrates
    Sep 19, 2014 at 21:12
  • Are you certain that your manually-built package and the package which is installed by the upgrade have the same version number? (You can confirm this for example by running dpkg -l | grep packagename before and after the upgrade.)
    – fkraiem
    Sep 19, 2014 at 21:26
  • fkraiem: Absolutely sure (2.14.7-0ubuntu2)
    – Esokrates
    Sep 19, 2014 at 21:34
  • And you can clearly tell: "Unpacking apport (2.14.7-0ubuntu2) over (2.14.7-0ubuntu2) ...". What else could lead to the upgrade being shown when manually patched and built?
    – Esokrates
    Sep 19, 2014 at 21:45

1 Answer 1

0

This more a temporary note for others having the same issue until someone wiser can help to resolve the issue.

In my build script I put

VERSION=$(grep -R "Version: " | grep .dsc | head -1 | awk '{print $2}')
NEW_NUMBER=$((${VERSION: -1} + 1))
NEW_VERSION=$(echo $VERSION | sed "s/ubuntu${VERSION: -1}/ubuntu$NEW_NUMBER/")
grep -rl $VERSION | xargs sed -i "s/$VERSION/$NEW_VERSION/g"

right after apt-get source <package-name>

This will change the last number of the package version to the next higher digit (e.g. ubuntu2 will become ubuntu3).

This workaround works here.

FAST WAY TO REPRODUCE: Make sure the package you try this with is fully upgraded. Now when you do:

cd /tmp
apt-get -b source <package>
sudo dpkg -i *.deb

and check you will see that apt-get shows an upgrade for your package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .