4

Firefox in Ubuntu 18.04 had a special patch to enable global menu, which was dropped in subsequent versions. I want to install that version in 20.04. One way to do this is to grab the .deb file and run sudo apt-mark hold firefox. But then, I will have to manually apply an update when a new version is released.

Is there a way to configure apt so that only firefox will be installed (and updated) from 18.04 repositories, while all other software will be installed from 20.04 repositories?

(Although the global menu patch was dropped when Unity was discontinued, global menu is very much alive due to KDE Plasma's global menu feature).

1
  • 1
    There are answers which show how to specifically use Chromium from Debian repositories (to avoid snap version of chromium), so what I am asking for Firefox may be possible. Jan 2 at 7:46
10

In /etc/apt/sources.list.d/ add bionic sources, so it will be easier to remove it. To do this, create the file /etc/apt/sources.list.d/bionic.list with the following contents.

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

create /etc/apt/preferences.d/bionic.pref

#preference for firefox from bionic
    
Explanation: Allow installing firefox from bionic
Package: firefox
Pin: release a=bionic-updates
Pin-Priority: 1101

Explanation: Avoid other packages from the bionic repo.
Package: *
Pin: release a=bionic
Pin-Priority: 1

Proceed with

sudo apt update

first simulation, because I don't no if some ppa's included in your system.

apt -s full-upgrade
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be DOWNGRADED:
  firefox
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Inst firefox [84.0+build3-0ubuntu0.20.04.1] (84.0+build3-0ubuntu0.18.04.1 Ubuntu:18.04/bionic [amd64])
Conf firefox (84.0+build3-0ubuntu0.18.04.1 Ubuntu:18.04/bionic [amd64])

Then run sudo apt full-upgrade to install firefox from Ubuntu 18.04.

2
  • 1
    I edited your answer to use bionic-updates, which has Firefox 84. bionic has v59. Global menu works as well. Jan 3 at 7:30
  • I used your advice to replace the 20.04 "snap" version of Chromium (which doesn't use the same "Save As" dialog as other applications, and can't download files to hidden folders). Thanks to you, I'm now happily using the 18.04 version on 20.04 (although I'll be sticking to the 20.04 Firefox build for now!) Jul 15 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.