Fresh Install of Debian 13 Mate Is there a script for FF? [Solved]

Alexzee

Silver Member
Silver Supporter
Joined
Jun 1, 2019
Messages
5,103
Reaction score
3,091
Credits
32,664
Evening guys-:)

My fresh installation of Debian 13 went well and I'm well pleased!
Kudos to the Debian Team!

I was wondering if anyone knows of a script that has already been created to upgrade the FF ESR to the latest-firefox version?

As an example to explain what I'm looking for, when I want to upgrade FF ESR on my Slackware system to the most current FF, I run the script (latest-firefox.sh) that one of the Slackware contributors made. Once the script finishes it makes a pkg that I can install and that's the end of ESR.
 


Evening guys-:)

My fresh installation of Debian 13 went well and I'm well pleased!
Kudos to the Debian Team!

I was wondering if anyone knows of a script that has already been created to upgrade the FF ESR to the latest-firefox version?

As an example to explain what I'm looking for, when I want to upgrade FF ESR on my Slackware system to the most current FF, I run the script (latest-firefox.sh) that one of the Slackware contributors made. Once the script finishes it makes a pkg that I can install and that's the end of ESR.
I'm not familiar with an existing script to upgrade firefox-esr, but the following observations may be of interest. It's all using root.

The command that would upgrade a single package like firefox-esr in debian would be:
Code:
apt install --only-upgrade firefox-esr

To get the latest version available in the the debian system, the system needs to be updated with:
Code:
apt update

A simple script could consist of the following contents in a file named, for example, ffupdt:
Code:
#!/bin/bash
apt update
apt install --only-upgrade firefox-esr

The script could be placed in /usr/local/bin since it has to be run as root. Giving it executable permissions makes it easy to call:
Code:
chmod 755 /usr/local/bin/ffupdt

Note the total lack of sophistication in the script, no error correction, and the output of the script is quite chatty. On this machine, when run, it's output is as follows, informing the user that the firefox-esr package is already the latest version installed ... among all the other info:

Code:
[root]# ffupdt
Hit:1 http://ftp.au.debian.org/debian forky InRelease
Hit:2 http://ftp.au.debian.org/debian forky-updates InRelease                                     
Hit:3 http://security.debian.org/debian-security forky-security InRelease                          
Hit:4 https://repo.librewolf.net librewolf InRelease                                               
109 packages can be upgraded. Run 'apt list --upgradable' to see them.
firefox-esr is already the newest version (128.14.0esr-1).
The following packages were automatically installed and are no longer required:
  caca-utils  libchafa0t64        libgit-wrapper-perl     libsframe1         linux-headers-6.12.35+deb13-amd64   python3-tz
  chafa       libfile-chdir-perl  liborcus-0.18-0         libsoup-2.4-1      linux-headers-6.12.35+deb13-common  toilet
  jp2a        libgdata-common     liborcus-parser-0.18-0  libsoup2.4-common  linux-image-6.12.35+deb13-amd64     toilet-fonts
  libbluray2  libgdata22          libqt6core5compat6      libudfread0        linux-kbuild-6.12.35+deb13
Use 'apt autoremove' to remove them.
 
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 109

The script doesn't "make a package" as you describe for the slackware script, rather it just downloads and installs the latest version from the repo configured in the sources files, if the installed package is not the latest.

A more sophisticated script could involve error corrections, retry attempts if the first attempt running it fails, and more control of the output of the text on screen. You may be after something a bit fancier :)
 
Last edited:
Add the Mozilla Firefox repo. https://support.mozilla.org/en-US/That process is forkb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions


Then you can do apt update --upgrade and it will updated just like any other package.
firefox-esr:
Installed: (none)
Candidate: 140.2.0esr~build1
It's probably worth noting that there's a difference between firefox, which the link references from post #3, and firefox-esr, which the OP mentioned. Firefox is now up to version 142 whereas firefox-esr in trixie is still at 128, which may or may not be a consideration. The more up to date firefox is a reasonable option despite it not being part of the debian trixie stable release.
 
Last edited:
Add the Mozilla Firefox repo.
It's probably worth noting that there's a difference between firefox, which the link references from post #3, and firefox-esr, which the OP mentioned.
Pretty much that's what @Alexzee wants?

Dump ESR and install latest FF, this can be done only by using mozilla repo, here is my *.md script:

Markdown (GitHub flavored):
# Install Firefox

Procedure to install firefox

## Prerequisites

