6

In Ubuntu LTS, applications are locked to the version fixed to the release date. For Ubuntu 22.04 "Jammy" those are:

I would like to install the latest upstream versions of these applications on my home server.

How can I do this in an easy and reliable way?

Artur Meinild
  • 26,018
  • 1
    An easy way would be possible only if there is someone who already packages the upstream version built for Ubuntu 22.04 and makes it available as PPA. Probably this is not the case. Other than that, the only correct way to install an upstream version is to compile it from source package, but it can't be called an "easy" way. – raj Dec 20 '22 at 10:39

3 Answers3

5

This can be done in at least two ways (the Snap way and the Debian way) - but I greatly prefer the Debian method. It's also possible to mix and match of you prefer, and install some apps with Snap, and some with Debian packages.

Please note that neither of these methods are recommended for production use, but both should be perfectly suitable for home use.

The Snap Way

This method will give you updated versions of apps, provided there is a Snap maintainer that regularly updates the packages. Unfortunately, this is not always the case. Another benefit is that apps auto-update with new releases.

Some popular command-line apps are available as Snap packages.

  • nano (seems abandoned since June 2021)
  • htop (maintained, updated June 2022)
  • tmux (last updated February 2022)
  • lnav (last updated November 2021)

Each of these apps can be installed from the command line:

  • nano: (not recommended at the moment, since the snap seems abandoned)

    sudo snap install nano --classic
    
  • htop:

    sudo snap install htop
    sudo snap connect htop:mount-observe
    sudo snap connect htop:network-control
    
  • tmux:

    sudo snap install tmux-non-dead --classic
    
  • lnav:

    sudo snap install lnav
    

If you choose to do so, remove the corresponding Debian packages:

sudo apt remove nano htop tmux lnav

My own experience with these Snap packages are somewhat mixed, which is why I choose the Debian method described below. Examples of problems I experienced:

  • nano suddenly stopped working
  • tmux was suddenly "updated" to a version more than a 1,5 years old (v 2.7)
  • htop manpages was missing completely

Another general issue with snaps is that the manpages are not easily available - it requires a dirty hack to even get them working.

The Debian Way

This method will give you updated versions of apps, provided there is a Debian maintainer that regularly updates the packages. This is usually the case. In this scenario, you have to manually update the packages with each new release. Also, since Debian and Ubuntu are not 1:1 binary compatible, issues may in rare occasions arise from this method. Always try on a VM first!

With this method, you install updated versions directly from the Debian testing or unstable branches. This is somewhat experimental, but should still be safe for home use - and rather easy to rollback to a previous version in any case. I've done this for over 2 years without any problems whatsoever. The only drawback is that you have to manually update the applications installed in this way.

First, you locate the applications in the Debian Sid branch (usually has the latest packages):

Then, for each package check that the dependencies are actually compatible with your Ubuntu version. They usually are - but in the very end of the Ubuntu LTS cycle, there may be some cases where Debian uses a newer version of a library than Ubuntu - pay attention to this.

Now, create a directory, and download the correct version of each package (here for amd64 architecture, version of 2022.12.20):

wget \ 
http://ftp.de.debian.org/debian/pool/main/n/nano/nano_7.1-1_amd64.deb \
http://ftp.de.debian.org/debian/pool/main/h/htop/htop_3.2.1-1_amd64.deb \
http://ftp.de.debian.org/debian/pool/main/t/tmux/tmux_3.3a-3_amd64.deb \
http://ftp.de.debian.org/debian/pool/main/l/lnav/lnav_0.11.1-1_amd64.deb

Finally, install the packages from these files (version of 2022.12.20): (I usually test the installation on a VM first, before I install on a physical server)

sudo apt install \ 
./nano_7.1-1_amd64.deb \
./htop_3.2.1-1_amd64.deb \
./tmux_3.3a-3_amd64.deb \
./lnav_0.11.1-1_amd64.deb

Now you have the latest upstream versions of these applications installed. Please be careful to check the configuration files after each upgrade, since there can be changes in syntax etc. that needs to be fixed.

For the advanced user, you could create a script that monitors new versions of these Debian packages, and send you an alert when this is the case.

Artur Meinild
  • 26,018
  • 2
    A "safe" way was asked. The debian way certainly is not the safe way. In principle, Debian and Ubuntu are not binary compatible. So installing binaries not intended for the Ubuntu system is a hit or miss, where, allegedly for these small utilities, there is more chance for a hit than for a miss. Compiling source code would be the safe way, but then that does not satisfy the "easy" requirement. However, that is also the case if "things need to be fixed" during installation of a deb. – vanadium Dec 20 '22 at 10:07
  • 1
    Duly noted. I removed "safe" from the question, and added additional disclaimer about always testing on a VM first. I certainly agree that you have to be careful and know what you're doing. Thanks. – Artur Meinild Dec 20 '22 at 10:12
  • 1
    You forgot Flatpak, what the rest of the linux community uses these days. – SnakeDoc Dec 20 '22 at 18:19
  • Not on a server - but else you're right... – Artur Meinild Dec 20 '22 at 19:41
  • @ArturMeinild Very true. I had assumed most folks running ubuntu aren't using the minimal install/headless options. – SnakeDoc Dec 21 '22 at 18:25
5

The Homebrew way

Install Homebrew -- it's generally known as a package installer for MacOS, but it works perfectly well on Linux.

The versions available for those tools:

$ brew info nano htop tmux lnav
==> nano: stable 7.1 (bottled)
[...]
==> htop: stable 3.2.1 (bottled), HEAD
[...]
==> tmux: stable 3.3a (bottled), HEAD
[...]
==> lnav: stable 0.11.1 (bottled), HEAD
[...]

To install them:

$ brew install nano htop tmux lnav

They will install into a separate directory that you'll have to add to the start of your PATH. On my Ubuntu system, it's /home/linuxbrew/.linuxbrew/bin. The installer will guide you there.

glenn jackman
  • 17,900
0

There is an additional option that I have not yet explored myself - but it might be interesting for some users.

The Pacstall way

Please note that this could be considered experimental - the usual disclaimer applies - never run anything you don't trust.

A project exists called "Pacstall" - it corresponds to the Arch User Repository, by making easy-to-run install scripts for updated Ubuntu packages.

The installation method may vary - it can be compiling, .deb packages, and other installation methods as well.

Pacstall is installed by running their install script:

sudo bash -c "$(wget -q https://git.io/JsADh -O -)"

This will install the application itself. You may need additional binaries for compilation:

sudo apt install build-essential

After this is done, you can use the pacstall command to install supported applications. From the apps listed in the question, the following are currently available:

  • nano (orphaned)
  • htop (maintained)
  • tmux (maintained)
  • lnav (not available)

The install script for each application is executed with the pacstall command, i.e.:

pacstall -I <package-name>

This would be the easy way to install the correct binaries or compile supported applications from source.

Artur Meinild
  • 26,018