C.3 Native

LedgerSMB provides installation tarballs for installing LSMB into the native file system. This installation method requires experience and detailed knowledge of both the Linux operating system and LedgerSMB. Experience has shown that getting prerequisites and security correct is sometimes a significant challenge.

The following commands were tested on a clean, default, server install with no snaps using ubuntu-22.04.3-live-server-amd64.iso.

The steps were extracted from the docker install at https://github.com/ledgersmb/ledgersmb-docker/blob/1.11/Dockerfile. This docker file should be considered the authoritative source.

Warning

The following commands need to be modified for proper security, which is the responsibility of the installer.

Make sure Ubuntu is up to date:

sudo apt update
sudo apt -y upgrade
sudo reboot

Install the prerequisites:

#!/bin/bash
#
# The following commands show an example of the commands
# that may be used for a native install.
#
# They have a number of shortcomings that an experienced
# Linux administrator should recognize and correct.
#
# For example, PostgreSQL is, by default, installed
# and running as a superuser and should not be.
#
set -e # stop on error
set -x # echo commands
sudo apt-get -y install \
cpanminus \
make \
gcc \
libperl-dev \
wget ca-certificates \
gnupg \
iproute2 \
libclass-c3-xs-perl \
texlive-plain-generic \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-xetex fonts-liberation \
lsb-release \
dh-make-perl \
libmodule-cpanfile-perl \
git \
wget
sudo apt-file update
# Another viable location is /usr/local/ledgersmb/
export INSTALL_LOCATION="/srv"
export LSMB_VERSION="1.11.8"
export LSMB_DL_DIR="Releases"
export ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
wget --quiet -O /tmp/ledgersmb-$LSMB_VERSION.tar.gz \
"$ARTIFACT_LOCATION"
sudo tar -xzf /tmp/ledgersmb-$LSMB_VERSION.tar.gz \
--directory "$INSTALL_LOCATION"
rm -f /tmp/ledgersmb-$LSMB_VERSION.tar.gz
cd ${INSTALL_LOCATION}/ledgersmb
gather () {
for lib in $(cpanfile-dump --with-all-features --recommends --no-configure --no-build --no-test)
do
if dh-make-perl locate "$lib" 2>/dev/null ;
then
:
else
echo no : $lib ;
fi ;
done
}
gather | grep -v dh-make-perl | \
grep -v ’not found’ | \
grep -vi ’is in Perl | \
cut -d -f4 | \
sort | \
uniq | \
sudo tee ${INSTALL_LOCATION}/derived-deps
sudo apt-get -y install $(cat ${INSTALL_LOCATION}/derived-deps)
sudo cpanm --quiet --notest \
--with-feature=starman \
--with-feature=latex-pdf-ps \
--installdeps ${INSTALL_LOCATION}/ledgersmb/
# Postgres
# From https://www.postgresql.org/download/linux/ubuntu/
sudo sh \
-c ’echo "deb https://apt.postgresql.org/pub/repos/apt \
$(lsb_release -cs)-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list’
wget --quiet -O \
- https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get -y update
# Warning: Actually using the default PG install is NOT best practice.
sudo apt-get -y install postgresql
# Optional clean up
# sudo apt-get purge -y git cpanminus \
# make gcc libperl-dev
# sudo apt-get autoremove -y
# sudo apt-get clean

Once all of the prerequisites have been installed the user can proceed by following the install instructions on the web site. For example, https://ledgersmb.org/content/installing-ledgersmb-111, starting at ”Configuring the PostgreSQL server”