Skip to content

Instantly share code, notes, and snippets.

@muammar
Created May 23, 2016 08:41
Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save muammar/a5ffb635eb7f532346a8e777b847f8a7 to your computer and use it in GitHub Desktop.
Save muammar/a5ffb635eb7f532346a8e777b847f8a7 to your computer and use it in GitHub Desktop.
Download and install Fira fonts in Linux or Mac OS X
#!/bin/bash
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
cd /tmp
# install unzip just in case the user doesn't already have it.
if [[ `uname` = Linux ]]; then
sudo apt-get install unzip -y
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip"
wget "http://www.carrois.com/downloads/fira_mono_3_2/FiraMonoFonts3206.zip"
unzip FiraSans4106.zip
unzip FiraMono3206.zip
sudo mkdir -p /usr/share/fonts/truetype/FiraSans
sudo mkdir -p /usr/share/fonts/opentype/FiraSans
sudo cp Fira*/WEB/*.ttf /usr/share/fonts/truetype/FiraSans/
sudo cp Fira*/OTF/Fira* /usr/share/fonts/opentype/FiraSans/
sudo fc-cache -fv
else
wget https://github.com/mozilla/Fira/archive/4.202.zip
unzip 4.202.zip
font_dir="$HOME/Library/Fonts"
mkdir -p $font_dir
cp Fira-4.202/otf/* $font_dir/
fi
@rajithsam
Copy link

@gravityrahul Try brew tap homebrew/cask-fonts

@dnnp2011
Copy link

Using brew cask, this would be:

brew tap caskroom/fonts
brew cask install \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

As of Dec 31, 2019 the new Fira Code font cask is:

brew tap homebrew/cask-fonts

@FDiskas
Copy link

FDiskas commented Mar 4, 2020

Not officially supported, might install outdated version

    brew tap caskroom/fonts
    brew cask install font-fira-code

@wfz0755
Copy link

wfz0755 commented Jan 16, 2021

Very useful script! Thank you so much!

@latavin243
Copy link

As of Jan 27, 2021 brew cask install is disabled, use brew install --cask instead.

brew tap homebrew/cask-fonts

brew install --cask \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

Copy link

ghost commented Feb 12, 2021

Works like a charm! Thanks.

@codepriezt
Copy link

nice one.. works fine

@renatomoor
Copy link

Thanks @latavin243

@jprg
Copy link

jprg commented Nov 21, 2021

Cask 'font-fira-mono-for-powerline' depends on brew install subversion done first.

@MunsMan
Copy link

MunsMan commented Feb 14, 2023

How do I install font-fira-code on Linux currently?

When I try the currently provided commands:

brew tap homebrew/cask-fonts

brew install --cask \
  font-fira-code \
  font-fira-mono \
  font-fira-mono-for-powerline \
  font-fira-sans

I receive the following error:

Error: Invalid `--cask` usage: Casks do not work on Linux

Any workaround on Linux?

On macOS, it worked like a charm for me.

@FDiskas
Copy link

FDiskas commented Feb 14, 2023

for linux :)

mkdir -p ~/.fonts/
wget https://github.com/tonsky/FiraCode/raw/master/FiraCode-Regular.otf -O ~/.fonts/FiraCode-Regular.otf
fc-cache -v

more info here https://github.com/tonsky/FiraCode/wiki/Linux-instructions#installing-with-a-package-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment