Reinstalar fontes truetype padrão (Ubuntu 16.04)

3

Eu acidentalmente (imprudentemente) rm -rf my /usr/share/fonts/truetype directory. Todas as minhas fontes verdadeiras desapareceram agora. : / Existe alguma maneira de recuperá-los? Estou no Ubuntu 16.04.

    
por Glenn Mohammad 02.08.2017 / 16:44

2 respostas

3

Gerei uma lista dos pacotes que possuem cada diretório em MY /usr/share/fonts/truetype . (Eu não limpei minhas fontes). Reinstalar (com sudo apt-get install --reinstall <package> <...> :

w3@aardvark:~(0)$ for i in /usr/share/fonts/truetype/* ; do
> dpkg -S $i
> done
fonts-sil-abyssinica: /usr/share/fonts/truetype/abyssinica
fonts-ancient-scripts, fonts-symbola: /usr/share/fonts/truetype/ancient-scripts
fonts-gfs-artemisia: /usr/share/fonts/truetype/artemisia
fonts-gfs-baskerville: /usr/share/fonts/truetype/baskerville
fonts-gfs-bodoni-classic: /usr/share/fonts/truetype/bodoni-classic
fonts-dejavu-extra, fonts-dejavu-core: /usr/share/fonts/truetype/dejavu
fonts-gfs-didot: /usr/share/fonts/truetype/didot
fonts-gfs-didot-classic: /usr/share/fonts/truetype/didot-classic
fonts-droid: /usr/share/fonts/truetype/droid
fonts-font-awesome: /usr/share/fonts/truetype/font-awesome
fonts-guru-extra: /usr/share/fonts/truetype/fonts-guru-extra
dpkg-query: no path found matching pattern /usr/share/fonts/truetype/fonts-japanese-gothic.ttf
fonts-freefont-ttf: /usr/share/fonts/truetype/freefont
fonts-gfs-gazis: /usr/share/fonts/truetype/gazis
fonts-sil-gentium: /usr/share/fonts/truetype/gentium
fonts-sil-gentium-basic: /usr/share/fonts/truetype/gentium-basic
fonts-horai-umefont: /usr/share/fonts/truetype/horai-umefont
fonts-kacst: /usr/share/fonts/truetype/kacst
fonts-kacst-one: /usr/share/fonts/truetype/kacst-one
fonts-lao: /usr/share/fonts/truetype/lao
fonts-lato: /usr/share/fonts/truetype/lato
fonts-liberation: /usr/share/fonts/truetype/liberation
fonts-lohit-guru: /usr/share/fonts/truetype/lohit-punjabi
fonts-lyx: /usr/share/fonts/truetype/lyx
dpkg-query: no path found matching pattern /usr/share/fonts/truetype/msttcorefonts
fonts-nanum: /usr/share/fonts/truetype/nanum
fonts-gfs-neohellenic: /usr/share/fonts/truetype/neohellenic
fonts-gfs-olga: /usr/share/fonts/truetype/olga
fonts-opendin: /usr/share/fonts/truetype/opendin
fonts-opensymbol: /usr/share/fonts/truetype/openoffice
fonts-sil-padauk: /usr/share/fonts/truetype/padauk
fonts-gfs-porson: /usr/share/fonts/truetype/porson
fonts-lklug-sinhala: /usr/share/fonts/truetype/sinhala
fonts-gfs-solomos: /usr/share/fonts/truetype/solomos
fonts-takao-pgothic: /usr/share/fonts/truetype/takao-gothic
fonts-gfs-theokritos: /usr/share/fonts/truetype/theokritos
fonts-tibetan-machine: /usr/share/fonts/truetype/tibetan-machine
fonts-tlwg-waree-ttf, fonts-tlwg-umpush-ttf, fonts-tlwg-typo-ttf, fonts-tlwg-typist-ttf, fonts-tlwg-typewriter-ttf, fonts-tlwg-sawasdee-ttf, fonts-tlwg-purisa-ttf, fonts-tlwg-norasi-ttf, fonts-tlwg-mono-ttf, fonts-tlwg-loma-ttf, fonts-tlwg-laksaman-ttf, fonts-tlwg-kinnari-ttf, fonts-tlwg-garuda-ttf: /usr/share/fonts/truetype/tlwg
ttf-bitstream-vera: /usr/share/fonts/truetype/ttf-bitstream-vera
ttf-dejavu-extra, ttf-dejavu-core: /usr/share/fonts/truetype/ttf-dejavu
ttf-indic-fonts-core: /usr/share/fonts/truetype/ttf-indic-fonts-core
ttf-marvosym: /usr/share/fonts/truetype/ttf-marvosym
ttf-xfree86-nonfree: /usr/share/fonts/truetype/ttf-xfree86-nonfree
ttf-ubuntu-font-family: /usr/share/fonts/truetype/ubuntu-font-family
fonts-unfonts-core: /usr/share/fonts/truetype/unfonts-core
ttf-unifont: /usr/share/fonts/truetype/unifont
fonts-wqy-microhei: /usr/share/fonts/truetype/wqy
w3@aardvark:~(0)$ 
    
por waltinator 02.08.2017 / 16:56
8

Apenas passou por isso com outro usuário para um diretório diferente. Você pode ver quais pacotes tinham arquivos em um diretório. No meu caso:

$ dpkg -S /usr/share/fonts/truetype | cut -sd: -f1 | tr -d , | fold -w80
fonts-opensymbol ttf-mscorefonts-installer ttf-ubuntu-font-family fonts-symbola 
fonts-liberation fonts-freefont-ttf fonts-droid-fallback fonts-dejavu-core

Podemos polir isso em um único comando que apenas reinstala todos esses pacotes:

sudo apt install --reinstall $(dpkg -S /usr/share/fonts/truetype | cut -sd: -f1 | tr -d ,)

O benefício aqui é que você está reinstalando os arquivos com base em seus pacotes.

    
por Oli 02.08.2017 / 17:16