# Installing packages and ports during installation



## macondo (Sep 9, 2021)

Is it viable to do an installation mixing ports and packages?

I plan to install xorg and Firefox as packages, and then the rest: menumaker icewm lxterminal xfe hexchat numlockx 
unclutter neofetch inxi as ports (compiling).

Is this possible or am I opening a Pandora Box??


----------



## sidetone (Sep 9, 2021)

I do that all the time, and it works fine.

Many insist not to do it, but it's easy to fix when upgrades break. Usually, for Xorg and GPU dependencies, all it takes is a reinstall, then everything works well.


It's pretty simple to fix, and takes a fraction of the time than compiling everything, if an upgrade doesn't happen as smoothly. The problems, I've had is the screen resolution changes and it realigns applications on my desktop after upgrading Xorg or GPU dependencies. That fixes easily, by reinstalling, or readjusting geometry or text size for desktop application placement. For instance, geometry or font settings of urxvt may have to be re-adjusted on my desktop.

Also, if choosing to mix ports and packages, make sure both are from the same branch of latest or quarterly.


----------



## fel1x (Sep 9, 2021)

sidetone said:


> I do that all the time, and it works fine.
> 
> Many insist not to do it, but it's easy to fix when things break. Usually, for Xorg and GPU dependencies, all it takes is a reinstall, then everything works well.


As he said, I recommend not to make your installation complicated. However, problems happened by pkgs and ports would not break the *system*, so you can reinstall them if something wrong happened.


----------



## macondo (Sep 9, 2021)

Thank you very much!


----------



## Lamia (Sep 9, 2021)

I do it several times when upgrade from our poudrière fails us. I would prefer to install from ports all dependencies and pkgs but only resort to 'pkg install' when ports can't deliver.


----------



## richardtoohey2 (Sep 9, 2021)

sidetone said:


> Many insist not to do it, but it's easy to fix when upgrades break


I think what people want to avoid is unhappy punters who have tried to mix 'n' match (pkgs and ports) and have ended up in trouble.  And then asking for help here after being told not to do it.

If you don't mind _potentially_ having a mess you have to sort out yourself, then go for it.

But if things get a bit messy and you arrive on these forums saying "it didn't work" you may get tetchy answers.

It's recommended that you stick to binary packages, but it's up to you.

I don't mix them myself (either do all one or all the other) but notice people talking about the difference between quarterly and latest.  Ports will be latest, so I _think_ you need to make sure your packages are also latest (default is quarterly) but sure someone will come and correct me if I'm wrong. <Dons flameproof suit and waits>


----------



## Geezer (Sep 9, 2021)

I have been doing it for ages, mixing ports and packages from quarterly. No problems.

There comes a point where the management of both becomes increasingly less automated, so now I am using ports-mgmt/synth, which neatly handles both.


----------



## gpw928 (Sep 9, 2021)

richardtoohey2 said:


> I don't mix them myself (either do all one or all the other)


I have to recompile sendmail to get the options I need to commune with my ISP.  So it has to come from ports.

However, it's simply impractical to compile my chosen web browser, and all it's dependencies, once a week to get the latest patches.

Ditto X11, ditto everything else (I do remember when it took three days to compile XFree86 or gcc on a 486, so things have improved, somewhat).

So I use packages where ever possible, and ports where not.  But I really don't have a choice not to mix them.


----------



## sidetone (Sep 9, 2021)

richardtoohey2 said:


> But if things get a bit messy and you arrive on these forums saying "it didn't work" you may get tetchy answers.


I don't understand why there needs to be a blame game about it. If it doesn't work, others and I would give an answer when/if we have one. Usually the answer is self-explanatory, to recompile the top level program, where it failed, or from an educated guess on what went wrong, even if it was installed from packages. Compiling the top level program usually fixes libraries.



Geezer said:


> I have been doing it for ages, mixing ports and packages from quarterly. No problems.


That's a safer way. I use latest for both.


----------



## macondo (Sep 9, 2021)

Gents, it's been an education, thank you all!


----------



## richardtoohey2 (Sep 9, 2021)

sidetone said:


> I don't understand why there needs to be a blame game about it. If it doesn't work, others and I would give an answer when/if we have one.


I was thinking about the posts where "this doesn't happen with OS Z, FreeBSD sux" etc.  "I've loaded both barrels and pointed the gun at my feet and how was I to know THIS would happen?"

My understanding is that the "official" advice is to use binary packages, but as you and others have pointed out - that doesn't always work, YMMV and all that.  One size does not fit all.

I got into the habit of using ports long ago, and it worked well in the days of OpenSSL 1.0.2 in base versus 1.1.1 in ports, but I don't think it matters so much with FreeBSD 13.x.

