Ubuntu – How to update software installed via .deb file

aptdpkgrepositoryupdatesupgrade

There are so many software which we installed via .deb file because official ubuntu repo has very old version of it. But I was just wondering how to update packages install via .deb file.

One particular example is sonic-visualiser
The official ubuntu has 3 years old 2.5 version while the official site has 3.0.3 version

Best Answer

While it can be that installing a program with the .deb package doesn't add the repository to apt for automatic updates, some .deb installations do just that: they add repositories to apt for further updates or make it possible for you to add them manually and then install the software. Example: 'Visual Studio Code'. https://code.visualstudio.com/docs/setup/linux

I cite from their website:

Debian and Ubuntu based distributions

The easiest way to install Visual Studio Code for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit), either through the graphical software center if it's available, or through the command line with:

sudo apt install ./<file>.deb

Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the system's package manager. Note that 32-bit and .tar.gz binaries are also available on the VS Code download page.

The repository and key can also be installed manually with the following script:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg 
sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/ 
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

Then update the package cache and install the package using:

sudo apt-get install apt-transport-https 
sudo apt-get update 
sudo apt-get install code # or code-insiders
Related Question