```bash
# First purge firefox-esr
sudo apt purge firefox-esr
sudo apt autopurge

# Ensure required programs
sudo apt update
sudo apt install wget gpg

# Install directory u=rwx, go=rx
sudo install -d -m 0755 /etc/apt/keyrings
```

## Procedure

```bash
# Download GPG key
cd ~/Downloads
wget -qO- https://packages.mozilla.org/apt/repo-signing-key.gpg > repo-signing-key.gpg

# Copy GPG key to APT key ring
sudo install -o root -g root -m 644 repo-signing-key.gpg /etc/apt/keyrings/packages.mozilla.org.asc

# Update APT sources
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" |\
sudo tee /etc/apt/sources.list.d/mozilla.list

# Delete downloaded key
rm repo-signing-key.gpg

# Configure APT to prioritize packages from the mozilla.org repository
echo '
# Never prefer packages from the mozilla.org repository
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1

# Prefer only firefox from mozilla.org
Package: firefox
Pin: origin packages.mozilla.org
Pin-Priority: 100
' | sudo tee /etc/apt/preferences.d/mozilla > /dev/null

# Download Firefox
sudo apt update
sudo apt install firefox
```

## Reference

The following sources have been useful to assemble this document:

- [Install Firefox on Linux](https://support.mozilla.org/en-US/kb/install-firefox-linux)
 
The Mozilla Firefox repo has esr, release, beta, and nightly versions of Firefox.
Code:
firefox-esr:
  Installed: (none)
  Candidate: 140.2.0esr~build1
  Version table:
     140.2.0esr~build1 1000
        500 https://packages.mozilla.org/apt mozilla/main arm64 Packages
     128.14.0esr-1 500
        500 https://deb.debian.org/debian unstable/main arm64 Packages
     128.14.0esr-1~deb13u1 990
        990 https://deb.debian.org/debian trixie/main arm64 Packages
        990 https://deb.debian.org/debian-security trixie-security/main arm64 Packages

firefox:
  Installed: 142.0.1~build1
  Candidate: 142.0.1~build1

firefox-beta:
  Installed: 143.0b9~build1
  Candidate: 143.0b9~build1

firefox-nightly:
  Installed: (none)
  Candidate: 144.0a1~20250910212829

I use a preference file so the Debian version doesn't get installed.
/etc/apt/preferences.d/preferences
Code:
Package: firefox
Pin: origin "packages.mozilla.org"
Pin-Priority: 1000

Package: firefox-esr
Pin: origin "packages.mozilla.org"
Pin-Priority: 1000

This is the modernized /etc/apt/sources.list.d/mozilla.sources
Code:
Types: deb
URIs: https://packages.mozilla.org/apt/
Suites: mozilla
Components: main
Architectures: arm64
Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc
 
Last edited:
That you all for answer my question as this is really important as I like to learn and write articles for the Linux Community.

@osprey your example is good thank you.
I am concerned with error correction and the like however, my focus is a script that I could write that will take the FF ESR that comes with a fresh installation of Debian and turn it into a perfect Debian (.deb) pkg that a user could install.

I don't know what the arguments and commands in the strings of the script should be. (I'm still learning)
What I do know is if this script that I could learn how to write (for Slackware or Debian) would, when finished, create a a pkg that gets dumped into the /tmp directory that the user can install to the system.

Is this not possible for Debian because the package management system is not designed like the package management system of Slackware?

Trying to understand this as a whole. I'd like to be able to maintain packages and contribute to the Debian and Slackware builds.
 
Pretty much that's what @Alexzee wants?

Dump ESR and install latest FF, this can be done only by using mozilla repo, here is my *.md script:

Markdown (GitHub flavored):
# Install Firefox

Procedure to install firefox

## Prerequisites

```bash
# First purge firefox-esr
sudo apt purge firefox-esr
sudo apt autopurge

# Ensure required programs
sudo apt update
sudo apt install wget gpg

# Install directory u=rwx, go=rx
sudo install -d -m 0755 /etc/apt/keyrings
```

## Procedure

```bash
# Download GPG key
cd ~/Downloads
wget -qO- https://packages.mozilla.org/apt/repo-signing-key.gpg > repo-signing-key.gpg

# Copy GPG key to APT key ring
sudo install -o root -g root -m 644 repo-signing-key.gpg /etc/apt/keyrings/packages.mozilla.org.asc

# Update APT sources
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" |\
sudo tee /etc/apt/sources.list.d/mozilla.list

# Delete downloaded key
rm repo-signing-key.gpg

# Configure APT to prioritize packages from the mozilla.org repository
echo '
# Never prefer packages from the mozilla.org repository
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1

# Prefer only firefox from mozilla.org
Package: firefox
Pin: origin packages.mozilla.org
Pin-Priority: 100
' | sudo tee /etc/apt/preferences.d/mozilla > /dev/null

# Download Firefox
sudo apt update
sudo apt install firefox
```

