Git Product home page Git Product logo

vanilla's Introduction

About

This script can be used to install and keep updated the official linux builds of Firefox and Thunderbird. Regular releases, betas and ESR (Firefox only) are supported.

As of time of writing, the builds require glibc 2.17. It means for example Ubuntu 14.04 is the oldest supported Ubuntu and Debian 8 is the oldest supported Debian. With that limitation in mind the script requires at least bash 4.3

Installation

The only required step is creating the base dir.

Some commands rely on external tools which are not always available by default. Here is the complete list with package names for Ubuntu:

  • curl (from curl)
  • gpg (from gnupg)
  • column (from bsdmainutils)
  • bzip2 (from bzip2) or lbzip2 (from lbzip2)

With lbzip2 installed you can significantly speed up decompression of downloaded packages.

You can use the desktop command to generate sample desktop files.

You might also want to symlink the installed binaries under some dir from $PATH like ~/.local/bin, /usr/local/bin or even /usr/bin. For example:

/usr/local/bin/firefox-esr => /opt/mozilla/firefox-esr/firefox
/usr/local/bin/thunderbird => /opt/mozilla/thunderbird/thunderbird

Firejail notes

Put the symlinks into /usr/bin and symlink those to the Firejail binary under /usr/local/bin. For example:

/usr/bin/firefox-esr => /opt/mozilla/firefox-esr/firefox
/usr/bin/thunderbird => /opt/mozilla/thunderbird/thunderbird

/usr/local/bin/firefox-esr => /usr/bin/firejail
/usr/local/bin/thunderbird => /usr/bin/firejail

Firejail has stock profiles for the binaries with -beta and -esr suffixes, so it works out of the box that way.

Currently (as of 0.9.66) the thunderbird-beta profile declares private-opt thunderbird-beta. So by default it would not work with installations anywhere under /opt but /opt/thunderbird-beta. To make it work with installations somewhere else under /opt, use such override:

# /etc/firejail/thunderbird-beta.local

ignore private-opt

Usage

Install or upgrade

vanilla install [--lang <lang>] [--base <dir>] <package>

Step by step install

vanilla download [--lang <lang>] [--base <dir>] <package>
vanilla extract [--base <dir>] <file>
vanilla select [--base <dir>] [--fzf|--no-fzf] <package>

Uninstall

vanilla delete [--base <dir>] [--fzf|--no-fzf] <package>
vanilla prune [--base <dir>] [-n <num>] [--dry-run] <package>

Utils

vanilla list [package]
vanilla langs <package>
vanilla desktop [--base <dir>] [--no-path] [--no-icon-path] <package>

Packages

  • firefox
  • firefox-beta
  • firefox-esr
  • thunderbird
  • thunderbird-beta

Base dir

The script installs packages into the base dir, by default /opt/mozilla. With -b <dir> / --base <dir> you can set a custom base dir.

The script doesnt create the base dir, you should create it yourself.

With some packages installed, the base dir layout looks like this:

firefox -> firefox-91.0
firefox-78.12.0esr
firefox-90.0.1
firefox-90.0.2
firefox-91.0
firefox-91.0esr
firefox-esr -> firefox-91.0esr
thunderbird-91.0b6
thunderbird-beta -> thunderbird-91.0b6

As you see there are multiple versions of some packages and some of those are targeted by non-versioned symlinks. You can interactively retarget the symlinks with the select command.

The script doesnt remove anything from the base dir if not asked for. You might want to uninstall outdated versions from time to time with the delete or prune commands.

Languages

Mozilla provides packages in many languages. By default the script uses en-US one. You can set a custom lang with -l <lang> / --lang <lang>. Use the langs command to list available languages for a package.

FZF picker

By default the interactive picker uses fzf if available and version 0.20 at least. You can force it off with --no-fzf.

In case fzf is older than 0.20, the picker doesnt use fzf by default but you can force it to with --fzf. The code wasnt tested with older versions though.

Env vars

Some settings can be set with env vars instead of options. As usually, options override the corresponding vars if both are set.

VANILLA_BASE
Same as -b / --base
VANILLA_LANG
Same as -l / --lang
VANILLA_FZF
y for --fzf, n for --no-fzf. Other values are ignored.

Config files

Alternative to env vars, you can set the vars in /etc/vanillarc or ~/.config/vanillarc (applies last).

Commands

If run without any args, the script just prints the usage text.

install

Install or try to upgrade a package and refresh its symlink in the base dir. Internally this command is a combo of download, extract and non-interactive select.

Example: vanilla install firefox

download

Download the latest version of a package into the current dir if only an update is available and verify the signature.

Example: vanilla download firefox

extract

Extract a previously downloaded archive into the base dir.

Example: vanilla extract firefox-91.0.tar.bz2

select

Interactively select the version for a package’s symlink in the base dir.

Example: vanilla select firefox

delete

Interactively select and delete a version of a package from the base dir and adjust the package’s symlink if needed.

Example: vanilla delete firefox

prune

Delete old versions of a package from the base dir. By default only 2 most recent versions are kept including the symlinked one. Use -n option to override the default.

Use --dry-run flag to only print what is to be deleted.

You cant delete the only installed version with prune, use delete for that.

Example: vanilla prune firefox

list

List installed versions for a package or all packages.

Example: vanilla list

langs

List available languages for the latest version of a package.

Example: vanilla langs firefox

desktop

Generate a desktop file for the package. By default the Exec and Icon properties contain full pathes. With --no-path / --no-icon-path it would be just a package name like firefox or firefox-esr.

Example: vanilla desktop firefox

FAQ

Why not just use Mozilla stuff bundled with distro X?
There are outdated systems like Ubuntu 14.04 which are still used and recieve some kind of support (Ubuntu ESM) but the updates no longer cover Firefox and Thunderbird.
But there are snaps, flatpaks
One more option to chose from. Besides one might want to run Firefox under Firejail which does not play along with those sandboxing solutions.
Why not use built-in upgrades
I dont like the idea of self modifying software especially in case of a browser.
Why there is no thunderbird-esr package
Thunderbird ESR is discontinued since 2014. Thunderbird tracks Firefox ESR schedule instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.