76

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
  • 939
  • I install only software that I trust and know. I just don't want to install it from terminal because from software install it's easier and faster – 0xFR Apr 29 '20 at 12:44
  • what if I need to install a 3rd party software with a .deb? Until 3 days ago everything was ok – 0xFR Apr 29 '20 at 12:49
  • 1
    I would anser that you install it using a terminal and see what is the problem. It a terminal you see the output. It is really faster and more clear. When you blindly try to install a deb from GUI, you don't see if there is any trouble. – Pilot6 Apr 29 '20 at 12:53
  • 1
    yes, I've done it, but the problem is that from terminal it installs it without any problem or error. I don't have problems installing .deb, I've problems installing it from software install when i shouldn't have problems. So the problem is in software install. – 0xFR Apr 29 '20 at 12:57
  • You can report a bug if you like. But that app IS NOT DESIGNED to install each and every deb. – Pilot6 Apr 29 '20 at 12:59
  • so why until a few days ago he did install them without problems? it says file not supported, but it was supported until a few days ago and i don't think ubuntu suggests you to install .deb from software install when software install cannot install them – 0xFR Apr 29 '20 at 13:01
  • 7
    You should rather use sudo apt install ./my_filename.deb than dpkg directly. That way it can do dependency resolution etc. properly, which dpkg does not. Note you need an absolute or explicit relative (i.e. starting with ./) path for apt, so that it can distinguish if it is a file or a package name. – Byte Commander Apr 29 '20 at 13:06

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,341
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
  • 70,711
  • 1
    @fedeUbuntu You can't. This is probably the best answer you're going to see. – heynnema Apr 29 '20 at 16:12
  • 2
    @fedeUbuntu I believe that in 20.04 Ubuntu Software/Software Center has been slanted towards snap apps, but I can't say for sure, as the option to install 20.04 hasn't popped up on my system yet :-( – heynnema Apr 29 '20 at 16:15
  • Can you explain how gdebi is better than the "Software Install" option I see in the menu there too? Is it better? – Gabriel Staples Aug 09 '20 at 19:28
  • Nevermind: the edit in the question indicates Software Install doesn't work here, so apparently "GDebi Package Installer" does work in cases where "Software Install" fails. Do you know why gdebi works in cases where Software Install fails? – Gabriel Staples Aug 09 '20 at 19:30
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,557
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
  • 169
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/