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

  • Thread starter Deleted member 63539
  • Start date
Status
Not open for further replies.
D

Deleted member 63539

Guest
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:

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

Update: I found javavm(), but the needing of an alternatives system remains, though.
 
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:
Code:
-vm <path to your java executable>
 
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
 
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.
 
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:
  1. Enabling WSL and using bash and other GNU programs from the WSL to manage Windows. (ubuntu, debian, opensuse, opensuse LTS and kali)
  2. Using MSYS2, Cygwin and git CMD. Adding them to PATH. Using GNU commands from CMD.
  3. Failed attempts to change windows theme to resemble a titling WM
  4. Running different terminal emulators, such as ConEmu, PuTTY (special use case), etc to mimic the BSD/Linux system.
  5. Installing different standalone GNU packages such as gvim, lynx, irssi and trying to using them.
  6. 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.
 
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.
 
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.
 
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.
 
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.
 
That should be:
Code:
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.
 
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?
 
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.
 
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.
 
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.
 
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.
 
  • Like
Reactions: a6h
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!
 
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>
 
Check the IP. The Mod can
security/openvpn, security/openconnect
You could easily distinguish people by their way of writing
Asserting like this ... preemptively, to defend your claim, another red flag.
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.
 
Status
Not open for further replies.
Back
Top