How to Install Newer Software in Debian or Ubuntu

  1. Using Debian backports.
  2. Using Ubuntu PPAs (Personal Package Archives).
  3. Adding a new, third-party software repository to your sources.list file.
  4. Downloading the software source code and compiling it yourself.
  5. Downloading .deb packages from the developer's page and installing them with dpkg.

Precautions on Third-Party Repositories and .deb Packages

The quality of software packages and how well they integrate with the rest of the system depend on their maintainers. For software included in the official distribution repositories, the quality is almost always very high. However, in the case of third-party repositories and .deb packages, there are no guarantees. Administrators should make sure that the maintainers are trustworthy and that the packages integrate well with the rest of the system and are always up to date with all of the available security fixes.

Install Newer Software Packages on Debian from Backports

Note: Most commands in this tutorial will require administrator privileges, so you will either need to log in as the root user, or, if you're logging in as a regular user, prefix the commands with sudo, e.g., sudo apt update instead of apt update.

cat /etc/apt/sources.list
deb http://mirrors.cloud.aliyuncs.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main non-free contrib
apt update
apt update && apt policy nginx
root@debian:~# apt policy nginx
nginx:
Installed: (none)
Candidate: 1.10.3-1+deb9u1
Version table:
1.14.0-1~bpo9+1 100
100 http://mirrors.cloud.aliyuncs.com/debian stretch-backports/main amd64 Packages
1.13.3-1~bpo9+1 100
100 http://mirrors.cloud.aliyuncs.com/debian stretch-backports/main amd64 Packages
1.10.3-1+deb9u1 500
500 http://mirrors.cloud.aliyuncs.com/debian stretch/main amd64 Packages
500 http://mirrors.cloud.aliyuncs.com/debian-security stretch/updates/main amd64 Packages
apt install nginx/stretch-backports
apt -t=stretch-backports install nginx

Install Newer Software from Ubuntu PPAs (Personal Package Archives)

Let’s take nginx as an example again. If we’re using Ubuntu 18.04 (codenamed Bionic), we can see that nginx version 1.14 is the latest available in the regular repositories (at the time of writing the tutorial): https://packages.ubuntu.com/bionic-updates/nginx. However, if we’re using Ubuntu 16.04, codenamed Xenial, only nginx 1.10 is available: https://packages.ubuntu.com/xenial-updates/nginx. If we search for “nginx ppa” on a web search engine, one of the top results will lead to this page: https://launchpad.net/~nginx/+archive/ubuntu/stable. Scrolling down, we will see that we have an nginx package at version 1.14 for Xenial (at the time of writing this tutorial). The same version is also available for Bionic, but it makes no sense to install it on that distribution since nginx 1.14 is already included in its regular repositories. At a later time, the situation may change though and the PPA may include a newer version than what Bionic will have available. Like in Debian, you can see a list of all versions available for packages with:

apt update && apt policy nginx
apt install software-properties-common
add-apt-repository ppa:nginx/stable
apt update
apt -V install nginx

Install Newer Software on Debian and Ubuntu from Third Party Sources

Since adding third party repositories or installing .deb packages directly from the upstream provider is generally the same, examples will be offered here. Compiling, however, is very specific to each application and for this reason the steps you have to follow are usually explained in detail on the developer's web page. Each program will require its own set of build tools, libraries, preparatory configuration steps, etc.

Add Third Party Software Repositories to APT’s sources.list

If you have no other options available, you may have to add an unofficial repository to your distribution’s package manager. This has the potential to mess up your installation if the packages are poorly maintained or insert malware. For these reasons, you should make sure that the maintainers of the repository are trustworthy and skilled in building .deb packages correctly.

wget https://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
apt edit-sources
deb http://nginx.org/packages/mainline/debian/ stretch nginx
apt update
apt install nginx

Install .deb Packages Downloaded from Third Party Sources

As a last resort to install a newer package than is available in the official Debian/Ubuntu repositories, some sites provide .deb files. You should make sure the source is trustworthy and the package is correctly constructed, otherwise it might make your system unstable, generate conflicts, etc. Generally, going this route has the added disadvantage of having to manually repeat the procedure each time a new .deb is released. Some developers do configure their packages in such a way that new repositories are automatically added to APT's sources.list, so that you can then easily upgrade the package with apt update && apt upgrade, but if this is the case, then you should simply add those lines yourself in the first place, by following the guidelines in the previous section.

wget https://atom-installer.github.com/v1.31.2/atom-amd64.deb
dpkg -i atom-amd64.deb
apt -f install

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com