Skip to content

Which package manager should I use when there are multiple to choose from?

For example, if I want to install NumPy, should I do pacman -S python-numpy or pip install numpy? Or if I want to install latte dock, should I download it through KDE Discover or should I do pacman -S latte-dock?

0 points13 comments
Open on Reddit
About this post
Posted
Archived
Score
0 · 100% up
Kind
Text
ID
cp5zhy

Author

8
posts
10
comments
0
media
View profile

17 comments

unknown author3 hidden

Deleted before we saved it.

12 points

This is not the full truth, Discover can also install via Flatpak, Snap or (most relevant for OP) via KNewStuff.

3 points

I use pacman to install things that I want to use globally, other package managers are my second choice, I use it only if the package is not available in ArchLinux repos yet or I want to use it locally.

2 points
unknown author

Deleted before we saved it.

1 points

Pacman is usually the best bet for arch, usually Pacman and Trizen are all you need for packages, there are converters for other package types mainly .deb files Trizen is used to get packages from the AUR so those two alone should cover most of your needs any reason why you don't wanna use pacman straight out?

1 points

No reason, I just wanted to know what the best practice was.

1 points

Ah, yeah unless it's causing you issues Pacman and Trizen should cover almost everything. Usually the more package managers you have the harder it is to keep straight where a package came from it it starts acting up. There's nothing bad with changing but it's usually just seen as unnecessary effort and added complexity. Good question though!

1 points

there should be no difference between pacman and Discover (although I found Discover to be a bit buggy at times). Also, if you'd use an AUR manager like trizen,yay,etc.: they all use pacman internally.

As for programming language package managers like pip/venv, npm, rust's cargo or whatever: if you need that package globally (eg if it's a tool you want to use, or as dependency for another arch/AUR package you want to install), you should use pacman. If you only need it for development in said language, you better use pip/venv. So as far as my understanding for python development goes, you should install numpy via virtualenv, because this allows you to install multiple different versions in parallel.

1 points
unknown author

Generally you want to use pacman to manage what is installed on your system. For python scripts that you want installed globally you can use pacman e.g. I use youtube-dl globally so I install that with pacman or brew (I am using a mac at the moment).

Whereas pip you will use that to install python dependencies for python project. To use it with virtual-environements.

$ sudo pacman -Syu python-virtualenv
$ mkdir my-python-project
$ cd my-python-project
$ virtualenv venv
$ source venv/bin/activate
$ pip install requests

This will install the popular requests tool into your virtual environment, however if you exit that virtual-environment using exit in bash, then you are using the global python again and requests can't be imported.

Here is a more complete explanation of how they work:

https://realpython.com/python-virtual-environments-a-primer/

Also of course the arch linux wiki page:

https://wiki.archlinux.org/index.php/Python/Virtual_environment

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