And I should say I'm a mostly CLI/server user, so apart from some monsters like cmake and mysql-server building from ports isn't _too_ bad for my use-case. But if building desktops, browsers, Rust, etc. ports would be a lot of work, so it would be tempting to mix 'n' match (and sometimes unavoidable.)

But think it needs at least a small "here be dragons" sticker.  Maybe.


----------



## Geezer (Sep 9, 2021)

richardtoohey2 said:


> But think it needs at least a small "here be dragons" sticker.  Maybe.



If you are going to use Freebsd at all, you have got to be prepared to get your feet wet.


----------



## sidetone (Sep 9, 2021)

richardtoohey2 said:


> I was thinking about the posts where "this doesn't happen with OS Z, FreeBSD sux" etc.


That's them. They won't be satisfied and prefer Ubuntu anyway.


richardtoohey2 said:


> "I've loaded both barrels and pointed the gun at my feet and how was I to know THIS would happen?"


This is people panicking because they don't know how to fix things. Scolding, for something that's not like that, is unnecessary. It's frankly annoying. I mix packages and ports all the time. It's like popping a bicycle tire, then saying the whole bike is ruined. Patch or replace the tire, and put green slime in it. Don't put that in a car tire though, because they'll charge more when it needs repaired because it makes their job harder. They're interpreting a flat tire as a totaled car, then panicking and griping. For me, they're saying, "I want to compile for 12 hours, and so should you!" To continue doing this is a waste of time, aside from the learning process that there's a better way. If they want to do this, for the sake of doing it, then fine, but they need to stop this, "The world is going to end tomorrow because YOU mixed packages and ports." And they need to stop scolding for something that actually works very well. If they do want to make a case, it's because someone will break something on purpose, to try to convince me I'm wrong. It's worked well so far, and go ahead, I'll get around it. They can't break everything on purpose, because of ego, and claim they're doing it in good faith.

It's also not like using FreeBSD Current. There's similarities, but it's not anywhere that complicated or difficult, and doesn't require that level of expertise.

I also do it in a strategic way, for instance, using packages for build-only dependencies, for languages and for xorg. I also use packages for simple programs like psearch, portmaster, doas. Programs that get me up and running quick. I also don't always feel like compiling firefox and thunderbird, though I prefer to build these. Portmaster has the option of using packages for build-only dependencies, which works well. It has other options for mixing ports and packages, but I don't use those, because they're not in a way that I like. It has, use latest packages when they're newer than packages on the system, which using this will mix up set options, when some programs were compiled with custom options.


Something similar, but not what I was saying above, was recommended in one of those FreeBSD books, that packages can be used for almost everything, then building ports can be used for what's not available as a package and for upgrading.


----------



## Deleted member 30996 (Sep 9, 2021)

Mixing them has been the only way to get past a failpoint for me at times. That was what worked and I never suffered from it,


----------



## gpw928 (Sep 9, 2021)

gpw928 said:


> I have to recompile sendmail to get the options I need to commune with my ISP.  So it has to come from ports.


I should also say that when I make the decision to install something from ports, I always grab the dependency list from the INDEX file in /usr/ports and `pkg install` the entire list before making the customised port.

This keeps the number of ports installed down to the bare minimum, and can save a lot of time if the dependencies are significant.  It also reduces the probability of conflicts, and the number of ports that have to be re-made and installed when I upgrade to an absolute minimum:
	
	



```
[strand.187] $ pkg query -a '%R %o' | sort | grep unknown-repository
unknown-repository mail/sendmail
unknown-repository shells/pdksh
```


----------



## richardtoohey2 (Sep 10, 2021)

gpw928 said:


> I always grab the dependency list from the INDEX file in /usr/ports


I don't _think_ that's there by default - you either have to use portsnap or make (is it make index?) - but correct me if I'm wrong.  e.g. if you use gitup you won't get INDEX.


----------



## gpw928 (Sep 10, 2021)

richardtoohey2 said:


> I don't _think_ that's there by default - you either have to use portsnap or make (is it make index?) - but correct me if I'm wrong.  e.g. if you use gitup you won't get INDEX.


You can `make index`, but it takes ages.  The INDEX generally materialises after the first `portsnap fetch update`.

I don't use `gitup`, so can't comment.


----------



## astyle (Sep 10, 2021)

If you're gonna mix, it's an absolute requirement to have matching versions from get-go. I strongly recommend going with ports. The default options are very much the ones that packages are pre-made with. I personally go with ports from get-go, no mixing. That decision affects what I do further down the road. Be prepared to spend quite a bit of time learning and re-installing your system from ground up.


----------

