# FreeBSD should adopt something like Ubuntu/Debian's update-alternatives



## Deleted member 63539 (Aug 14, 2020)

There is a lot of thing to learn: https://wiki.debian.org/DebianAlternatives

I have both OpenJDK8 and OpenJDK11 installed. And OpenJDK11 was set to default java. I have no way to force OpenJDK8 as default java. OpenJDK11 only comes of a dependency to install Eclipse. Many of the software I used are incompatible with OpenJDK11.

This lacked of an alternatives system caused awkward workaround like this with wx-config:








						C - Building a current version of BOSSA
					

Because the version in ports is ancient as a rock and doesn't support SAM4 Processors, I need to build a more recent Version. As usual for Linux- and Windows-centric software, documentation is near to non-existent, especially on how to build it, let alone on FreeBSD.... Apart from some commits...




					forums.freebsd.org
				




It took time to figure out and create a symlink manually.

Update: I found javavm(), but the needing of an alternatives system remains, though.


----------



## D-FENS (Aug 15, 2020)

As far as I know, FreeBSD supports multiple versions of the same package as a concept.
For Java in particular it's explained here: https://lists.freebsd.org/pipermail/freebsd-ports/2013-September/086182.html

As explained here, JDK11 is currently not supported by JAVA_VERSION: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237054
But this is not a conceptual problem, the versions are simply a bit lagging.

By the way, if you want to use Eclipse with a specific Java, why don't you use eclipse.ini to specify the exact VM you want to use? Just add a line to eclipse.ini:

```
-vm <path to your java executable>
```


----------



## drhowarddrfine (Aug 15, 2020)

Talk about Linux and its fragmentation! No, FreeBSD should NOT do that.


----------



## Beastie7 (Aug 15, 2020)

On FreeBSD you have many “faces” (DEs) to choose from, not many ”distros”. There is no point of a derivative of FreeBSD for that; it just makes no sense. All those Linux derivatives are the same thing anyway.

An easy and clean way to switch between full DEs ”faces” in FreeBSD would be nice though.

Edit:

I just realized I was way off topic. Nevermind. haha


----------



## shkhln (Aug 15, 2020)

gh_origin said:


> There is a lot of thing to learn: https://wiki.debian.org/DebianAlternatives



Suppose you have an application A using X, and an application B using Y. Are you going to switch alternatives X/Y each time before you need to start one of these applications? What if you need to run them simultaneously? This a typically silly Debian idea.


----------



## jmos (Aug 15, 2020)

If I understand your posting correctly, setting a default doesn't really solve your problem - rather you want to use version A and version B of your interpreter; For this you better start your scripts via interpreter instead of letting the script start the interpreter (instead of getting "./myscript" up, execute "interpreter.v2 myscript"). If this sounds fiddly to you, you can set an alias (or just modifie the exec command in the start menu).

If you've changed a symlink (the "default") every time by using Debians "update-alternatives", I see a) no advantage over the direct use of "ln", and b) no solution, but a really cumbersome workaround. The solution is to use the correct interpreter directly, not to modify a default for every user of a computer.

But: Using the correct interpreter (version) is one thing the maintainer of a port is doing for you. If this fails write a bug report.


----------



## drhowarddrfine (Aug 15, 2020)

To me, this is a "why isn't FreeBSD more like..." question.


----------



## swills@ (Aug 15, 2020)

gh_origin said:


> Update: I found javavm(), but the needing of an alternatives system remains, though.



I'm curious, can you explain how javavm doesn't achieve the same thing?


----------



## a6h (Aug 15, 2020)

Dear gh_origin please keep in mind, that I'm not trying to picking on you. Just sharing some thoughts.
The best approach to operate in any computer system is (to some extend) adhere to its overall structure and guidelines. Hardware and software. Let's forget about FreeBSD for a moment and take Windows for an example. You can, and I've tried, to adopt Windows 7/10 to a GNU/Linux system. Here a list of some of workaround I've done in the past:

