Page 1 of 1

Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 09:27
by maverick6664
Hi,

I decided to build packages by myself with new compiler flags to optimize and found it was rather easy. I just write ~/.config/dpkg/buildflags.conf and build source packages. Then install (replace) them.

However, when invoking "apt upgrade", the replaced packages are overwritten by the original packages which are downloaded again. How can I stop it?

Thanks in advance!

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 10:31
by Segfault
14 years ago I had similar problem with Debian. I installed Gentoo to avoid going nuts.

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 11:14
by maverick6664
I had been using gentoo for nearly 10 years, but now I am using encrypted disks. So Gentoo is very difficult to install and I abandoned.

Now I solved my problem. I found https://www.tecmint.com/disable-lock-blacklist-package-updates-ubuntu-debian-apt/, which mentioned how to blacklist specified packages. But now I wonder how I can find blacklisted packages are newly updated in the distribution.....

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 11:46
by maverick6664
oh, my mistake??

Somehow, some blacklisted packages can be upgraded....others are blocked...why? It doesn't seem to work.

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 12:07
by Segfault
Going nuts, told ya ...

In Gentoo everything becomes super easy as soon as you understand how it works. Encryption included.

Edit: I lost the fight with "supercow" (apt-get), may you have better success!

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 12:58
by reinob
maverick6664 wrote:Hi,

I decided to build packages by myself with new compiler flags to optimize and found it was rather easy. I just write ~/.config/dpkg/buildflags.conf and build source packages. Then install (replace) them.

However, when invoking "apt upgrade", the replaced packages are overwritten by the original packages which are downloaded again. How can I stop it?

Thanks in advance!


AFAIK if you rebuild a package you have to change the version number/label so that apt et al. will consider it newer than the package version currently in the repository.

Of course, if a new version comes up, then the version number might be higher than what you have, so apt will want to replace it -- but anyway you will (probably) also want to rebuild your custom package based on the latest version..

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 13:02
by maverick6664
AFAIK if you rebuild a package you have to change the version number/label so that apt et al. will consider it newer than the package version currently in the repository.

Of course, if a new version comes up, then the version number might be higher than what you have, so apt will want to replace it -- but anyway you will (probably) also want to rebuild your custom package based on the latest version..


It's a nice idea! Yes, I want to know when the new version comes out, so that I can build my own customized one.

Thank you very much!!

EDIT: BTW as for Gentoo, I am fed up with their policy that they are providing both openrc and systemd options and Gentoo has a lot of web pages describing encryption and uefi, some of which are too old. And some packages are old. So I've abandoned.

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 13:13
by milomak
maverick6664 wrote:
AFAIK if you rebuild a package you have to change the version number/label so that apt et al. will consider it newer than the package version currently in the repository.

Of course, if a new version comes up, then the version number might be higher than what you have, so apt will want to replace it -- but anyway you will (probably) also want to rebuild your custom package based on the latest version..


It's a nice idea! Yes, I want to know when the new version comes out, so that I can build my own customized one.

Thank you very much!!

EDIT: BTW as for Gentoo, I am fed up with their policy that they are providing both openrc and systemd options and Gentoo has a lot of web pages describing encryption and uefi, some of which are too old. And some packages are old. So I've abandoned.

this should be helpful

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 14:47
by maverick6664


Thanks. But I found adding "a" or any alphabet or string after the version number manually worked. "a" is easy.

Regards,

-Tetsuji

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 15:24
by Bulkley
In an era of RPM "dependency hell" Debian offered relief with apt-get. The Debian advantage has always been its package management. Even its stability is a function of its package management. Of course, every solution generates new problems. I use the following when I want to hold a package.

Code: Select all
# apt-mark hold <package-name>

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-20 15:56
by Head_on_a_Stick
maverick6664 wrote:when invoking "apt upgrade", the replaced packages are overwritten by the original packages which are downloaded again. How can I stop it?

Add an epoch to the version for your package:

https://www.debian.org/doc/debian-polic ... ml#version

Re: Why are rebuilt packages overwritten by 'apt upgrade'?

PostPosted: 2018-11-21 01:26
by maverick6664
Head_on_a_Stick wrote:
maverick6664 wrote:when invoking "apt upgrade", the replaced packages are overwritten by the original packages which are downloaded again. How can I stop it?

Add an epoch to the version for your package:

https://www.debian.org/doc/debian-polic ... ml#version


Oh, nice idea!

Thanks, Head_on_a_Stick!!

And Segfault, I found a good way to use Gentoo; I am using VMware. So I'll install Gentoo on it, w/o encryption. Very easy!!

Regards,

-Tetsuji