# install required packages for build
root@pve:~# apt install build-essential libsystemd-dev libselinux-dev libcap-ng-dev
# get sources
root@pve:~# wget https://github.com/smartmontools/smartmontools/releases/download/RELEASE_7_3/smartmontools-7.3.tar.gz
root@pve:~# tar zxvf smartmontools-7.3.tar.gz
root@pve:~# cd smartmontools-7.3/
# configure, use configuration params from current smartctl, you can get them running smartctl --version
root@pve:~/smartmontools-7.3# ./configure '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sysconfdir=/etc' '--mandir=/usr/share/man' '--with-initscriptdir=no' '--docdir=/usr/share/doc/smartmontools' '--with-attributelog=/var/lib/smartmontools/attrlog.' '--with-drivedbdir=/var/lib/smartmontools/drivedb' '--with-exampledir=/usr/share/doc/smartmontools/examples/' '--with-savestates=/var/lib/smartmontools/smartd.' '--with-smartdplugindir=/etc/smartmontools/smartd_warning.d' '--with-smartdscriptdir=/usr/share/smartmontools' '--with-systemdenvfile=/etc/default/smartmontools' '--with-systemdsystemunitdir=/lib/systemd/system' '--with-libsystemd=auto' '--with-selinux' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -Wall' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -Wall'
# build
root@pve:~/smartmontools-7.3# make
# check if new version works as expected
root@pve:~/smartmontools-7.3# ./smartctl --version
root@pve:~/smartmontools-7.3# ./smartctl -a /dev/sda
# if it works, install it over current version
root@pve:~/smartmontools-7.3# make install
# restart smartd service
root@pve:~/smartmontools-7.3# systemctl restart smartmontools.service