## Reference

The following sources have been useful to assemble this document:

- [Install Firefox on Linux](https://support.mozilla.org/en-US/kb/install-firefox-linux)
Your script is helpful thank you!

This is more of what I wanted, thank you. This script writing process is driving me crazy!
Why crazy you ask?
I haven't fully understood yet how to write scripts in python. And when I try to learn python it just creates more frustration.
Perhaps basic scripting is the key here that I need to get first before diving into python?
 
Last edited:
TBH, I like the way we do it in the Puppy community. We run as 'root' all the time, remember?

Why bother with scripts, when you can download the newest tarball from the Mozilla archives, untar it, then dive into the filesystem to wherever the 'firefox' directory lives & just swap 'em over directly? Much easier, IMHO.....but of course, I'm biased (and ROX does make all this kind of thing incredibly easy.....especially with drag'n'drop).

I know, I know; we're a strange bunch in Puppyland. We script stuff that many would do manually, and where most would script or use the terminal, we dive-in and do it by hand.... :D

Mustn't forget, though, that scripting has always been at the heart of what makes Slackware what it is. All credit to "Slackers" for some of their truly awesome ingenuity!

As @osprey has shown, scripting doesn't always need to be complex to get the job done. Sometimes, simple is just as good.....if not better. (Though there's nothing to stop you from adding more stuff in & making it as complex as you want!)


Mike. :)
 
Last edited:
The Mozilla Firefox repo has esr, release, beta, and nightly versions of Firefox.
Code:
firefox-esr:
  Installed: (none)
  Candidate: 140.2.0esr~build1
  Version table:
     140.2.0esr~build1 1000
        500 https://packages.mozilla.org/apt mozilla/main arm64 Packages
     128.14.0esr-1 500
        500 https://deb.debian.org/debian unstable/main arm64 Packages
     128.14.0esr-1~deb13u1 990
        990 https://deb.debian.org/debian trixie/main arm64 Packages
        990 https://deb.debian.org/debian-security trixie-security/main arm64 Packages

firefox:
  Installed: 142.0.1~build1
  Candidate: 142.0.1~build1

firefox-beta:
  Installed: 143.0b9~build1
  Candidate: 143.0b9~build1

firefox-nightly:
  Installed: (none)
  Candidate: 144.0a1~20250910212829

I use a preference file so the Debian version doesn't get installed.
/etc/apt/preferences.d/preferences
Code:
Package: firefox
Pin: origin "packages.mozilla.org"
Pin-Priority: 1000

Package: firefox-esr
Pin: origin "packages.mozilla.org"
Pin-Priority: 1000

This is the modernized /etc/apt/sources.list.d/mozilla.sources
Code:
Types: deb
URIs: https://packages.mozilla.org/apt/
Suites: mozilla
Components: main
Architectures: arm64
Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc
Creating the preference file makes sense. Will that file be modified when apt runs again to update or upgrade the system?

Your version of the /etc/apt/sources.list.d/mozilla.sources is understood.

Where the string that says "Architectures: arm64" could other architectures be added in the sources list or in a script?

Did you add all of the text above to your sources list?
Or> is this a completely different src's list?
 
I like the way we do it in the Puppy community. We run as 'root' all the time, remember?

Why bother with scripts, when you can download the newest tarball from the Mozilla archives, untar it, then dive into the filesystem to wherever the 'firefox' directory lives & just swap 'em over directly? Much easier, IMHO.....but of course, I'm biased (and ROX does make all this kind of thing incredibly easy.....especially with drag'n'drop).

I know, I know; we're a strange bunch in Puppyland. We script stuff that many would do manually, and where most would script or use the terminal, we dive-in and do it by hand.... :D

Mustn't forget, though, that scripting has always been at the heart of what makes Slackware what it is. All credit to "Slackers" for some of their truly awesome ingenuity!

As @osprey has shown, scripting doesn't always need to be complex to get the job done. Sometimes, simple is just as good.....if not better.


Mike. :)
I get it and understand where you are coming from bro.

What drives me nuts is that I can't ( at least it appears this way) that there aren't any variables, arrarys, values, integers, booleans, and strings that I can compose in a script to produce a .deb package that can be installed.
Package maintainers have done this for years so is this a restriction or am I just uneducated?