Enabling WSL and using bash and other GNU programs from the WSL to manage Windows. (ubuntu, debian, opensuse, opensuse LTS and kali)
Using MSYS2, Cygwin and git CMD. Adding them to PATH. Using GNU commands from CMD.
Failed attempts to change windows theme to resemble a titling WM
Running different terminal emulators, such as ConEmu, PuTTY (special use case), etc to mimic the BSD/Linux system.
Installing different standalone GNU packages such as gvim, lynx, irssi and trying to using them.
Employing windows-compiled developer solution to turn windows system to a GNU/devs environment. e.g. Strawberry Perl, LLVM/Clang compiler.
Let me tell you what happened. I learned it a hard way, at the end if you want to live and develop on Windows system you should program in .NET framework, use Visual Studio community edition to develop, and develop a good skill to work with PowerShell to write/run script, manage windows and control its service.

Same goes for Linux, Apple, Android and FreeBSD.
Conclusion: If you want to stay and develop in FreeBSD for a long period of time, it's better to develop a FreeBSD psyche beforehand and to follow its traditional way of doing things.


----------



## Deleted member 63539 (Aug 16, 2020)

swills@ said:


> I'm curious, can you explain how javavm doesn't achieve the same thing?


javavm is not as powerful as the Debian alternatives system.

JAVA_HOME=/usr/local/openjdk8 java -version gives the correct java.

But when putting JAVA_HOME=/usr/local/openjdk8 on .profile (already sourced it), it doesn't work (at least for me): java -version still gives java 11.

BTW, it worked well enough for java. What I'm suggesting is about other packages.

One of the example is wx31-gtk3, I know I could have multiple versions of wx installed and in order to not let them conflict with each other, you (the packagers/ports maintainers) have to add the versions info into the executable name (e.g: wx31-config, the actual name is much longer and difficult to remember, I uninstalled wx31-gtk3 so I can't check). But software configure script will only search for wx-config but not the executable you renamed. There must be mechanics to set the default version of wx-config (so indeed it's the default version of wx) so configure script could pick it up. Currently, there is none. The user has to create the symlink themselves. IMHO, we really need something like the Debian alternatives system to fill in the gaps. We don't have to do an exact copy of the implementation of them, but we get the ideas from them.


----------



## Deleted member 63539 (Aug 16, 2020)

drhowarddrfine said:


> To me, this is a "why isn't FreeBSD more like..." question.


Nope. But to me, you guys' reaction only confirmed the words of a troll used to ridicule the FreeBSD community as childish and reject anything Linux only because it comes from Linux even though the idea is right. Yeah, I know. He's a troll. But as ralphbsz said, his words are 90% wrong but sadly still have 10% of truth in it. I have said anything I could but if you guys still refute my idea, I have nothing to say anymore. I quit.


----------



## shkhln (Aug 16, 2020)

gh_origin said:


> But to me, you guys' reaction only confirmed the words of a troll used to ridicule the FreeBSD community as childish and reject anything Linux only because it comes from Linux even though the idea is right. Yeah, I know. He's a troll.



For your information, none of us actually believes this troll is a separate person from you. I suggest dropping this subject entirely.


----------



## shkhln (Aug 16, 2020)

gh_origin said:


> But when putting JAVA_HOME=/usr/local/openjdk8 on .profile (already sourced it), it doesn't work (at least for me): java -version still gives java 11.



That should be:

```
export JAVA_HOME=/usr/local/openjdk8
```


----------



## Deleted member 63539 (Aug 16, 2020)

shkhln said:


> For your information, none of us actually believes this troll is a separate person from you. I suggest dropping this subject entirely.


Check the IP. The Mod can. Is this community that toxic? Accusation has started, then when persecution start? You could easily distinguish people by their way of writing. I'm not good at English so my writings are full of grammar errors. I can only dream to be able to write a paragraph as good as one of you, let alone writing such a long rant like him.


----------



## Deleted member 63539 (Aug 16, 2020)

shkhln said:


