# STEP9
# install MPD (server)and MPC (music player)
# Music Player Daemon (MPD) Info:
# https://www.musicpd.org/
# create a simbolic link for backward compatibility with old version of MPD # which target by default the configuration file in /usr/local/etc/mpd.conf
$ ls /usr/local/etc
# result should be empty or not found then type
$ sudo rm -r /usr/local/etc
$ sudo ln -s /etc /usr/local/
# type again and result should show the files of etc/ directory
$ ls /usr/local/etc
# optional pkg update
$ sudo apt update
# install MPD
$ sudo apt install mpd mpc -y
# Check mpd version
$ mpd -V
# should be 0.21.22 or greater
# if the version is lower then compile and install mpd
# ( version 0.23.12 works really well with Raspberry PI 4 and Odroid C4, latest version works with barbone PC as well )
# our recommendation is to start with the super stable 0.23.12 and later give the latest version of MPD a try.
# you decide, you have the full info here to compile and install MPD, this is one of the benefit to get a full control of your audio server.
Click NEXT button below to skip the compilation of MPD …
# check your gcc version:
$ gcc --version
# if command not found install build-essential package
$ sudo apt -y install build-essential
# skip the gcc install if version is 8.x+ or greater
$ sudo apt install gcc-8-base
# FOR RASPBERRY PI 4 OWNERS:
# on compilation error increase swap file size,
# change default 100 to 1024
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=1024
# reboot if you change the swap size
$ sudo reboot
# get url archive from https://www.musicpd.org/download.html
# download latest archive mpd-0.23.x.tar.xz into your home directory (Downloads/ for example)
https://www.musicpd.org/download/mpd/0.2X/mpd-0.2X.XX.tar.xz
# be sure to select your /Downloads folder inside your home directory (create the folder Downloads if needed)
cd ~/Downloads
# hyper stable MPD release
$ sudo wget https://www.musicpd.org/download/mpd/0.23/mpd-0.23.12.tar.xz
# extract (replace -version by the version of mpd mpd-0.23.12.tar.xz):
$ sudo tar xf mpd-version.tar.xz
# enter directory:
$ cd mpd-0.23.12
# or get the very latest (unstable dev release) by cloning the MPD git to MPD/
# install git if not found
$ sudo apt install git
$ sudo git clone https://github.com/MusicPlayerDaemon/MPD.git
$ cd MPD
# install dependencies:
In any case, you need: a C++17 compiler (e.g. GCC 8 or clang 5) Meson 0.49.0 and Ninja Boost 1.58 pkg-config
$ sudo apt-get install ninja-build
# the command below must includes a lot of dev libraries
# be careful to double check it before validation with enter key
#
$ sudo apt install meson g++ \ libfmt-dev \ libpcre2-dev \ libmad0-dev libmpg123-dev libid3tag0-dev \ libflac-dev libvorbis-dev libopus-dev libogg-dev \ libadplug-dev libaudiofile-dev libsndfile1-dev libfaad-dev \ libfluidsynth-dev libgme-dev libmikmod-dev libmodplug-dev \ libmpcdec-dev libwavpack-dev libwildmidi-dev \ libsidplay2-dev libsidutils-dev libresid-builder-dev \ libavcodec-dev libavformat-dev \ libmp3lame-dev libtwolame-dev libshine-dev \ libsamplerate0-dev libsoxr-dev \ libbz2-dev libcdio-paranoia-dev libiso9660-dev libmms-dev \ libzzip-dev \ libcurl4-gnutls-dev libyajl-dev libexpat-dev \ libasound2-dev libao-dev libjack-jackd2-dev libopenal-dev \ libpulse-dev libshout3-dev \ libsndio-dev \ libmpdclient-dev \ libnfs-dev \ libupnp-dev \ libavahi-client-dev \ libsqlite3-dev \ libsystemd-dev \ libgtest-dev \ libboost-dev \ libicu-dev \ libchromaprint-dev \ libgcrypt20-dev
# reboot maybe required here # check meson version (0.49 minimum)
$ meson -v
# configure:
$ sudo meson . output/release --buildtype=debugoptimized -Db_ndebug=true -Dsysconfdir=/etc
# check configuration:
$ sudo meson configure output/release
# compile (could take a while… ):
$ sudo ninja -C output/release
# install:
# stop mpd in case it’s running
$ sudo systemctl stop mpd
$ sudo ninja -C output/release install
# go to home directory
$ cd ~/
# Congrats! MPD is compiled and installed
Click the button NEXT below to continue…