I can appreciate the Puppy Community doing things by hand.
This is the way my Linux teacher taught me how to do things.
 
Creating the preference file makes sense. Will that file be modified when apt runs again to update or upgrade the system?

Your version of the /etc/apt/sources.list.d/mozilla.sources is understood.

Where the string that says "Architectures: arm64" could other architectures be added in the sources list or in a script?

Did you add all of the text above to your sources list?
Or> is this a completely different src's list?
My system is arm64 hence the arm64 in the sources. If you use extrepo it will add the correct Architecture.
Or just use amd64 in place of arm64.

The preference file only gets modified manually.
This is my /etc/apt/sources.list.d/

Screenshot_2025-09-11_18-08-13.png
 
Alex, I may have a really sweet solution for you that checks all the boxes.

All I need is your DE on Trixie and I can tie it all together.

EDIT- Got it, in title - MATE - should have gone to SpecSavers.

I have to go out for an hour but will get to it when I get back.

Cheers

Wiz
 
Last edited:
Alex, I may have a really sweet solution for you that checks all the boxes.

All I need is your DE on Trixie and I can tie it all together.

EDIT- Got it, in title - MATE - should have gone to SpecSavers.

I have to go out for an hour but will get to it when I get back.

Cheers

Wiz
Yup the Mate DE is what I'm running. Thanks!
 

Attachments

  • DE.png
    DE.png
    28.5 KB · Views: 172
I get it and understand where you are coming from bro.

What drives me nuts is that I can't ( at least it appears this way) that there aren't any variables, arrarys, values, integers, booleans, and strings that I can compose in a script to produce a .deb package that can be installed.
Package maintainers have done this for years so is this a restriction or am I just uneducated?

I can appreciate the Puppy Community doing things by hand.
This is the way my Linux teacher taught me how to do things.
There seems to be a few issues raised. The following is how I see it.

@Alexzee wrote
my focus is a script that I could write that will take the FF ESR that comes with a fresh installation of Debian and turn it into a perfect Debian (.deb) pkg that a user could install.

The "fresh" installation of debian I take to be trixie. In that case you can find the .deb file in the output of the following command:
Code:
$ apt-get download --print-uris firefox-esr | awk -F"'" '{print $2}'
http://ftp.au.debian.org/debian/pool/main/f/firefox-esr/firefox-esr_128.14.0esr-1_amd64.deb
Note that the output is from the repo that is used in the sources list on this machine, thus, the repo from which the output derives will depend on your sources.

Once the full pathname to the .deb file is known it can be downloaded with wget or curl, and then installed with apt. It is apt that will bring in dependencies if any, so apt is better than dpkg.

HOWEVER, note that this is not the normal means of installation in debian. It's inefficient "double dealing" to download the .deb file and then install it when apt can install it with a single command:
apt install <pkg>.

Is this not possible for Debian because the package management system is not designed like the package management system of Slackware?

It's possible to install in this "double dealing" way, but inefficient and not really done in debian for packages that exist in the repository. It's a different matter for external packages not in debian repos which apt cannot access through sources lists. In that case, one can work with the downloaded non-official-debian .deb file.

Another major point to note I think is this: if one is using stable trixie, the firefox-esr installation won't change unless there's a security update or a bug fix. That's the way with stable releases. That means that "updating to the latest firefox-esr" may not get the latest firefox-esr that is available from the mozilla repos. If, by chance you want to get a later, or the latest firefox-esr, then the recommended way from mozilla for debian is to use their repos which @craigevil linked to, and configure the repos on your machine as outlined in the link in post #3 for trixie.

I can appreciate the Puppy Community doing things by hand.
This is the way my Linux teacher taught me how to do things.

Personally, I no longer bother with firefox-esr because the latest firefox browser is superior software in many respects which can be researched in the changelogs and the release notes.

Since you mentioned doing things "by hand", if, by chance you wish to install the latest firefox by hand, that can be done by downloading the latest firefox tarball (not the .deb file), installing it in the /home/$USER directory somewhere and running it. It will not conflict with an existing firefox-esr, rather it creates it's own configs in the /home directory under /home/$USER/.mozilla. If you are interested in this manual option just ask and I can provide the means of doing it in great detail :-)
 
Last edited:
First up, let me say that I seldom differ with @osprey , I know better - he is so skilled in many more ways than i am :)

That being said, I have some advantages in running 75 distros, and on #4

