When and When not do I use a Package Manager?
Despite having meticulously browsed the web I'm still unable to tell exactly when and when not to use the package manager.
Say when I'm building a Python application; do I get the packages I use for development with pip, or with pacman? What of when I'm required to keep older version of the library for compatibility, if it is kept under pacman then I'd have no control over it. Of course I should use virtual environment, but I also can't do that since the packages are maintained by pacman.
On a related note: Are packages installed from the AUR also updated as part of the regular release cycle? I.e. are they also recompiled and upgraded to the latest version when I pacman -Syu?
About this post
- Posted
- Archived
- Score
- 4 · 100% up
- Kind
- Text
- ID
- 5x2ued
16 comments
Always use the package manager unless the program you want isn't in the repos, including the AUR.
EVERY TIME WITHOUT EXCEPTION.
Seriously.
If an application is so specificly programmed that it needs a precise version of a library and can't handle a minor version update, then the application is broken and shouldn't be used.
Yet I've just been told on IRC #archlinux not to use pacman for vim plugins. Instead, I should use a program like vim-plug to install vim plugins. So I removed vim-latexsuite and vim-airline, both in the official repos, and installed them with vim-plug. I've also been told that I could use pip for python stuff, as long as I use the --user flag so that it doesn't mess up with system files. So I am confused on whether trusting your words or the words from several people in #archlinux.
What you're talking about here are specific features for specific programs, and that's a different than what I was talking about. My comment is about general system usage and maintainence.
I'm sure that #archlinux didn't tell you to install Python or Vim yourself, they told you to use their built-in features for expansion, once you've installed the main program from the repos.
Things like this is what confused me in the first place. There should be an official word on it; if there already is, it should be much easier to find, and should be written in italic, underlined, and bolded. Because I'm undoubtedly not the only one confused.
In Python the "requirements.txt" file is commonly used to automatically download a specific version (if required) of a library. At least in my earlier experience on Windows. What is the alternative here, then? Since "requirements.txt" downloads from pip.
Pacman for systemwide python packages, pip for virtualenv packages. Combining 2 package managers is a recipe for disaster.
You say:
That is not true. Once you activate the virtualenv, the system uses pip-installed packages within the virtualenv. When you deactivate, you're back to using the pacman ones.
That's comforting. Am I correct in assuming this means that I can use a requirements.txt file together with a virtualenv to automatically install dependencies?
Pip handles the dependencies for you when it comes to a specific package. If your python package requires a non-python package, I would recommend python-conda, which handles that for you as well.
However, if you're talking about dependencies for your app, then yes, you would activate a virtual environment using the source command, and then you use:
Unless you use an AUR helper like Yaourt, packer or pacaur. AUR packages will not be updated. In order to update them you will have to use the helper's specific commands (yaourt -Syua, pacaur -Syu, etc).
Okay, so now that I already have a few packages from the AUR installed. If I now were to install a helper, is it capable of upgrading the already installed packages, or do I have to reinstall?
No, since when you build an AUR package it is installed by pacman anyway. So it can upgrade your current packages.
What I do: I usually try to install all global python packages through a package manger. Do this prevents problems with applications that list a package that install python libs, and then freaks out when they where already installed by pip. However forcing it are telling it to ignore theses conflicts usually does not break anything I would just prefer not to have to worry about it.
I think you already are doing what I do. If you need different packages versions just use virtualenvs which can override the globally installed version.
You should use a
virtualenvto contain your Python packages which you will use in your application. That way they are isolated from the rest of the system and managed independently.