Installing different versions of packages

I’m currently installing packages system-wide, but I’m wondering what the best practice is for setting up a development environment? Say I want to use an older version of golang for work, but keep the latest version for the system to use. And the same for python. How could I do that?

Watch out as you maybe setting yourself up for partial upgrades that usually do not end well.

1 Like

in a Devel - VM with the same OS you use for work.

1 Like

Do I really need a VM if I only use this installation for work? Is it not possible to install packages for a specific user, in addition to the system?

If you need to keep older versions of certain software, you would be better served by a static release system like Debian rather than a rolling release like Arch. Even in a VM, Arch will need to get updates and holding library packages back will cause major headaches.

For python, use pyenv or something similar.

Could I use something like distrobox to set up dev environments? Sorry, I’m just a bit new to all of this :sweat_smile:

I might switch to Debian for work, though.

nope. If you are an employee, use the OS that is used at work in a VM. If you are independent, either deal with the “issues” that arise from the updates or use another OS focused on stability. Everything else is just asking for trouble. The already mentioned Debian is a pretty good choice for a stability-focused distribution.

My specific issue is that I want to install a specific version of language to use for a project, without it interfering with my system if it also uses that language. Would Debian allow for that?

What release of what language do you need to use? I suggested Debian since the package versions will stay stable during updates within the same Debian release.

As a developer, you need to be able to have multiple versions of the same language installed.

You may have 5 different projects you support in 5 different versions. IMO, I am not sure switching to debian is really the best solution.

Then instead of us guessing at solutions, if you know how to do this, just instruct the OP. I suggested Debian since the versions of the software won’t just change with the wind like on Arch. It may not be the better solution, but I also do not know what programming languages and at what versions they require.

Ah, yes, I see the suggestion for pyenv, sorry. :slight_smile:

I already made my recommendation in post 6

I’ve been considering using asdf or nixpkgs to keep certain versions of languages and packages for specific projects. At least, I’ve read that some people have used them for this purpose on Arch. Alternatively, Debian seems to have a way to keep different versions of a package simultaneously (Debian Alternatives). Some also suggest using containers. I dont really know what the best choice would be :sweat_smile:

It depends which languages you are talking about specifically.

Many languages have good language specific solutions available.

I need to use golang 1.19 and 1.18.

For golang, I think you can pretty easily install different versions in your home dir and then reference them by name.

1 Like

Did you see this: https://stackoverflow.com/questions/61280008/multiple-versions-of-go

1 Like

Yeah, I’m aware of this, but wasnt sure what to do about aliasing, thanks! This would mean that I’d have to be careful to remember to alias to the specific version whenever I start up a terminal for a specific project. I might go with that for now, but I guess I was just wondering if there was a “cleaner” way to set an environment for specific versions of different languages. I’ll look into the alternatives I’ve mentioned, but keep this post open in case people want to give suggestions on how they’ve set up their environments?

Do you really even need the aliasing?

Can’t you just use the specific go version when working on those projects?

1 Like