15

I installed Opera 12.16 from a .deb for reasons. Just assume that I need this specific browser of this specific version and that there’s no alternative.

However, that deb depends on packages (such as the gstreamer0.10 series) which are not in my distribution anymore (Debian testing). This makes apt fail on every operation except apt remove opera with dependency errors:

# apt install cli-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 opera : Depends: gstreamer0.10-plugins-good but it is not installable
         Recommends: flashplugin-nonfree but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt --fix-broken install will just propose to remove opera:

# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  opera
0 upgraded, 0 newly installed, 1 to remove and 92 not upgraded.
1 not fully installed or removed.
After this operation, 46.6 MB disk space will be freed.
Do you want to continue? [Y/n]

Currently, my workaround is to install Opera when I need it, and remove it as soon as anything else needs to be done with apt. This is annoying.

Any suggestions? Ideally, I’d like to make apt ignore the dependencies of opera forever, since it works well-enough for my purposes.

Paulo Tomé
  • 3,782

2 Answers2

18

You can’t make apt ignore dependencies, but you can create a fake gstreamer0.10-plugins-good package which will satisfy the missing dependency. The simplest way to do this is using equivs:

  1. install equivs

    sudo apt install equivs
    
  2. generate a template control file

    equivs-control gstreamer0.10-plugins-good.control
    
  3. fix the package name

    sed -i 's/<package name; defaults to equivs-dummy>/gstreamer0.10-plugins-good/g' gstreamer0.10-plugins-good.control
    
  4. build the package

    equivs-build gstreamer0.10-plugins-good.control
    
  5. install it

    sudo dpkg -i gstreamer0.10-plugins-good_1.0_all.deb
    

That should satisfy the opera package’s dependency.

Stephen Kitt
  • 434,908
  • Does the equivs work anyway to solve the unmet dependencies (i mean when the apt-cache return nothing)? – GAD3R Nov 14 '17 at 09:48
  • 1
    @GAD3R I’m not sure what you mean. From the question, the only missing dependency is Depends: gstreamer0.10-plugins-good but it is not installable (the other is a Recommends which doesn’t matter). The commands I list above build an empty gstreamer0.10-plugins-good package which will satisfy the missing dependency without adding any of its own. – Stephen Kitt Nov 14 '17 at 09:53
  • Uninstalls opera to install equivs. Thanks! That did the trick! I’m not even sad that if a package flashplugin-nonfree ever appears in the repositories, I won’t be able to install it until it passes 1.0 :-) – Jonas Schäfer Nov 14 '17 at 12:19
  • 1
    Howdy. In 2018 is this really still the only way to truly ignore dependencies in Apt? The internet is telling me it is, though. – JDS Aug 16 '18 at 17:49
  • 1
    @JDS yes, it is the only way. Dependencies are there for a reason, it shouldn’t be easy to ignore them. – Stephen Kitt Aug 16 '18 at 18:26
  • This is brilliant. In my case, I'm using Ubuntu, which has a rather incomplete version of nginx — I have to compile my own. But this obviously leaves a 'hole' in the apt database, apt thinks that nginx is not installed (well... it's not on the database, that's for sure), so... equivs to the rescue! :-) – Gwyneth Llewelyn Sep 19 '20 at 00:04
  • This worked great to create a fake package for libappindicator3-1, required by slack-desktop and signal-desktop .deb files but not actually required at runtime. – user153965 Apr 05 '21 at 14:23
13

You can also remove the gstreamer0.10-plugins-good dependency of the opera package by editing /var/lib/dpkg/status.

Just open it with a text editor, search for the line Package: opera and under it in the Depends: line remove the offending gstreamer0.10-plugins-goodpackage.

After that apt works again.