Skip to content

Instantly share code, notes, and snippets.

Last active May 22, 2023 12:38
  • Star 71 You must be signed in to star a gist
  • Fork 24 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
# Written by: Keefer Rourke <>
# Based on AUR package <>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git
mkdir $srcdir
cd $srcdir
echo "Cloning Git repository..."
git clone $giturl
echo "Installing fonts..."
sudo mkdir -p $pkgdir
sudo find $srcdir -type f -name "*.ttf" -exec install -Dm644 {} $pkgdir \;
echo "Cleaning up..."
sudo find $pkgdir -type f -name "Cantarell-*.ttf" -delete \;
sudo find $pkgdir -type f -name "Ubuntu-*.ttf" -delete \;
# provides roboto
sudo apt-get --purge remove fonts-roboto
echo "Updating font-cache..."
sudo fc-cache -f > /dev/null
echo "Done!"
Copy link

@skylerwebdev hey, this is just a gist — I've updated the script to remove the commas, but really — it's 4 years old and probably no longer up to date. Don't use this.

Copy link

@keeferrourke I will be steailing this gist and giving you props it still works 100% and is the only gist out there that does so! I actually went thru to the git link u have posted to googlefonts and last update was 3 days ago GREAT JOB

Copy link

ctjlewis commented Sep 7, 2020

This still works really well! The Google Fonts repo seems to be maintained @ and this still seems safe to use. Even on 20.04 fonts-cantarell and fonts-roboto are still available in universe repos. Thank you for publishing this!

If anyone wants a GUI, they can check out typecatcher:

sudo apt-get install -y typecatcher

Copy link

make the script executable, then ....


still working fine 11/05/2020

Copy link

Glad to know it still works 🎉

Copy link

mhmyu commented Jun 20, 2021

make the script executable, then ....


still working fine 11/05/2020

still working for me 06/20/2021 on ubuntu 20 04
download ZIP file > unZIP > right click > Properties > Permission > select execute : allow executing file as program > close properties > open terminal and run ./

Copy link

ctjlewis commented Aug 4, 2021

@keeferrourke, could I make a suggestion to change line 15 to git clone $giturl --depth 1 so that unnecessary git history is not cloned? Makes for a much faster install.

Copy link

Still working like a charm!

Copy link

i've create an installer for individual fonts, and for more systems, than just debian:

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