You are not logged in.

#1 2025-01-09 10:03:41

Beemo
Member
Registered: 2024-12-20
Posts: 84

[Solved] Replace installed package executable with self-compiled one?

If I want to temporarily* use a different executable for a package that was installed via pacman, can I just replace it or will I run into problems later when updating?
The package is not a dependency of any others.

*Pre-release, different build option etc, it's expected to be overwritten when the next update comes.

Last edited by Beemo (2025-01-09 15:47:09)

Offline

#2 2025-01-09 10:07:41

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,529
Website

Re: [Solved] Replace installed package executable with self-compiled one?

Why don't you just clone the official packaging sources and install your modified version as a package?

Offline

#3 2025-01-09 10:31:26

Beemo
Member
Registered: 2024-12-20
Posts: 84

Re: [Solved] Replace installed package executable with self-compiled one?

Interesting, I've never done this so I look into it a bit more.
Currently my concerns for this approach are: Will it conflict with / overwrite the official package? Will it leave leftovers when I uninstall the package?

Last edited by Beemo (2025-01-09 10:32:01)

Offline

#4 2025-01-09 10:54:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,182

Re: [Solved] Replace installed package executable with self-compiled one?

You can do a "custom" version that will get logically overwritten by the next update. FWIW the link you mention doesn't help with your problem, the proper way of replacing/rebuilding an existing package is described in: https://wiki.archlinux.org/title/Arch_build_system

If you package it properly all leftovers will get replaced when the official update happens or you remove it.

Last edited by V1del (2025-01-09 10:55:44)

Offline

#5 2025-01-09 11:16:31

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,529
Website

Re: [Solved] Replace installed package executable with self-compiled one?

The easiest trick is to increment the pkgrel from x to x.1 so that any other update overwrites the package.
Generally the workflow could look like this:

$ sudo pacman -S devtools
$ pkgctl repo clone --protocl=https <package>
$ pkgctl build --edit --install-to-host auto <package>

Last edited by gromit (2025-01-09 11:16:50)

Offline

Board footer

Powered by FluxBB