Skip to content

Instantly share code, notes, and snippets.

@lightonphiri
Last active May 10, 2026 22:56
Show Gist options
  • Select an option

  • Save lightonphiri/5811226a1fba0b3df3be73ff2d5b351c to your computer and use it in GitHub Desktop.

Select an option

Save lightonphiri/5811226a1fba0b3df3be73ff2d5b351c to your computer and use it in GitHub Desktop.
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
sudo chmod -R --reference=/usr/share/fonts/opentype /usr/share/fonts/googlefonts

Register fonts

sudo fc-cache -fv

Check if font installed

fc-match OpenSans

Bibliography

http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux
http://ubuntuhandbook.org/index.php/2016/05/manually-install-fonts-ubuntu-16-04

@monners

monners commented Dec 13, 2017

Copy link
Copy Markdown

Thanks!
you might wanna update your gist to point to the download url, rather than the reference page, and specify the name of the file you expect, otherwise you'll get query string junk (for open sans that'd be: wget -O Open_Sans.zip https://fonts.google.com/download?family=Open%20Sans)

@andersonid

Copy link
Copy Markdown

great... thanks

@SushiStar

Copy link
Copy Markdown

Really helpful

@speeddragon

Copy link
Copy Markdown

Very useful!

@amoghkalyanshetti

Copy link
Copy Markdown

Thank you very much !

@tarjei

tarjei commented Jul 31, 2018

Copy link
Copy Markdown

Thanks for this!
The install part is better written as:

cd /usr/share/fonts 
sudo mkdir googlefonts
sudo unzip -d . ~/Downloads/fonts.zip 
sudo chmod -R --reference=opentype googlefonts

@tarjei

tarjei commented Jul 31, 2018

Copy link
Copy Markdown

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04):
sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

@lightonphiri

Copy link
Copy Markdown
Author

Thanks for this!
The install part is better written as:

cd /usr/share/fonts 
sudo mkdir googlefonts
sudo unzip -d . ~/Downloads/fonts.zip 
sudo chmod -R --reference=opentype googlefonts

Thanks. Reformatted gist [...]

@adityatelange

Copy link
Copy Markdown

if you want google_product_sans =>

https://forum.xda-developers.com/attachment.php?attachmentid=4324851&d=1509979469 and copy
Font_ProductSans2/system/fonts/ to /usr/share/fonts/googlefonts

@bhachauk

bhachauk commented Jun 8, 2019

Copy link
Copy Markdown

I have used typecatcher. i think, worth to mention here.

@dhirajpatra

Copy link
Copy Markdown

Very nice thanks

@morehwachege

Copy link
Copy Markdown

This is fantastic...works on various debian based linux distros swiftly, thank you

@davidajimati

Copy link
Copy Markdown

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

this is awesome, it helped me. thanks

@unalignedcoder

Copy link
Copy Markdown

Could I not install new fonts in the user Home folder?

@lcongdanh

Copy link
Copy Markdown

for anyone using WSL2:
sudo unzip -d . /mnt/c/Users/admin/Downloads/Cantarell.zip

@patrickhag

patrickhag commented Sep 18, 2023

Copy link
Copy Markdown

Thanks man!!!

@githubdotcomuser

Copy link
Copy Markdown

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

Hey! How do you figure out which of the fonts can be installed this way. I wanted to install the Inter Tight but sudo apt install fonts-inter-tight doesn't seem to work.

@lusdavo

lusdavo commented Dec 31, 2023

Copy link
Copy Markdown

Thanks.

@viotti

viotti commented Mar 31, 2024

Copy link
Copy Markdown

You can also install some of the fonts as packages on newer ubuntu (I'm on 18.04): sudo apt install fonts-lato fonts-open-sans fonts-roboto fonts-mononoki

Hey! How do you figure out which of the fonts can be installed this way. I wanted to install the Inter Tight but sudo apt install fonts-inter-tight doesn't seem to work.

You can search the Debian Packages: https://www.debian.org/distrib/packages. For example, here is the search results for "fonts-inter": https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=fonts-inter. Usually, when you find a Debian package there will be an Ubuntu equivalent.

You can also search with the apt command itself.

$ apt-cache search fonts-inter
fonts-inter - Inter font family
fonts-inter-variable - Inter font family (VF)

@4yman-0

4yman-0 commented Jul 5, 2024

Copy link
Copy Markdown

Thanks!

@lusdavo

lusdavo commented Sep 5, 2024

Copy link
Copy Markdown

This works all the time, thanks a lot.

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