77

I tried to install some .deb files in Ubuntu 20.04 from GitHub and other internet sources, but when I open it with Software Install it gives me this problem (Failed to install file: not supported). The only way for me to install them is to go to the downloaded file and do sudo dpkg -i file.deb.

Can anyone help? I don't know what to do and I don't want to use the terminal every time.

Any help would be appreciated, thanks

EDIT: that's NOT a problem with .deb in Ubuntu, it is a problem with Software install. I can install every .deb through the terminal but not with Software install, and Ubuntu suggests to install .deb with Software install. That's not a dependencies problem or anything similar, that's an issue with installing .deb WITH Software install and I would like to know how I can fix Software installer

0xFR
  • 949
  • 1
  • 8
  • 16

6 Answers6

134

If you are using firefox, and opted to download and open the file with Software Install, what has likely occurred is the file has been downloaded into the /tmp/mozilla_userX directory, from which the Ubuntu Software Installer is not able to install anything.

Opting to save the file first before opening with Software Install should solve this issue.

For files that have already been downloaded, moving the file out of the /tmp/mozilla_userX directory into a sub-directory of /home/user/, e.g. Downloads, should solve the problem.

Henry Xing
  • 1,441
38

If you're looking for a reliable GUI way to install .deb files, use gdebi.

To see if you already have it installed on your system...

dpkg -l gdebi | grep ii

If it's not there, install it this way...

sudo apt-get update
sudo apt-get install gdebi

Then get the "Properties" of any .deb file, and set the default "Open With" application as gdebi. Now you can just double-click on .deb files to install them.

enter image description here

Note: gdebi may not operate properly if .deb files are on the desktop.

Update #1:

gdebi is broken in Ubuntu 21.04.

heynnema
  • 73,649
12

I'm experiencing the same problem, but if in the browser I choose "Save file" rather than "Open with: Software Install", then right click the saved file and open with Software Install, it works (it doesn't work with Ubuntu Software directly in either case).

Afaict, Software Install is part of Ubuntu Software

joel
  • 42
6

The Problem

Ubuntu 20.04 has two 'Software Install' applications, one is gnome-software and the other is snap-store, installed by Canonical via snap. This snap app software centre has the problem installing local files from the /tmp directory. Can be easily verified by running these commands:

gnome-software --local-filename '/tmp/mozilla_user0/app_amd64.deb'

snap-store --local-filename '/tmp/mozilla_user0/app_amd64.deb'

The snap-store command will error with Failed to install file: not supported

Workarounds

You can install gdebi or similar software as suggested in other answers but there is a workaround to modify the file association to use the other Software Install which is associated with gnome-software:

Firefox

When choosing application to open change for the suggested or default Software Install to the other further down the list. This second one is the gnome-software association.

enter image description here

You can verify that it is gnome-software in Preferences->Applications:

enter image description here

Nautilus

The same can be done within Nautilus by right-clicking and opening Properties for a /tmp/.deb file and switching the Open with from current default Software Install to the other suggestion.

[enter image description here]

Cas
  • 8,707
2

Just moved to Ubuntu and I've also been bitten by this.

Solution 1

  1. The easy solution like others have mentioned is just save it Downloads and then install using Software Install. Works fine.

Solution 2

  1. create a folder in your home directory, eg ~/tmp
  2. issue a command TMPDIR="~/tmp" firefox &

Breakdown of command: TMPDIR="~/tmp" is setting the TMPDIR env variable to a folder in home folder. firefox & is invoking firefox in the background. With this, opening a deb file via Ubuntu Software will now work as intended.

This only sets TMPDIR in firefox, so other programs will continue to use the canonical location of /tmp. You could set this in your bash if you wanted to, but I'm not sure of the ramifications of moving /tmp files. For example, you need to make sure the ~/tmp files get deleted on reboot.

Personally I prefer to use the first solution, and just download my deb files under Downloads/deb for example. That way I can easily uninstall them using Ubuntu Software. Instead of fiddling with the command-line.

chriz
  • 179
0

This really is an issue with file association. For some reason the files .deb are not associated correctly. If you download the file, right-click, properties. Then go to the open-with tab and select the right file association (software install) then set as default. Try again. In my case it even looked ok but I had to set to "Archive Manager" and set as default, confirm, get out, go back, set to "Software Install", make default, confirm and try again for it to work. But then all is fine (both on a french and english install). Solution was found here: https://itsfoss.com/cant-install-deb-file-ubuntu/