> That should be:
> 
> ```
> export JAVA_HOME=/usr/local/openjdk8
> ```


I implied export. The code I used is exactly as you. Wait. I think we must export a variable to be able to make it available? I'm not good at shell. I learned by trial and error and all of the tutorials on the internet always use export to declare an environment variable. I think export is just the same as var on JS.


----------



## sidetone (Aug 16, 2020)

Find a unique solution, rather than saying it should be like (or copy) those other OS's. These themes are too Linux centric, when this isn't Linux.

What's the point of mucking things up with Debian/Ubuntu's bloated way of doing things?


----------



## Deleted member 63539 (Aug 16, 2020)

sidetone said:


> Find a unique solution, rather than saying it should be like (or copy) those other OS's. These themes are too Linux centric, when this isn't Linux.
> 
> What's the point of mucking things up with Debian/Ubuntu's bloated way of doing things?


I don't think the Debian's way is bloated. In fact I think symlinks is the most simple way to done the job. What is the alternatives on Debian other than, symlinks? They only got it over complicated by utilizing another directory (/etc/alternatives) to store symlinks. But doing so also make it more powerful.

BTW, our javavm wrapper, IMHO, is more complicated that their symlinks based solution, since it's a wrapper script, not just a plain symlink.

Your comment again, reflect the very mindset, it must be unique in the sense that it's not found elsewhere (in fact, just Linux). That mindset is ridiculous!

p/s: I don't want to argue with any of you anymore. I found my passionate to go nowhere. I'm not even passionate, indeed. I only wanted to solve a very realistic problem. But... I think I should just stop here.


----------



## sidetone (Aug 16, 2020)

Debian/Ubuntu is bloated, when it uses SystemD, and it makes you compile 14 hours (or more depending on CPU) worth of software, when it only needed software that compiles for anywhere from 1 minute to 2 hours, because of dependency hell. This isn't an exaggeration. That's the definition of bloat. To allow this kind of inefficiency is a mindset.

This is a sample of how little faith I have in Ubuntu to do anything else without bloat/piling on without purpose. But you can disagree.


----------



## shkhln (Aug 16, 2020)

gh_origin said:


> You could easily distinguish people by their way of writing.



You have a thread starting with a similar premise, so… But, yes, that ralphbsz quote probably refers to some of the gpb/pyret's posts. (Can't check them, they have been removed.)


----------



## a6h (Aug 16, 2020)

gh_origin said:


> the words of a troll


Calling people troll, will terminate any further conversation. It's a recipe for destruction.


gh_origin said:


> s this community that toxic


And calling a group of people toxic, implies that they are some sort of chemical waste, garbage  to be exact.
Please, don't do that. Thank you!


----------



## shkhln (Aug 16, 2020)

gh_origin said:


> I don't think the Debian's way is bloated. In fact I think symlinks is the most simple way to done the job. What is the alternatives on Debian other than, symlinks? They only got it over complicated by utilizing another directory (/etc/alternatives) to store symlinks. But doing so also make it more powerful.



You already had your technical argument. Let me try again. Debian's alternatives are meant to be used with actual alternatives, such as email or editor preferences*, where applications are fully interchangeable. Multiple installable java/python/whatever versions are not truly alternatives, they exist because some applications absolutely require to be run/compiled with a specific interpreter version. Which means you are _always_ breaking one or another application depending on the setting.

* In the desktop case this is already handled with `xdg-open` and mime types, which is why we don't bother with similar solutions.


----------



## sidetone (Aug 16, 2020)

I still don't know whether gh_origin is another person, and I don't make accusations like that.

This topic isn't a good one. It's in the title: why doesn't FreeBSD do something like Ubuntu/Debian. Many are saying, this isn't the way to to things here. Not everyone is saying so for the sake of being argumentative.


----------



## kpedersen (Aug 16, 2020)

Perhaps just compile / install a port of your "alternative" software somewhere other than /usr/local.
Then when you want to use it, set PATH to that directory and go.

