Outils pour utilisateurs

Outils du site


tech:guix_le_gestionnaire_de_paquets_complementaire_multi_distro

Ceci est une ancienne révision du document !


Guix le gestionnaire de paquets complémentaire multi distro

Avantage :

  • Indépendance par rapport à la distro
  • Reproductibilité, c'est une sorte de virtualenv pour des binaires
  • Réversibilité
  • Permettre à des utilisateurs (non root) de facilement installer programmes
  • Compilation
    • Plus de souplesse
    • Plus de confiance dans un code source vérifiable que dans un fichier binaire

Inconvénient :

  • Toujours en bêta
  • Compilation
    • Plus lent
    • Nécessite un compilateur installé et plusieurs bibliothèques (libraries)
  • Que GNU/Linux, ne support pas BSD et autres

Liens :

Voir :

Voir aussi :

Installation

Note : Copier-coller pour archive perso Ce référer à la doc officiel</note>

Source : https://www.gnu.org/software/guix/manual/html_node/Binary-Installation.html

Préinstall

Voir les dépendances : https://www.gnu.org/software/guix/manual/html_node/Requirements.html

apt-get install guile-2.0-dev guile-2.0 libgcrypt20-dev libbz2-dev libsqlite3-dev autopoint

Source : https://www.gnu.org/software/guix/manual/html_node/Build-Environment-Setup.html#Build-Environment-Setup

groupadd --system guixbuild
for i in `seq -w 1 10`;
  do
    useradd -g guixbuild -G guixbuild           \
            -d /var/empty -s `which nologin`    \
            -c "Guix build user $i" --system    \
            guixbuilder$i;
  done

Install

Le serveur de clefs keys.gnupg.net ne semble plus accessible

# gpg --keyserver keys.gnupg.net --recv-keys 3D9AEBB5
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 3D9AEBB5
wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.10.0.system.tar.xz.sig
gpg --verify guix-binary-0.10.0.system.tar.xz.sig
tar --warning=no-timestamp -xf guix-binary-0.10.0.system.tar.xz
mv var/guix /var/ 
mv gnu /
ln -sf /var/guix/profiles/per-user/root/guix-profile /root/.guix-profile
cp /root/.guix-profile/lib/systemd/system/guix-daemon.service /etc/systemd/system/
systemctl start guix-daemon
systemctl status guix-daemon
systemctl enable guix-daemon
mkdir -p /usr/local/bin
cd /usr/local/bin
ln -s /var/guix/profiles/per-user/root/guix-profile/bin/guix
mkdir -p /usr/local/share/info
cd /usr/local/share/info
for i in /var/guix/profiles/per-user/root/guix-profile/share/info/*
do 
  ln -s $i
done
cd -

Ajout de la clef publique pour le dépôt hydra.gnu.org

# Faut-il utiliser "pre-inst-env" ?
# ./pre-inst-env guix archive --authorize < hydra.gnu.org.pub
guix archive --authorize < /root/.guix-profile/share/guix/hydra.gnu.org.pub
warning: failed to install locale: Invalid argument

https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#Application-Setup

guix package -i glibc-locales
guix package -i glibc-utf8-locales
export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale
export PATH="$PATH:/root/.guix-profile/bin:/root/.guix-profile/sbin"
ls $GUIX_LOCPATH/2.22/
export LC_ALL=fr_FR.UTF-8
# LC_ALL=C.UTF-8

On refait :

guix archive --authorize < /root/.guix-profile/share/guix/hydra.gnu.org.pub

Plus de warning: failed to install locale: Invalid argument

Postinstall

Voir https://github.com/pjotrp/guix-notes/blob/master/INSTALL.org

chgrp guixbuild -R /gnu/store
chmod 1775 /gnu/store
guix pull

Erreur :

Starting download of /tmp/guix-file.srtrha
From http://git.savannah.gnu.org/cgit/guix.git/snapshot/master.tar.gz...
 master.tar.gz                              1.8MiB/s 00:06 | 10.2MiB transferred
unpacking '/gnu/store/cdlwlhhyrp9pqw65qdj0nc60gh3r3jzs-guix-latest.tar.gz'...
substitute: warning: failed to install locale: Invalid argument
The following derivation will be built:
   /gnu/store/gy94c3bgq5wv6hshiqvl7im41rxhbcdi-guix-latest.drv
warning: failed to install locale: Invalid argument
building path(s) `/gnu/store/k0s0j138zlkp7xbhmdss3jfvihzjvn0p-guix-latest'
copying and compiling to '/gnu/store/k0s0j138zlkp7xbhmdss3jfvihzjvn0p-guix-latest'...
loading...       23.6% of 501 filesrandom seed for tests: 1465036103
loading...       99.8% of 501 files
compiling...      7.8% of 501 filesbuilder for `/gnu/store/gy94c3bgq5wv6hshiqvl7im41rxhbcdi-guix-latest.drv' failed due to signal 9 (Killed)
guix pull: error: build failed: build of `/gnu/store/gy94c3bgq5wv6hshiqvl7im41rxhbcdi-guix-latest.drv' failed
dmesg |tail
[ 6910.498849] Out of memory: Kill process 5181 (guile) score 380 or sacrifice child
[ 6910.500320] Killed process 5181 (guile) total-vm:251412kB, anon-rss:191672kB, file-rss:612kB

Voilà l'explication
Le failed due to signal 9 (Killed) c'est OOM Killer qui est passé par là, car pas assez de RAM sur ma VM (à 512Go de RAM)


~/.bashrc
export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale
export PATH="$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH"
export LC_ALL=fr_FR.UTF-8
# LC_ALL=C.UTF-8
 
export PKG_CONFIG_PATH="$HOME/.guix-profile/lib/pkgconfig"
export GUILE_LOAD_PATH="$HOME/.guix-profile/share/guile/site/2.0"
export GUILE_LOAD_COMPILED_PATH="$HOME/.guix-profile/lib/guile/2.0/ccache:$HOME/.guix-profile/share/guile/site/2.0"
export C_INCLUDE_PATH="$HOME/.guix-profile/include"
export CPLUS_INCLUDE_PATH="$HOME/.guix-profile/include"
export LIBRARY_PATH="$HOME/.guix-profile/lib"
export ACLOCAL_PATH="$HOME/.guix-profile/share/aclocal"

Autres

Notes Test

guix environment --ad-hoc --container gimp
guix environment: error: cannot create container: unprivileged user cannot create user namespaces
guix environment: error: please set /proc/sys/kernel/unprivileged_userns_clone to "1"
sudo echo 1 > /proc/sys/kernel/unprivileged_userns_clone
guix environment --ad-hoc --container gimp

Exemple

apt install nix-bin && nix-commande install chromium
tech/guix_le_gestionnaire_de_paquets_complementaire_multi_distro.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki