nix作为包管理工具并用于发布软件的可行性研究
前言
什么是包管理器
软件包管理系统是在电脑中自动安装、配制、卸载和升级软件包的工具组合,在各种系统软件和应用软件的安装管理中均有广泛应用。 在Linux发行版中,几乎每一个发行版都有自己的软件包管理系统。常见的有:
- 管理deb软件包的dpkg以及它的前端apt(使用于Debian、Ubuntu)。
- RPM包管理员以及它的前端dnf(使用于Fedora)、前端yum(使用于Red Hat Enterprise Linux)、前端ZYpp(使用于openSUSE)、前端urpmi(使用于Mandriva Linux、Mageia)等。
使用软件包管理系统将大大简化在Linux发行版中安装软件的过程。
蛮荒时代
在有软件包管理器之前,Linux上是如何安装软件的呢?那时候(包括现在部分软件),在类似github或者自建版本控制中心上发布源码。开发者需要自行下载源码,然后使用类似下面的流程编译安装:
./configure --prefix=/usr/local make make install
这个流程看似简单,但是对一些较为复杂的软件,需要安装其直接运行时依赖,在安装直接依赖的过程还要解决直接依赖的直接依赖,在这个解决依赖的过程中,很容易发生各种不可预知的问题,这就是所谓的 dependency hell 。
比如,以emacs编辑器为例,通过 apt-rdepends -d emacs-gtk
命令绘出它的依赖图如下:
digraph packages { concentrate=true; "emacs-gtk" [shape=box]; "emacs-gtk" -> "emacs-bin-common"; "emacs-gtk" -> "emacs-common"; "emacs-gtk" -> "libacl1"; "emacs-gtk" -> "libasound2"; "emacs-gtk" -> "libc6"; "emacs-gtk" -> "libcairo2"; "emacs-gtk" -> "libdbus-1-3"; "emacs-gtk" -> "libfontconfig1"; "emacs-gtk" -> "libfreetype6"; "emacs-gtk" -> "libgdk-pixbuf2.0-0"; "emacs-gtk" -> "libgif7"; "emacs-gtk" -> "libglib2.0-0"; "emacs-gtk" -> "libgnutls30"; "emacs-gtk" -> "libgpm2"; "emacs-gtk" -> "libgtk-3-0"; "emacs-gtk" -> "libice6"; "emacs-gtk" -> "libjpeg8"; "emacs-gtk" -> "liblcms2-2"; "emacs-gtk" -> "libm17n-0"; "emacs-gtk" -> "libmagickcore-6.q16-6"; "emacs-gtk" -> "libmagickwand-6.q16-6"; "emacs-gtk" -> "libotf0"; "emacs-gtk" -> "libpango-1.0-0"; "emacs-gtk" -> "libpng16-16"; "emacs-gtk" -> "librsvg2-2"; "emacs-gtk" -> "libselinux1"; "emacs-gtk" -> "libsm6"; "emacs-gtk" -> "libsystemd0"; "emacs-gtk" -> "libtiff5"; "emacs-gtk" -> "libtinfo6"; "emacs-gtk" -> "libx11-6"; "emacs-gtk" -> "libx11-xcb1"; "emacs-gtk" -> "libxcb1"; "emacs-gtk" -> "libxext6"; "emacs-gtk" -> "libxfixes3"; "emacs-gtk" -> "libxft2"; "emacs-gtk" -> "libxml2"; "emacs-gtk" -> "libxpm4"; "emacs-gtk" -> "libxrender1"; "emacs-gtk" -> "zlib1g"; "emacs-bin-common" [shape=box]; "emacs-bin-common" -> "emacs-common"; "emacs-bin-common" -> "libc6"; "emacs-common" [shape=box]; "emacs-common" -> "emacsen-common"; "emacs-common" -> "install-info"; "emacsen-common" [shape=box]; "install-info" [shape=box]; "install-info" -> "libc6"; "install-info" -> "dpkg"[color=blue]; "libc6" [shape=box]; "libc6" -> "libgcc1"; "libgcc1" [shape=box]; "libgcc1" -> "gcc-9-base"; "libgcc1" -> "libc6"; "gcc-9-base" [shape=box]; "dpkg" [shape=box]; "dpkg" -> "tar"; "dpkg" -> "libbz2-1.0"[color=blue]; "dpkg" -> "libc6"[color=blue]; "dpkg" -> "liblzma5"[color=blue]; "dpkg" -> "libselinux1"[color=blue]; "dpkg" -> "libzstd1"[color=blue]; "dpkg" -> "zlib1g"[color=blue]; "tar" [shape=box]; "tar" -> "libacl1"[color=blue]; "tar" -> "libc6"[color=blue]; "tar" -> "libselinux1"[color=blue]; "libacl1" [shape=box]; "libacl1" -> "libc6"; "libselinux1" [shape=box]; "libselinux1" -> "libc6"; "libselinux1" -> "libpcre2-8-0"; "libpcre2-8-0" [shape=box]; "libpcre2-8-0" -> "libc6"; "libbz2-1.0" [shape=box]; "libbz2-1.0" -> "libc6"; "liblzma5" [shape=box]; "liblzma5" -> "libc6"; "libzstd1" [shape=box]; "libzstd1" -> "libc6"; "zlib1g" [shape=box]; "zlib1g" -> "libc6"; "libasound2" [shape=box]; "libasound2" -> "libasound2-data"; "libasound2" -> "libc6"; "libasound2-data" [shape=box]; "libcairo2" [shape=box]; "libcairo2" -> "libc6"; "libcairo2" -> "libfontconfig1"; "libcairo2" -> "libfreetype6"; "libcairo2" -> "libpixman-1-0"; "libcairo2" -> "libpng16-16"; "libcairo2" -> "libx11-6"; "libcairo2" -> "libxcb-render0"; "libcairo2" -> "libxcb-shm0"; "libcairo2" -> "libxcb1"; "libcairo2" -> "libxext6"; "libcairo2" -> "libxrender1"; "libcairo2" -> "zlib1g"; "libfontconfig1" [shape=box]; "libfontconfig1" -> "fontconfig-config"; "libfontconfig1" -> "libc6"; "libfontconfig1" -> "libexpat1"; "libfontconfig1" -> "libfreetype6"; "libfontconfig1" -> "libuuid1"; "fontconfig-config" [shape=box]; "fontconfig-config" -> "fonts-dejavu-core"; "fontconfig-config" -> "fonts-freefont"; "fontconfig-config" -> "fonts-liberation"; "fontconfig-config" -> "ttf-bitstream-vera"; "fontconfig-config" -> "ucf"; "fonts-dejavu-core" [shape=box]; "fonts-freefont" [shape=ellipse]; "fonts-liberation" [shape=ellipse]; "ttf-bitstream-vera" [shape=ellipse]; "ucf" [shape=box]; "ucf" -> "coreutils"; "ucf" -> "debconf"; "ucf" -> "sensible-utils"; "coreutils" [shape=box]; "coreutils" -> "libacl1"[color=blue]; "coreutils" -> "libattr1"[color=blue]; "coreutils" -> "libc6"[color=blue]; "coreutils" -> "libselinux1"[color=blue]; "libattr1" [shape=box]; "libattr1" -> "libc6"; "debconf" [shape=box]; "debconf" -> "perl-base"[color=blue]; "perl-base" [shape=box]; "perl-base" -> "dpkg"[color=blue]; "perl-base" -> "libc6"[color=blue]; "sensible-utils" [shape=box]; "libexpat1" [shape=box]; "libexpat1" -> "libc6"; "libfreetype6" [shape=box]; "libfreetype6" -> "libc6"; "libfreetype6" -> "libpng16-16"; "libfreetype6" -> "zlib1g"; "libpng16-16" [shape=box]; "libpng16-16" -> "libc6"; "libpng16-16" -> "zlib1g"; "libuuid1" [shape=box]; "libuuid1" -> "libc6"; "libpixman-1-0" [shape=box]; "libpixman-1-0" -> "libc6"; "libx11-6" [shape=box]; "libx11-6" -> "libc6"; "libx11-6" -> "libx11-data"; "libx11-6" -> "libxcb1"; "libx11-data" [shape=box]; "libxcb1" [shape=box]; "libxcb1" -> "libc6"; "libxcb1" -> "libxau6"; "libxcb1" -> "libxdmcp6"; "libxau6" [shape=box]; "libxau6" -> "libc6"; "libxdmcp6" [shape=box]; "libxdmcp6" -> "libbsd0"; "libxdmcp6" -> "libc6"; "libbsd0" [shape=box]; "libbsd0" -> "libc6"; "libxcb-render0" [shape=box]; "libxcb-render0" -> "libc6"; "libxcb-render0" -> "libxcb1"; "libxcb-shm0" [shape=box]; "libxcb-shm0" -> "libc6"; "libxcb-shm0" -> "libxcb1"; "libxext6" [shape=box]; "libxext6" -> "libc6"; "libxext6" -> "libx11-6"; "libxrender1" [shape=box]; "libxrender1" -> "libc6"; "libxrender1" -> "libx11-6"; "libdbus-1-3" [shape=box]; "libdbus-1-3" -> "libc6"; "libdbus-1-3" -> "libsystemd0"; "libsystemd0" [shape=box]; "libsystemd0" -> "libc6"[color=blue]; "libsystemd0" -> "libgcrypt20"[color=blue]; "libsystemd0" -> "liblz4-1"[color=blue]; "libsystemd0" -> "liblzma5"[color=blue]; "libgcrypt20" [shape=box]; "libgcrypt20" -> "libc6"; "libgcrypt20" -> "libgpg-error0"; "libgpg-error0" [shape=box]; "libgpg-error0" -> "libc6"; "liblz4-1" [shape=box]; "liblz4-1" -> "libc6"; "libgdk-pixbuf2.0-0" [shape=box]; "libgdk-pixbuf2.0-0" -> "libc6"; "libgdk-pixbuf2.0-0" -> "libgdk-pixbuf2.0-common"; "libgdk-pixbuf2.0-0" -> "libglib2.0-0"; "libgdk-pixbuf2.0-0" -> "libjpeg8"; "libgdk-pixbuf2.0-0" -> "libpng16-16"; "libgdk-pixbuf2.0-0" -> "libtiff5"; "libgdk-pixbuf2.0-0" -> "libx11-6"; "libgdk-pixbuf2.0-0" -> "shared-mime-info"; "libgdk-pixbuf2.0-common" [shape=ellipse]; "libglib2.0-0" [shape=box]; "libglib2.0-0" -> "libc6"; "libglib2.0-0" -> "libffi6"; "libglib2.0-0" -> "libmount1"; "libglib2.0-0" -> "libpcre3"; "libglib2.0-0" -> "libselinux1"; "libglib2.0-0" -> "zlib1g"; "libffi6" [shape=box]; "libffi6" -> "libc6"; "libmount1" [shape=box]; "libmount1" -> "libblkid1"; "libmount1" -> "libc6"; "libmount1" -> "libselinux1"; "libblkid1" [shape=box]; "libblkid1" -> "libc6"; "libpcre3" [shape=box]; "libpcre3" -> "libc6"; "libjpeg8" [shape=box]; "libjpeg8" -> "libjpeg-turbo8"; "libjpeg-turbo8" [shape=box]; "libjpeg-turbo8" -> "libc6"; "libtiff5" [shape=box]; "libtiff5" -> "libc6"; "libtiff5" -> "libjbig0"; "libtiff5" -> "libjpeg8"; "libtiff5" -> "liblzma5"; "libtiff5" -> "libwebp6"; "libtiff5" -> "libzstd1"; "libtiff5" -> "zlib1g"; "libjbig0" [shape=box]; "libjbig0" -> "libc6"; "libwebp6" [shape=box]; "libwebp6" -> "libc6"; "shared-mime-info" [shape=box]; "shared-mime-info" -> "libc6"; "shared-mime-info" -> "libglib2.0-0"; "shared-mime-info" -> "libxml2"; "libxml2" [shape=box]; "libxml2" -> "libc6"; "libxml2" -> "libicu63"; "libxml2" -> "liblzma5"; "libxml2" -> "zlib1g"; "libicu63" [shape=box]; "libicu63" -> "libc6"; "libicu63" -> "libgcc1"; "libicu63" -> "libstdc++6"; "libstdc++6" [shape=box]; "libstdc++6" -> "gcc-9-base"; "libstdc++6" -> "libc6"; "libstdc++6" -> "libgcc1"; "libgif7" [shape=box]; "libgif7" -> "libc6"; "libgnutls30" [shape=box]; "libgnutls30" -> "libc6"; "libgnutls30" -> "libgmp10"; "libgnutls30" -> "libhogweed4"; "libgnutls30" -> "libidn2-0"; "libgnutls30" -> "libnettle6"; "libgnutls30" -> "libp11-kit0"; "libgnutls30" -> "libtasn1-6"; "libgnutls30" -> "libunistring2"; "libgmp10" [shape=box]; "libgmp10" -> "libc6"; "libhogweed4" [shape=box]; "libhogweed4" -> "libc6"; "libhogweed4" -> "libgmp10"; "libhogweed4" -> "libnettle6"; "libnettle6" [shape=box]; "libnettle6" -> "libc6"; "libidn2-0" [shape=box]; "libidn2-0" -> "libc6"; "libidn2-0" -> "libunistring2"; "libunistring2" [shape=box]; "libunistring2" -> "libc6"; "libp11-kit0" [shape=box]; "libp11-kit0" -> "libc6"; "libp11-kit0" -> "libffi6"; "libtasn1-6" [shape=box]; "libtasn1-6" -> "libc6"; "libgpm2" [shape=box]; "libgpm2" -> "libc6"; "libgtk-3-0" [shape=box]; "libgtk-3-0" -> "adwaita-icon-theme"; "libgtk-3-0" -> "hicolor-icon-theme"; "libgtk-3-0" -> "libatk-bridge2.0-0"; "libgtk-3-0" -> "libatk1.0-0"; "libgtk-3-0" -> "libc6"; "libgtk-3-0" -> "libcairo-gobject2"; "libgtk-3-0" -> "libcairo2"; "libgtk-3-0" -> "libcolord2"; "libgtk-3-0" -> "libcups2"; "libgtk-3-0" -> "libepoxy0"; "libgtk-3-0" -> "libfontconfig1"; "libgtk-3-0" -> "libfreetype6"; "libgtk-3-0" -> "libfribidi0"; "libgtk-3-0" -> "libgdk-pixbuf2.0-0"; "libgtk-3-0" -> "libglib2.0-0"; "libgtk-3-0" -> "libgtk-3-common"; "libgtk-3-0" -> "libharfbuzz0b"; "libgtk-3-0" -> "libjson-glib-1.0-0"; "libgtk-3-0" -> "libpango-1.0-0"; "libgtk-3-0" -> "libpangocairo-1.0-0"; "libgtk-3-0" -> "libpangoft2-1.0-0"; "libgtk-3-0" -> "librest-0.7-0"; "libgtk-3-0" -> "libwayland-client0"; "libgtk-3-0" -> "libwayland-cursor0"; "libgtk-3-0" -> "libwayland-egl1"; "libgtk-3-0" -> "libx11-6"; "libgtk-3-0" -> "libxcomposite1"; "libgtk-3-0" -> "libxcursor1"; "libgtk-3-0" -> "libxdamage1"; "libgtk-3-0" -> "libxext6"; "libgtk-3-0" -> "libxfixes3"; "libgtk-3-0" -> "libxi6"; "libgtk-3-0" -> "libxinerama1"; "libgtk-3-0" -> "libxkbcommon0"; "libgtk-3-0" -> "libxrandr2"; "libgtk-3-0" -> "shared-mime-info"; "adwaita-icon-theme" [shape=box]; "adwaita-icon-theme" -> "adwaita-icon-theme-full"; "adwaita-icon-theme" -> "gtk-update-icon-cache"; "adwaita-icon-theme" -> "hicolor-icon-theme"; "adwaita-icon-theme" -> "librsvg2-common"; "adwaita-icon-theme" -> "ubuntu-mono"; "adwaita-icon-theme-full" [shape=box]; "adwaita-icon-theme-full" -> "adwaita-icon-theme"; "adwaita-icon-theme-full" -> "gtk-update-icon-cache"; "adwaita-icon-theme-full" -> "librsvg2-common"; "gtk-update-icon-cache" [shape=box]; "gtk-update-icon-cache" -> "libc6"; "gtk-update-icon-cache" -> "libgdk-pixbuf2.0-0"; "gtk-update-icon-cache" -> "libglib2.0-0"; "librsvg2-common" [shape=box]; "librsvg2-common" -> "libgdk-pixbuf2.0-0"; "librsvg2-common" -> "libglib2.0-0"; "librsvg2-common" -> "librsvg2-2"; "librsvg2-2" [shape=box]; "librsvg2-2" -> "libc6"; "librsvg2-2" -> "libcairo2"; "librsvg2-2" -> "libcroco3"; "librsvg2-2" -> "libfontconfig1"; "librsvg2-2" -> "libgcc1"; "librsvg2-2" -> "libgdk-pixbuf2.0-0"; "librsvg2-2" -> "libglib2.0-0"; "librsvg2-2" -> "libpango-1.0-0"; "librsvg2-2" -> "libpangocairo-1.0-0"; "librsvg2-2" -> "libpangoft2-1.0-0"; "librsvg2-2" -> "libxml2"; "libcroco3" [shape=box]; "libcroco3" -> "libc6"; "libcroco3" -> "libglib2.0-0"; "libcroco3" -> "libxml2"; "libpango-1.0-0" [shape=box]; "libpango-1.0-0" -> "fontconfig"; "libpango-1.0-0" -> "libc6"; "libpango-1.0-0" -> "libfribidi0"; "libpango-1.0-0" -> "libglib2.0-0"; "libpango-1.0-0" -> "libthai0"; "fontconfig" [shape=box]; "fontconfig" -> "fontconfig-config"; "fontconfig" -> "libc6"; "fontconfig" -> "libfontconfig1"; "fontconfig" -> "libfreetype6"; "libfribidi0" [shape=box]; "libfribidi0" -> "libc6"; "libthai0" [shape=box]; "libthai0" -> "libc6"; "libthai0" -> "libdatrie1"; "libthai0" -> "libthai-data"; "libdatrie1" [shape=box]; "libdatrie1" -> "libc6"; "libthai-data" [shape=box]; "libpangocairo-1.0-0" [shape=box]; "libpangocairo-1.0-0" -> "libc6"; "libpangocairo-1.0-0" -> "libcairo2"; "libpangocairo-1.0-0" -> "libfontconfig1"; "libpangocairo-1.0-0" -> "libfreetype6"; "libpangocairo-1.0-0" -> "libglib2.0-0"; "libpangocairo-1.0-0" -> "libpango-1.0-0"; "libpangocairo-1.0-0" -> "libpangoft2-1.0-0"; "libpangoft2-1.0-0" [shape=box]; "libpangoft2-1.0-0" -> "libc6"; "libpangoft2-1.0-0" -> "libfontconfig1"; "libpangoft2-1.0-0" -> "libfreetype6"; "libpangoft2-1.0-0" -> "libglib2.0-0"; "libpangoft2-1.0-0" -> "libharfbuzz0b"; "libpangoft2-1.0-0" -> "libpango-1.0-0"; "libharfbuzz0b" [shape=box]; "libharfbuzz0b" -> "libc6"; "libharfbuzz0b" -> "libfreetype6"; "libharfbuzz0b" -> "libglib2.0-0"; "libharfbuzz0b" -> "libgraphite2-3"; "libgraphite2-3" [shape=box]; "libgraphite2-3" -> "libc6"; "hicolor-icon-theme" [shape=ellipse]; "ubuntu-mono" [shape=box]; "ubuntu-mono" -> "adwaita-icon-theme"; "ubuntu-mono" -> "hicolor-icon-theme"; "ubuntu-mono" -> "humanity-icon-theme"; "humanity-icon-theme" [shape=box]; "humanity-icon-theme" -> "adwaita-icon-theme"; "humanity-icon-theme" -> "hicolor-icon-theme"; "libatk-bridge2.0-0" [shape=box]; "libatk-bridge2.0-0" -> "libatk1.0-0"; "libatk-bridge2.0-0" -> "libatspi2.0-0"; "libatk-bridge2.0-0" -> "libc6"; "libatk-bridge2.0-0" -> "libdbus-1-3"; "libatk-bridge2.0-0" -> "libglib2.0-0"; "libatk1.0-0" [shape=box]; "libatk1.0-0" -> "libatk1.0-data"; "libatk1.0-0" -> "libc6"; "libatk1.0-0" -> "libglib2.0-0"; "libatk1.0-data" [shape=ellipse]; "libatspi2.0-0" [shape=box]; "libatspi2.0-0" -> "libc6"; "libatspi2.0-0" -> "libdbus-1-3"; "libatspi2.0-0" -> "libglib2.0-0"; "libatspi2.0-0" -> "libx11-6"; "libcairo-gobject2" [shape=box]; "libcairo-gobject2" -> "libcairo2"; "libcairo-gobject2" -> "libglib2.0-0"; "libcolord2" [shape=box]; "libcolord2" -> "libc6"; "libcolord2" -> "libglib2.0-0"; "libcolord2" -> "liblcms2-2"; "libcolord2" -> "libudev1"; "liblcms2-2" [shape=box]; "liblcms2-2" -> "libc6"; "libudev1" [shape=box]; "libudev1" -> "libc6"; "libcups2" [shape=box]; "libcups2" -> "libavahi-client3"; "libcups2" -> "libavahi-common3"; "libcups2" -> "libc6"; "libcups2" -> "libgnutls30"; "libcups2" -> "libgssapi-krb5-2"; "libcups2" -> "zlib1g"; "libavahi-client3" [shape=box]; "libavahi-client3" -> "libavahi-common3"; "libavahi-client3" -> "libc6"; "libavahi-client3" -> "libdbus-1-3"; "libavahi-common3" [shape=box]; "libavahi-common3" -> "libavahi-common-data"; "libavahi-common3" -> "libc6"; "libavahi-common-data" [shape=box]; "libgssapi-krb5-2" [shape=box]; "libgssapi-krb5-2" -> "libc6"; "libgssapi-krb5-2" -> "libcom-err2"; "libgssapi-krb5-2" -> "libk5crypto3"; "libgssapi-krb5-2" -> "libkrb5-3"; "libgssapi-krb5-2" -> "libkrb5support0"; "libcom-err2" [shape=box]; "libcom-err2" -> "libc6"; "libk5crypto3" [shape=box]; "libk5crypto3" -> "libc6"; "libk5crypto3" -> "libkrb5support0"; "libkrb5support0" [shape=box]; "libkrb5support0" -> "libc6"; "libkrb5-3" [shape=box]; "libkrb5-3" -> "libc6"; "libkrb5-3" -> "libcom-err2"; "libkrb5-3" -> "libk5crypto3"; "libkrb5-3" -> "libkeyutils1"; "libkrb5-3" -> "libkrb5support0"; "libkrb5-3" -> "libssl1.1"; "libkeyutils1" [shape=box]; "libkeyutils1" -> "libc6"; "libssl1.1" [shape=box]; "libssl1.1" -> "debconf"; "libssl1.1" -> "debconf-2.0"; "libssl1.1" -> "libc6"; "debconf-2.0" [shape=ellipse]; "libepoxy0" [shape=box]; "libepoxy0" -> "libc6"; "libgtk-3-common" [shape=box]; "libgtk-3-common" -> "dconf-gsettings-backend"; "libgtk-3-common" -> "gsettings-backend"; "dconf-gsettings-backend" [shape=box]; "dconf-gsettings-backend" -> "dconf-service"; "dconf-gsettings-backend" -> "libc6"; "dconf-gsettings-backend" -> "libdconf1"; "dconf-gsettings-backend" -> "libglib2.0-0"; "dconf-service" [shape=box]; "dconf-service" -> "dbus-session-bus"; "dconf-service" -> "default-dbus-session-bus"; "dconf-service" -> "libc6"; "dconf-service" -> "libdconf1"; "dconf-service" -> "libglib2.0-0"; "dbus-session-bus" [shape=ellipse]; "default-dbus-session-bus" [shape=ellipse]; "libdconf1" [shape=box]; "libdconf1" -> "libc6"; "libdconf1" -> "libglib2.0-0"; "gsettings-backend" [shape=ellipse]; "libjson-glib-1.0-0" [shape=box]; "libjson-glib-1.0-0" -> "libc6"; "libjson-glib-1.0-0" -> "libglib2.0-0"; "libjson-glib-1.0-0" -> "libjson-glib-1.0-common"; "libjson-glib-1.0-common" [shape=ellipse]; "librest-0.7-0" [shape=box]; "librest-0.7-0" -> "libc6"; "librest-0.7-0" -> "libglib2.0-0"; "librest-0.7-0" -> "libsoup-gnome2.4-1"; "librest-0.7-0" -> "libsoup2.4-1"; "librest-0.7-0" -> "libxml2"; "libsoup-gnome2.4-1" [shape=box]; "libsoup-gnome2.4-1" -> "libc6"; "libsoup-gnome2.4-1" -> "libglib2.0-0"; "libsoup-gnome2.4-1" -> "libsoup2.4-1"; "libsoup2.4-1" [shape=box]; "libsoup2.4-1" -> "glib-networking"; "libsoup2.4-1" -> "libbrotli1"; "libsoup2.4-1" -> "libc6"; "libsoup2.4-1" -> "libglib2.0-0"; "libsoup2.4-1" -> "libgssapi-krb5-2"; "libsoup2.4-1" -> "libpsl5"; "libsoup2.4-1" -> "libsqlite3-0"; "libsoup2.4-1" -> "libxml2"; "libsoup2.4-1" -> "zlib1g"; "glib-networking" [shape=box]; "glib-networking" -> "glib-networking-common"; "glib-networking" -> "glib-networking-services"; "glib-networking" -> "gsettings-desktop-schemas"; "glib-networking" -> "libc6"; "glib-networking" -> "libglib2.0-0"; "glib-networking" -> "libgnutls30"; "glib-networking" -> "libproxy1v5"; "glib-networking-common" [shape=box]; "glib-networking-services" [shape=box]; "glib-networking-services" -> "glib-networking-common"; "glib-networking-services" -> "libc6"; "glib-networking-services" -> "libglib2.0-0"; "glib-networking-services" -> "libproxy1v5"; "libproxy1v5" [shape=box]; "libproxy1v5" -> "libc6"; "libproxy1v5" -> "libgcc1"; "libproxy1v5" -> "libstdc++6"; "gsettings-desktop-schemas" [shape=box]; "gsettings-desktop-schemas" -> "dconf-gsettings-backend"; "gsettings-desktop-schemas" -> "gsettings-backend"; "libbrotli1" [shape=box]; "libbrotli1" -> "libc6"; "libpsl5" [shape=box]; "libpsl5" -> "libc6"; "libpsl5" -> "libidn2-0"; "libpsl5" -> "libunistring2"; "libsqlite3-0" [shape=box]; "libsqlite3-0" -> "libc6"; "libwayland-client0" [shape=box]; "libwayland-client0" -> "libc6"; "libwayland-client0" -> "libffi6"; "libwayland-cursor0" [shape=box]; "libwayland-cursor0" -> "libc6"; "libwayland-cursor0" -> "libwayland-client0"; "libwayland-egl1" [shape=box]; "libwayland-egl1" -> "libc6"; "libxcomposite1" [shape=box]; "libxcomposite1" -> "libc6"; "libxcomposite1" -> "libx11-6"; "libxcursor1" [shape=box]; "libxcursor1" -> "libc6"; "libxcursor1" -> "libx11-6"; "libxcursor1" -> "libxfixes3"; "libxcursor1" -> "libxrender1"; "libxfixes3" [shape=box]; "libxfixes3" -> "libc6"; "libxfixes3" -> "libx11-6"; "libxdamage1" [shape=box]; "libxdamage1" -> "libc6"; "libxdamage1" -> "libx11-6"; "libxi6" [shape=box]; "libxi6" -> "libc6"; "libxi6" -> "libx11-6"; "libxi6" -> "libxext6"; "libxinerama1" [shape=box]; "libxinerama1" -> "libc6"; "libxinerama1" -> "libx11-6"; "libxinerama1" -> "libxext6"; "libxkbcommon0" [shape=box]; "libxkbcommon0" -> "libc6"; "libxkbcommon0" -> "xkb-data"; "xkb-data" [shape=box]; "libxrandr2" [shape=box]; "libxrandr2" -> "libc6"; "libxrandr2" -> "libx11-6"; "libxrandr2" -> "libxext6"; "libxrandr2" -> "libxrender1"; "libice6" [shape=box]; "libice6" -> "libbsd0"; "libice6" -> "libc6"; "libice6" -> "x11-common"; "x11-common" [shape=box]; "x11-common" -> "lsb-base"; "lsb-base" [shape=ellipse]; "libm17n-0" [shape=box]; "libm17n-0" -> "libc6"; "libm17n-0" -> "libfontconfig1"; "libm17n-0" -> "libfreetype6"; "libm17n-0" -> "libfribidi0"; "libm17n-0" -> "libgd3"; "libm17n-0" -> "libotf0"; "libm17n-0" -> "libthai0"; "libm17n-0" -> "libx11-6"; "libm17n-0" -> "libxft2"; "libm17n-0" -> "libxml2"; "libm17n-0" -> "libxt6"; "libm17n-0" -> "m17n-db"; "libgd3" [shape=box]; "libgd3" -> "libc6"; "libgd3" -> "libfontconfig1"; "libgd3" -> "libfreetype6"; "libgd3" -> "libjpeg8"; "libgd3" -> "libpng16-16"; "libgd3" -> "libtiff5"; "libgd3" -> "libwebp6"; "libgd3" -> "libxpm4"; "libgd3" -> "zlib1g"; "libxpm4" [shape=box]; "libxpm4" -> "libc6"; "libxpm4" -> "libx11-6"; "libotf0" [shape=box]; "libotf0" -> "libc6"; "libotf0" -> "libfreetype6"; "libxft2" [shape=box]; "libxft2" -> "libc6"; "libxft2" -> "libfontconfig1"; "libxft2" -> "libfreetype6"; "libxft2" -> "libx11-6"; "libxft2" -> "libxrender1"; "libxt6" [shape=box]; "libxt6" -> "libc6"; "libxt6" -> "libice6"; "libxt6" -> "libsm6"; "libxt6" -> "libx11-6"; "libsm6" [shape=box]; "libsm6" -> "libc6"; "libsm6" -> "libice6"; "libsm6" -> "libuuid1"; "m17n-db" [shape=box]; "libmagickcore-6.q16-6" [shape=box]; "libmagickcore-6.q16-6" -> "imagemagick-6-common"; "libmagickcore-6.q16-6" -> "libbz2-1.0"; "libmagickcore-6.q16-6" -> "libc6"; "libmagickcore-6.q16-6" -> "libfftw3-double3"; "libmagickcore-6.q16-6" -> "libfontconfig1"; "libmagickcore-6.q16-6" -> "libfreetype6"; "libmagickcore-6.q16-6" -> "libgcc1"; "libmagickcore-6.q16-6" -> "libgomp1"; "libmagickcore-6.q16-6" -> "libjbig0"; "libmagickcore-6.q16-6" -> "libjpeg8"; "libmagickcore-6.q16-6" -> "liblcms2-2"; "libmagickcore-6.q16-6" -> "liblqr-1-0"; "libmagickcore-6.q16-6" -> "libltdl7"; "libmagickcore-6.q16-6" -> "liblzma5"; "libmagickcore-6.q16-6" -> "libpng16-16"; "libmagickcore-6.q16-6" -> "libtiff5"; "libmagickcore-6.q16-6" -> "libwebp6"; "libmagickcore-6.q16-6" -> "libwebpmux3"; "libmagickcore-6.q16-6" -> "libx11-6"; "libmagickcore-6.q16-6" -> "libxext6"; "libmagickcore-6.q16-6" -> "libxml2"; "libmagickcore-6.q16-6" -> "zlib1g"; "libmagickcore-6.q16-6" -> "dpkg"[color=blue]; "imagemagick-6-common" [shape=box]; "libfftw3-double3" [shape=box]; "libfftw3-double3" -> "libc6"; "libfftw3-double3" -> "libgomp1"; "libgomp1" [shape=box]; "libgomp1" -> "gcc-9-base"; "libgomp1" -> "libc6"; "liblqr-1-0" [shape=box]; "liblqr-1-0" -> "libc6"; "liblqr-1-0" -> "libglib2.0-0"; "libltdl7" [shape=box]; "libltdl7" -> "libc6"; "libwebpmux3" [shape=box]; "libwebpmux3" -> "libc6"; "libwebpmux3" -> "libwebp6"; "libmagickwand-6.q16-6" [shape=box]; "libmagickwand-6.q16-6" -> "imagemagick-6-common"; "libmagickwand-6.q16-6" -> "libc6"; "libmagickwand-6.q16-6" -> "libgcc1"; "libmagickwand-6.q16-6" -> "libgomp1"; "libmagickwand-6.q16-6" -> "libmagickcore-6.q16-6"; "libmagickwand-6.q16-6" -> "libx11-6"; "libmagickwand-6.q16-6" -> "dpkg"[color=blue]; "libtinfo6" [shape=box]; "libtinfo6" -> "libc6"; "libx11-xcb1" [shape=box]; }
大概就是一团乱麻吧。
Nix包管理器
Nix是一个强大的包管理工具,它使得包管理更可靠并且可重现。Nix提供了原子级别的升级和回滚操作,多版本安装,多用户包管理,和方便的开发环境设置。
- Reliable
- Reproducible
- Great for developers
- Multi-user, multi-version
- Source/binary model
- Portable
About
Nix是一个引入了纯函数概念的包管理器。它把软件包当做值来处理。其打包过程也直接用函数来描述。正如函数式编程语言中纯函数的概念一般,相同的输入总会有相同的输出。在nix里面就是,一旦打包成功,包就不会再改变。Nix将软件包,保存在 /nix/store
下面,每个软件包都有自己独立的目录,例如:
/nix/store/j5swdjgkmg11x2zhi1gnr92mab46xj00-cmake-3.16.3
j5swdjgkmg11x2zhi1gnr92mab46xj00