Crossgrade from pkg to port for one thing? reddit / freebsd ---------------------------------------------------------------------- manys · 2022-02-07 23:15 I need some extra build options for dovecot that require me to use the port rather than the pkg that is currently installed (and maybe sieve, too, if the pkg can't handle the change). What's the best way to do this, `pkg remove` the package and then `make install` the port? Use FORCE_PKG_REGISTER? Something else? ---------------------------------------------------------------------- reddit_original · 2022-02-07 23:33 `pkg delete` There is no remove. Then do `make config` for your configuration. ---------------------------------------------------------------------- manys · 2022-02-08 00:12 There is `pkg remove`, but it looks like it might just be an alias? Weird. Anyway, it wants to delete pigeonhole, too, but as long as it doesn't remove config then I can just reinstall that all the same. ---------------------------------------------------------------------- nawcom · 2022-02-08 03:36 `pkg remove -f` (or delete) removes only the package requested and not its dependencies. delete is probably the original flag but I habitually use remove for some reason. It's the same as delete. I do this for a couple apps like ffmpeg when I need custom options. In my case l, to prevent `pkg upgrade` from installing ffmpeg pkg updates which don't have my custom requirements (assume i'm root in all example commands): `pkg lock ffmpeg` now when I run `pkg upgrade` it skips it. When I do want to compile and install updated ffmpeg, or need to recompile it due to its dependencies being updated via pkg upgrade: ``` pkg unlock ffmpeg pkg remove -f ffmpeg cd /usr/ports/multimedia/ffmpeg make clean install pkg lock ffmpeg ``` ---------------------------------------------------------------------- manys · 2022-02-08 05:22 Perfect, thanks! ---------------------------------------------------------------------- rodrigo975 · 2022-02-08 07:05 Why not using poudriere to build your package ? [https://docs.freebsd.org/en/books/handbook/book/#ports- poudriere](https://docs.freebsd.org/en/books/handbook/book/#ports- poudriere) Once build you can just replace the package using the pkg command pkg install my-fancy-package.pkg You can also use the locking mechanisms to avoid future auto-updates ---------------------------------------------------------------------- ShelLuser42 · 2022-02-08 09:29 While this is somewhat doable do keep in mind that it's not advisable to mis ports with packages because this could land you into dependency hell. The problem is that packages were build with default options in mind, and thus this is also expected of the packages they rely on. Therefor if you change too much then it's possible to create mismatches. This can become a huge problem when you're upgrading, as soon as a library changes or something else depending on Dovecot you may find things to get automatically removed. So... tread carefully here. ---------------------------------------------------------------------- parakleta · 2022-02-08 13:48 I use portmaster to manage this since it seems to do a good job of bringing the ports into the pkg space. I just make sure to lock all of my customised ports so pkg can’t blow them away with an update. ---------------------------------------------------------------------- manys · 2022-02-08 20:06 Because it's only one package. ---------------------------------------------------------------------- manys · 2022-02-08 20:10 I'm fine with that. I'm in the midst of moving this machine from all ports to (mostly) packages, I have my wits about me. I just didn't know how to ensure that one thing or another stayed in its place. ---------------------------------------------------------------------- grahamperrin · 2022-02-09 05:21 A single run of poudriere can: * build solely what's required (wasting neither time, nor resources) * download packages for everything that need *not* be built. See: * option `b` [ports-mgmt/poudriere-devel](https://www.freshports.org/ports- mgmt/poudriere-devel/) An example command: `poudriere bulk -j main -b latest -v -Ct mail/dovecot` ---------------------------------------------------------------------- grahamperrin · 2022-02-09 05:28 > … default options … expected of the packages … For the simplicity and understandability of this (until now, no-one else had *successfully* seeded the thought to me): * notionally, `+1` > … dependency hell. … I don't doubt that it's possible, but I have never been to that Hell, so (sorry): * `-1` There's **mixture by design** with poudriere. ---------------------------------------------------------------------- grahamperrin · 2022-02-09 05:38 ### The example, in reality [Building dovecot alone](https://i.imgur.com/Rq3oLtJ.png) * everything else, fetched. [Taking the hint to key Control-T](https://i.imgur.com/zQaF4jt.png) * build progress and statistics. Session transcript: * Then, assuming that you previously installed dovecot from something other than your `poudriere` repository: root@mowa219-gjp4-8570p-freebsd:~ # pkg upgrade -f -r poudriere dovecot Updating poudriere repository catalogue... Fetching meta.conf: 100% 163 B 0.2kB/s 00:01 Fetching packagesite.pkg: 100% 8 KiB 7.8kB/s 00:01 Processing entries: 100% The provides database is up-to-date. poudriere repository update completed. 19 packages processed. All repositories are up to date. Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): Installed packages to be REINSTALLED: dovecot-2.3.18 [poudriere] Number of packages to be reinstalled: 1 Proceed with this action? [y/N]: