Announcement

Collapse
No announcement yet.

How to set priority for a PPA. I.e. using Firefox without SNAPD

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to set priority for a PPA. I.e. using Firefox without SNAPD

    With the release of 22.04, a very popular browser - Firefox - is now only available from Ubuntu as a snap package. Many of us prefer not to use snap for various reasons, including reportedly the snap version of Firefox seems slower than it's debian packaged version.

    Well if this is you, you're in luck. You can change it. In this How-To I will describe the following steps:
    1. Removing snapd from your system.
    2. Installing the Mozilla Team PPA and Firefox.
    3. Setting the Mozilla Team PPA above the default releases.
    This How-To does not come with a warranty. Your mileage may vary.
    Although everything in this How-To has been tested and is reversible, I suggest making a backup before following this or any other How-To.
    This How-To uses only terminal commands and I used Konsole.
    This How-To assumes you are working with a new installation of Kubuntu 22.04 and will not address snap packages other than the Firefox from a default installation.

    Commands to enter will look like this:
    command here

    and the output will follow like this:
    Code:
    here is the output
    of the above command
    These procedures can be used for other PPAs and I will explain how to prioritize a single package rather than an entire PPA if you desire .

    Step 1. Removing snapd and dependencies:

    sudo apt remove --purge snapd
    sudo apt autoremove
    sudo apt-get remove --purge libsnapd-qt1 chromium-codecs-ffmpeg-extra


    At this point, you should no longer see "loop" devices in the output of lsblk. Snapd is removed along with all packages not needed.

    *Note the package libsnapd-glib1 remains installed due to dependencies with pulseaudio and others.

    Step 2: Install the Mozilla Team PPA and Firefox

    sudo add-apt-repository ppa:mozillateam/ppa
    sudo apt update
    sudo apt install -t 'o=LP-PPA-mozillateam' firefox


    You now have the debian packaged version of the latest Firefox release installed.
    However, a full apt upgrade will replace it with the snap version again. We prevent that in the next step.

    Step 3: Set the Mozilla Team PPA to higher priority.

    sudo touch /etc/apt/preferences.d/99mozillateam
    sudo nano /etc/apt/preferences.d/99mozillateam


    Add the following to the 99mozillateam file:
    Code:
    Package: *
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 900
    and save and exit nano. Now enter this to update apt:

    sudo apt update

    You now have set all packages from the Mozilla Team PPA at a higher priority than the default packages. To verify this run this command:

    apt-cache policy

    The output will be fairly long. Here is the first part:
    Code:
    Package files:
     100 /var/lib/dpkg/status
         release a=now
     900 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main i386 Packages
         release v=22.04,o=LP-PPA-mozillateam,a=jammy,n=jammy,l=Firefox ESR and Thunderbird stable builds,c=main,b=i386
         origin ppa.launchpadcontent.net
     900 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
         release v=22.04,o=LP-PPA-mozillateam,a=jammy,n=jammy,l=Firefox ESR and Thunderbird stable builds,c=main,b=amd64
         origin ppa.launchpadcontent.net
    and a later part:
    Code:
     500 http://us.archive.ubuntu.com/ubuntu jammy/main i386 Packages
         release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=main,b =i386
         origin us.archive.ubuntu.com
     500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
         release v=22.04,o=Ubuntu,a=jammy,n=jammy,l=Ubuntu,c=main,b =amd64
         origin us.archive.ubuntu.com
    Pinned packages:
    Note the Mozilla Team PPA shows a priority of 900 while Ubuntu Main (where Firefox snap version is) is at the default of 500.

    Lets look at the priority of just the Firefox package:

    apt-cache policy firefox
    Code:
    firefox:
      Installed: 100.0+build1-0ubuntu0.22.04.1~mt1
      Candidate: 100.0+build1-0ubuntu0.22.04.1~mt1
      Version table:
         1:1snap1-0ubuntu2 500
            500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
     *** 100.0+build1-0ubuntu0.22.04.1~mt1 900
            900 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
            100 /var/lib/dpkg/status
    Here, note the package has a 900 priority as well as the PPA. The *** indicates this package is installed.
    Also note the priority number is listed ahead of the PPA line, but trails an individual package.

    You can also use the above method to lower the priority of a PPA below the default 500 so that you can install a particular package from a PPA without installing everything from it.

    At this point, Thunderbird will also come from the Mozilla Team (currently one point higher version). If you wish to avoid this, you can set only the priority for the Firefox package.

    To accomplish this, simply change the contents of /etc/apt/preferences.d/99mozillateam as edited above to:
    Code:
    Package: firefox
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 900
    Then enter this again:
    sudo apt update

    Now the Mozilla Team PPA is at the default priority:

    apt-cache policy
    Code:
    Package files:
     100 /var/lib/dpkg/status
         release a=now
     500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main i386 Packages
         release v=22.04,o=LP-PPA-mozillateam,a=jammy,n=jammy,l=Firefox ESR and Thunderbird stable builds,c=main,b=i386
         origin ppa.launchpadcontent.net
     500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
         release v=22.04,o=LP-PPA-mozillateam,a=jammy,n=jammy,l=Firefox ESR and Thunderbird stable builds,c=main,b=amd64
         origin ppa.launchpadcontent.net
    ~~~
    But the Firefox package is still at the higher priority:

    apt-cache policy firefox
    Code:
    firefox:
      Installed: 100.0+build1-0ubuntu0.22.04.1~mt1
      Candidate: 100.0+build1-0ubuntu0.22.04.1~mt1
      Version table:
         1:1snap1-0ubuntu2 500
            500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
     *** 100.0+build1-0ubuntu0.22.04.1~mt1 900
            500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
            100 /var/lib/dpkg/status
    Note the difference here is the package shows 900 priority while the PPA still indicates 500.

    You can add other packages from this PPA the same way, for example Thunderbird, by adding additional stanzas to /etc/apt/preferences.d/99mozillateam:
    Code:
    Package: firefox
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 900
    
    Package: thunderbird
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 900
    Don't forget to update apt after every edit of this file(s):
    sudo apt update

    The above techniques apply to any PPA or package.

    Enjoy your snap free Kubuntu and Firefox!

    Please Read Me

    #2
    Nice write up. Followed it without any issues. Nice to have a 'quick' loading Firefox again!
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Thanks.

      Comment


        #4
        Great to see a detailed explanation of how to do it. I do not have a fresh installation, so I am wondering if what I had done previously has had an impact on what I have. I noticed that my version of Firefox is 99.0.1

        Code:
        apt-cache policy firefox
        firefox:
         Installed: 99.0.1+build1-0ubuntu0.22.04.1~mt1
         Candidate: 99.0.1+build1-0ubuntu0.22.04.1~mt1
         Version table:
            100.0+build1-0ubuntu0.22.04.1~mt1 900
               500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
        *** 99.0.1+build1-0ubuntu0.22.04.1~mt1 1001
               100 /var/lib/dpkg/status
        I am wondering how to get rid of 99.0.1 being at a priority of 1001 as this is stopping version 100.0 from being installed.

        I now have Version 100.0 !!!!
        Code:
        $ apt-cache policy firefox                           
        firefox:
         Installed: 100.0+build1-0ubuntu0.22.04.1~mt1
         Candidate: 100.0+build1-0ubuntu0.22.04.1~mt1
         Version table:
        *** 100.0+build1-0ubuntu0.22.04.1~mt1 900
               500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
               100 /var/lib/dpkg/status
        Solved by removing Firefox and then using muon to install Firefox and to my great surprise I got version 100 without snap.
        Last edited by Snowhog; Apr 27, 2022, 03:30 PM.

        Comment


          #5
          Fine, but Digikam is now a Snap. As the years go on more will become Snaps

          Comment


          #6
          Note that the PPA may give a beta release of Firefox. Presently one gets version 100.
          Regards, John Little

          Comment


            #7
            On a fresh install of jammy I went through the steps above, except that I did not perform step 1, because I think I need to keep snaps and the snap daemon for other software.

            This resulted in the problem that the menu entry and the panel widget still started the firefox snap version. I had to remove the widget, "Edit applications", and identify the snap firefox menu entry by the command being used, and change it's name to make them distinguishable. Then I could use the menu to add a new widget.

            I suppose I could have removed the snap firefox only.
            Regards, John Little

            Comment


              #8
              Originally posted by jlittle View Post
              Note that the PPA may give a beta release of Firefox. Presently one gets version 100.
              Also note that the PPA has firefox-esr - an "extended support release" of firefox.

              Please Read Me

              Comment


                #9
                My firefox just updated itself and it reverted to the snap version. I purged snap again reinstalled the ppa firefox and it's back fine.

                I went into about:config and changed the field app.update.auto to false. Is there anything else I need to do to stop the thing updating itself?

                Comment


                  #10
                  Interesting, @oshunluver. I noticed that you are running NEON. So am I. However, the first command in Step 2 failed.
                  It took forever to come back and gave me two options, continue or cancel. The first time I chose continue. No PPA was added. The second it again gave me the same msg so I canceled.
                  I went out to https://www.mozilla.org/en-US/firefo...t-desktop-beta and download the beta 100.0b9

                  EDIT:
                  Unfortunately, there is no way to import login names and passwords. The method that used to work, copying logins.json and key4.db from the old profile to the new one no longer works.
                  Last edited by GreyGeek; May 16, 2022, 02:49 PM.
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #11
                    I am still on 20.04 but will surely try to follow your instructions because for a snappy system Snap IS a PITA .

                    Comment


                      #12
                      I am still using 21.10, which is an excellent version and has given me no problems whatsoever. As for snaps, not for me (yet). When I upgrade to 22.04, I will probably delete both snapd and Firefox and use the appimage for Firefox. I am experimenting with it right now (version 100) and it is quite 'snappy', fast and easy to use. I also have Waterfox installed, which is almost identical to my Firefox, so I don't think I'll have a Snap withdrawal problem. I used an appimage before with Digikam, and it worked perfectly, so I can avoid the snap version as well. But I think Ubuntu should realize that they're going to lose a lot of users if they keep insisting on snapping everything. In any case, I perceive that Flatpack has more prefer3ence than Snap, although I haven't tried that so I don't know. I have tried quite a few appimages, and those work fine for me.

                      Comment


                        #13
                        Originally posted by GreyGeek View Post
                        Unfortunately, there is no way to import login names and passwords.
                        Maybe I don't follow, but one can:
                        1. In the source Firefox click the three bars menu, passwords, three dots menu (near the top right), export Logins, and write to a .csv file.
                        2. In the target Firefox first go to about:config, and go past the warning screen if you get one. Then enter
                          Code:
                          signon.management.page.fileImport.enabled
                          and toggle the setting to true.
                        3. three bars menu, passwords, three dots menu, Import from a File...

                        Or, if you're willing to have a Firefox account, and trust Mozilla with your passwords, set up Firefox Sync to sync your logins.
                        Regards, John Little

                        Comment


                          #14
                          I copy the whole profile folder across and set it using about: profiles. As long as the version's match ( i think it might be "as long as the profile isn't for a newer version but not sure"), it's not a problem and you get the passwords, logins, bookmarks and addons all ready.

                          Comment


                            #15
                            I've never really (that I remember) have had a problem leaving the .mozilla file in place to take over all settings for a new installation.

                            Comment

                            Working...
                            X