Skip to content

Pacman and functional package management

Let me apologize in advance for a post with lots of ifs and buts. I'm just trying to get a deeper understanding of pacman and its potential ans existing capabilities.

I am basically wondering about pacman's ability to build and install entire package sets in a more or less functional way. I realize that pacman primarily handles binary packages and resolves dependencies. However, as explained in the Arch Wiki, ( https://wiki.archlinux.org/index.php/Flatpak#Creating_a_custom_base_runtime ) pacman can actually build packages as well as their dependencies straight Flarpak images.

Combining such an approach with the one of Darch, would it be possible to rely on pacman to deploy entire application sets such as Nix does today? I am specifically mentioning Nix here as a tool that is used for deployment on entire infrastructures, not NixOS itself. Thoughts welcome!

2 points6 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
co5doc

Author

10
posts
17
comments
0
media
View profile

6 comments

Pacman doesnt build packages. In the article, they use pacman as a fancy way of copying package files for convenience.

4 points
chs75OP1 hidden

Copying packages from where to where? That does not really answer my question.

1 points

Copying files from repo packages to a folder. pacman isn't actually building anything here, it's installing already built packages from the repo to a directory structure that Flatpak expects.

1 points

spongybobies right, pacman doesn't build packages. Pacman can be used to download packages without installing them.

$ pacman -S --help | grep downloadonly
  -w, --downloadonly   download packages but do not install/upgrade anything

Look into makepkg, which is included as part of the pacman package, to build packages.

$ man makepkg | head -n 12
MAKEPKG(8)                                Pacman Manual                               MAKEPKG(8)

NAME
       makepkg - package build utility

SYNOPSIS
       makepkg [options] [ENVVAR=value] [ENVVAR+=value] ...

DESCRIPTION
       makepkg is a script to automate the building of packages. The requirements for using the
       script are a build-capable *nix platform and a custom build script for each package you
       wish to build (known as a PKGBUILD). See PKGBUILD(5) for details on creating your own

As far as:

trying to get a deeper understanding of pacman

I'd start with the wiki and man pages. Follow with the "related articles" links in wiki page:

https://wiki.archlinux.org/index.php/pacman

You mostly lost me with the last paragraph, outta my wheelhouse.

You could create a custom PKGBUILD to both build packages and/or install binary packages.

NixOS sounds very capable in building a custom from the ground up system. I see some interesting terms now and then relating to OS's like stateless and declarative, off the top of my head. Honestly know nothing about them or what advantages they have to offer over a more conventional setup.

2 points

Thank you for your answer. Indeed pacman is not geared towards what I wqs looking for. I think ABS is closer to what I was trying to look for. Still what is missing in my scenario is the ability to define and describe complete sets of dependencies for each package (although this could be done through PKGBuilds) and have the ability to do atomic/stateless installs and rollbacks.

Now going back at Nix or Guix I don't see much advantage for desktops or standalone servers. In the end the complexity for one machine probably dwarfs the intended advantages of functional package management. Where these tools are useful, I think, is for deployments in the cloud or on clusters, as you can essentially describe and define similar images for each instance and do proper package management.

1 points

Read the wiki you will get everything) you ever wanted to know about Pacman.

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.