Firefox is now up to version 142 whereas firefox-esr in trixie is still at 128, which may or may not be a consideration.

...I'll just add that

FF-ESR was catapulted from v 128 to 140 middle of August, last, as described here

https://www.firefox.com/en-US/firefox/140.2.0/releasenotes/

,,,but that was only if you are on their release channel.

Trixie shipped with FF-ESR 128.13, and that in turn, can now be upgraded to 128.14.

It;s taken me a bit longer to prepare this material than I anticipated, so I will be providing it for consideration on my tomorrow, but I should also add that the article from Mozilla


produces some errors for me, and also has deficiencies, I will outline them on my tomorrow.

Cheers

Wiz
 
Thanks wiz for your kind comments. Much appreciated. However, it hasn't been all roses here. One unforgettable occurred when writing a script to create a Trash folder ended with an unexpected result.

I wrote a function which was placed in /home/$USER/.bashrc:
rem() { mv "$1" ~/.local/share/Trash/$1.$(date +%Y%m%d-%H.%S); }.
The command rem file removed "file" to the Trash directory and added a date to its filename as a suffix. It's very basic. It moved one file at a time. I thought I'd see how it responded if I wanted to move all the files in my home directory thus: rem *. I quickly and inattentively mistyped: rm *. It took a moment to register, but then it became clear: a whole bunch of files in /home/$USER directory was gone. Last back-up had been a month before. Not a good time :-(.
 
Last edited:
There seems to be a few issues raised. The following is how I see it.

@Alexzee wrote


The "fresh" installation of debian I take to be trixie. In that case you can find the .deb file in the output of the following command:
Code:
$ apt-get download --print-uris firefox-esr | awk -F"'" '{print $2}'
http://ftp.au.debian.org/debian/pool/main/f/firefox-esr/firefox-esr_128.14.0esr-1_amd64.deb
Note that the output is from the repo that is used in the sources list on this machine, thus, the repo from which the output derives will depend on your sources.

Once the full pathname to the .deb file is known it can be downloaded with wget or curl, and then installed with apt. It is apt that will bring in dependencies if any, so apt is better than dpkg.

HOWEVER, note that this is not the normal means of installation in debian. It's inefficient "double dealing" to download the .deb file and then install it when apt can install it with a single command:
apt install <pkg>.



It's possible to install in this "double dealing" way, but inefficient and not really done in debian for packages that exist in the repository. It's a different matter for external packages not in debian repos which apt cannot access through sources lists. In that case, one can work with the downloaded non-official-debian .deb file.

Another major point to note I think is this: if one is using stable trixie, the firefox-esr installation won't change unless there's a security update or a bug fix. That's the way with stable releases. That means that "updating to the latest firefox-esr" may not get the latest firefox-esr that is available from the mozilla repos. If, by chance you want to get a later, or the latest firefox-esr, then the recommended way from mozilla for debian is to use their repos which @craigevil linked to, and configure the repos on your machine as outlined in the link in post #3 for trixie.



Personally, I no longer bother with firefox-esr because the latest firefox browser is superior software in many respects which can be researched in the changelogs and the release notes.

Since you mentioned doing things "by hand", if, by chance you wish to install the latest firefox by hand, that can be done by downloading the latest firefox tarball (not the .deb file), installing it in the /home/$USER directory somewhere and running it. It will not conflict with an existing firefox-esr, rather it creates it's own configs in the /home directory under /home/$USER/.mozilla. If you are interested in this manual option just ask and I can provide the means of doing it in great detail :-)
First of all I'd like to say that your help is exemplary!

Yeah, I understand that 'double dealing' is not the preferred method of installing pkgs on a Debian system.
If APT can't find it, it doesn't exist and honestly isn't worth having. IMO

After reading what you wrote I see that I can handle this 2 ways.
One by following @craigevil's instructions <or> I can go download the highest version of FF from Mozilla, create my own custom desktop entry file and configure it to my panel.

From this point on the ESR versions that come with Debian installations will be removed quickly.

As you have mentioned above, I agree, the software in the latest firefox and the benefits and attributes are superior.
A well learned lesson that I will not repeat again by bothering with the ESR version.:)
 
As you have mentioned above, I agree, the software in the latest firefox and the benefits and attributes are superior.
A well learned lesson that I will not repeat again by bothering with the ESR version.:)
Btw. there was a link from mozilla I've read that I sadly forgot to save, they explain how ESR is inferior not just in functionality but also from security perspective, they recommend non-ESR FF.
 


Follow Linux.org

Members online


Top