This is almost like the *Linux* (which I know you crave ) solution of Red Hat's Software Collections (https://www.softwarecollections.org/en/).

Otherwise, use a Jail. Our Jail system is far superior than Linux chroots. So make the most of it and use it!


----------



## mark_j (Aug 17, 2020)

gh_origin said:


> Nope. But to me, you guys' reaction only confirmed the words of a troll used to ridicule the FreeBSD community as childish and reject anything Linux only because it comes from Linux even though the idea is right. Yeah, I know. He's a troll. But as ralphbsz said, his words are 90% wrong but sadly still have 10% of truth in it. I have said anything I could but if you guys still refute my idea, I have nothing to say anymore. I quit.



Let me say from the outset, this is not entirely directed at you, but what sort of reaction did you expect?

First off, you title the topic saying "freebsd should adopt...". Try going to a debian forum and telling them to adopt ports because you can't use two versions of Java. You might get a similar response.

Second off, there seems to be a concerted effort by "linux" fan-boys (zealots) to come here and trash the FreeBSD brand. I'm not saying you're one of them, but this constant "freebsd should do this", "freebsd should do that", "freebsd can't do this, nah nah nahnah nah..." just gets a little tiresome REAL FAST. Is it any wonder some people over-react?

We're here because we use or are interested in FreeBSD, not debian or linux or windows.

Third, if you have a legitimate request, why not formulate it and present it to the developers, not the users and system administrators that frequent this forum?

Fourth, you were given alternatives from a user-land point of view and you just want to rage-quit? Fine.

Fifth, and this applies to all the linux zealots that read this: This is not linux, gnu/linux, systemdOS. Go peddle your religion elsewhere.

<end rant>


----------



## a6h (Aug 17, 2020)

gh_origin said:


> Check the IP. The Mod can


security/openvpn, security/openconnect


gh_origin said:


> You could easily distinguish people by their way of writing


Asserting like this ... preemptively, to defend your claim, another red flag.


gh_origin said:


> There is a lot of thing to learn: ttps://wiki.debian.org/DebianAlternatives


I've read this paper. I've learned nothing. Although, there's one interesting thing in that paper. The author(s) refers to their previous discussions about _Debian alternatives system,_ on a mailing list, as rant. Very Debian-ian of them. Of course, there are good rants out there, worth listening to. One post above, written by mark_j is one of them. He rants quite well, so do I.


----------



## sidetone (Aug 17, 2020)

vigole said:


> Asserting like this ... preemptively, to defend your claim, another red flag.


Not necessarily, but at this point, the mods will figure out if so.


----------



## swills@ (Aug 17, 2020)

gh_origin said:


> javavm is not as powerful as the Debian alternatives system.



What do you mean by "powerful" here?



gh_origin said:


> JAVA_HOME=/usr/local/openjdk8 java -version gives the correct java.



I would think you would want to set JAVA_VERSION, based on what I read in the javavm(1) man page, but I'm not completely sure what you're trying to do.


----------



## Datapanic (Aug 17, 2020)

FreeBSD does not need to adopt anything like Ubuntu, Debian Centos, Redhat, etc.  FreeBSD is NOT Linux and never will be.  FreeBSD has the best port/package system in the world and its maintainers for the most part keep it up to date.  For example, try installing Bareos or OpenLDAP.  On everything except FreeBSD, you get very VERY old OLD versions.  Also, I can't count how many times I find out that problems with Ubuntu, Debian Centos, Redhat, etc.  are due to OLD unfixed UNFIXED bugs.  FreeBSD is not like that.

So, yeah, I think so too that the OP is trolling...


----------



## SirDice (Aug 17, 2020)

Why is FreeBSD not (more) like ....
					

As of today, FreeBSD Forums staff will actively close down (and eventually remove) topics that serve no other purpose than to complain that "FreeBSD is not (like) Linux" (or Windows, or MacOS, or any other operating system), or that "FreeBSD does not use systemd", or that "FreeBSD has no default...




					forums.freebsd.org
				




Thread closed.


----------

