bkbilly / lnxlink

🖥 Effortlessly manage your Linux machine using MQTT.
https://bkbilly.gitbook.io/lnxlink
MIT License
262 stars 29 forks source link

[Request] Add a minimal install script for headless servers #129

Closed jeremysherriff closed 1 week ago

jeremysherriff commented 2 weeks ago

Describe the solution you'd like

I'd like to see a simple one-liner script that installs the minimal requirements for LNXLink on a headless server instance. The Setup docs can offer this as an option:

Full install:
curl -L https://raw.githubusercontent.com/bkbilly/lnxlink/master/install.sh | bash

Minimal install, for headless servers:
curl -L https://raw.githubusercontent.com/bkbilly/lnxlink/master/install-minimal.sh | bash

This would likely require a bit more documentation to help sysadmins figure out what each module needs as a dependency.

Additional context

I ran the install script on a single-purpose Debian virtual machine and was surprised to see how many GUI-oriented components were installed. Log snippets:

PIPX not found, installing from debian/ubuntu package manager:
...
The following NEW packages will be installed:
  blt fontconfig-config fonts-dejavu-core fonts-lato ghp-import javascript-common libfontconfig1 libgfortran5 libjs-bootstrap4
  libjs-highlight.js libjs-jquery libjs-lunr libjs-modernizr libjs-popper.js libjs-sizzle libjs-sphinxdoc libjs-underscore liblapack3
  libquadmath0 libtcl8.6 libtk8.6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxft2 libxrender1 libxss1 libyaml-0-2
  mkdocs node-jquery pipx python-babel-localedata python3-argcomplete python3-attr python3-babel python3-click python3-colorama
  python3-dateutil python3-iniconfig python3-jinja2 python3-joblib python3-livereload python3-lunr python3-markdown
  python3-markupsafe python3-mergedeep python3-more-itertools python3-nltk python3-numpy python3-packaging python3-pip-whl
  python3-pluggy python3-psutil python3-py python3-pygments python3-pyinotify python3-pytest python3-pyyaml-env-tag python3-regex
  python3-setuptools-whl python3-simplejson python3-tk python3-tornado python3-tqdm python3-tz python3-userpath python3-venv
  python3-watchdog python3-yaml python3.11-venv sphinx-rtd-theme-common tk8.6-blt2.5 x11-common
0 upgraded, 76 newly installed, 0 to remove and 0 not upgraded.
...

Installing system dependencies...
Found dbus...
...
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-12 dpkg-dev fakeroot g++ g++-12 gcc gcc-12
  gir1.2-freedesktop gir1.2-glib-2.0 gobject-introspection libabsl20220623 libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libaom3 libasan8 libatomic1 libavif15 libbinutils libblkid-dev libbrotli-dev libc-dev-bin libc-devtools
  libc6-dev libcairo-gobject2 libcairo-script-interpreter2 libcairo2 libcairo2-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0
  libdav1d6 libdbus-1-dev libdbus-glib-1-2 libdbus-glib-1-dev libdbus-glib-1-dev-bin libde265-0 libdeflate0 libdpkg-perl
  libexpat1-dev libfakeroot libffi-dev libfile-fcntllock-perl libfontconfig-dev libfreetype-dev libgav1-1 libgcc-12-dev libgd3
  libgirepository-1.0-1 libgirepository1.0-dev libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libgomp1 libgprofng0 libheif1
  libice-dev libice6 libisl23 libitm1 libjbig0 libjpeg62-turbo liblerc4 liblsan0 libmount-dev libmpc3 libmpfr6 libnsl-dev
  libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpixman-1-0 libpixman-1-dev libpkgconf3 libpng-dev libpng-tools
  libpthread-stubs0-dev librav1e0 libselinux1-dev libsepol-dev libsm-dev libsm6 libstdc++-12-dev libsvtav1enc1 libtiff6 libtirpc-dev
  libtsan2 libubsan1 libwebp7 libx11-dev libx265-199 libxau-dev libxcb-render0 libxcb-render0-dev libxcb-shm0 libxcb-shm0-dev
  libxcb1-dev libxdmcp-dev libxext-dev libxpm4 libxrender-dev libyuv0 linux-libc-dev make manpages-dev meson ninja-build patchelf
  pkg-config pkgconf pkgconf-bin python3-mako rpcsvc-proto sgml-base uuid-dev x11proto-core-dev x11proto-dev xml-core
  xorg-sgml-doctools xtrans-dev zlib1g-dev
0 upgraded, 128 newly installed, 0 to remove and 0 not upgraded.
...

The following NEW packages will be installed:
  alsa-topology-conf alsa-ucm-conf libasound2 libasound2-data libasound2-dev libauthen-sasl-perl libclone-perl libdata-dump-perl
  libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libduktape207 libegl-mesa0 libegl1
  libencode-locale-perl libfile-basedir-perl libfile-desktopentry-perl libfile-listing-perl libfile-mimeinfo-perl libfont-afm-perl
  libfontenc1 libgbm1 libgl1 libgl1-mesa-dri libglapi-mesa libgles2 libglvnd0 libglx-mesa0 libglx0 libgudev-1.0-0 libhtml-form-perl
  libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl
  libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl libio-stringy-perl
  libipc-system-simple-perl libjack-jackd2-0 libjack-jackd2-dev libllvm15 liblwp-mediatypes-perl liblwp-protocol-https-perl
  libmailtools-perl libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libopus0 libpciaccess0
  libpolkit-agent-1-0 libpolkit-gobject-1-0 libportaudio2 libportaudiocpp0 libregexp-ipv6-perl libsamplerate0 libsensors-config
  libsensors5 libtie-ixhash-perl libtimedate-perl libtry-tiny-perl libupower-glib3 liburi-perl libwayland-client0 libwayland-server0
  libwww-perl libwww-robotrules-perl libx11-protocol-perl libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0
  libxcb-randr0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1 libxdo3 libxfixes3 libxi6 libxinerama1
  libxkbcommon0 libxkbfile1 libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl libxmu6 libxmuu1 libxrandr2 libxshmfence1
  libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 libz3-4 perl-openssl-defaults polkitd portaudio19-dev python3-pyaudio upower
  x11-utils x11-xserver-utils xdg-utils xdotool zutty
0 upgraded, 118 newly installed, 0 to remove and 0 not upgraded.
...

Installing LNXlink...

That's a total of 322 packages added, but only a few that I actually need.

bkbilly commented 2 weeks ago

Most of these packages that are installed through the installation script are needed for running LNXlink without issues with a few exceptions:

  1. There is a check for the DBUS which if it exists, it will automatically install the dependencies that are needed. In your case it seems that you are running DBUS, so that's why it installs it's dependencies.
  2. Some modules need some tools and libraries installed which could be considered as optional. I could add a check for finding if the server is Headless by checking the DISPLAY variable.

The simplest and most minimal method to install LNXlink without any of the above dependencies is to follow the README instructions which suggest the command pipx install lnxlink. If you don't want to use pipx you can replace it with pip.

In my opinion there is no need for creating a second script because it will make the installation process much more confusing and there is no need for it as long as it can be installed using pip.

jeremysherriff commented 1 week ago

Understood, closing as not planned.