Skip to content

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?

4 points16 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
5x2ued

Author

3
posts
26
comments
0
media
View profile

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.

  • When you use Pacman, you have a log of what's installed on your system. It will handle updates properly, and it will uninstall things properly. Having been reviewed and tested by at least one other person, there should be no conflicts between programs.
  • If you need several versions of a program for compatability, likely everyone else will need the same thing. Arch (or any distribution) will maintain several versions concurrently. This is why you can install python and python2 for example.
    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.
  • Packages from the AUR are not updated automatically. They're not meant to be mission-critical, and are your responsibility to maintain.
10 points

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.

4 points

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.

4 points

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.

1 points

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.

2 points

Pacman for systemwide python packages, pip for virtualenv packages. Combining 2 package managers is a recipe for disaster.

You say:

Of course I should use virtual environment, but I also can't do that since the packages are maintained by pacman.

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.

4 points

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?

2 points

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:

pip install -r requirements_file
3 points

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).

3 points

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?

1 points

No, since when you build an AUR package it is installed by pacman anyway. So it can upgrade your current packages.

-5 points

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.

2 points

You should use a virtualenv to 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.

$ python -m venv venv
$ source ./venv/bin/activate
$ pip install -r requirements.txt
2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.