I realise this is probably a bad question but I'm stuck. After a lot of googling I'm struggling to fix the problem. I've been trying to get AppArmor to work on Debian. I've been following the instructions from https://wiki.debian.org/AppArmor/HowToUse.

Part of the instruction told me to do

sudo perl -pi -e 's,GRUB_CMDLINE_LINUX="(.*)"$,GRUB_CMDLINE_LINUX="$1 apparmor=1 security=apparmor",' /etc/default/grub
sudo update-grub
sudo reboot

Because I didn't understand the perl command I did this in my VM and now I can't use Firefox, not even in safemode. I get a segfault.

Fontconfig error: Cannot load default config file

(firefox:3875): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'
Crash Annotation GraphicsCriticalError: |[0][GFX1]: no fonts - init: 1 fonts: 0 loader: 0 (t=0.206719) [GFX1]: no fonts - init: 1 fonts: 0 loader: 0
[3875] ###!!! ABORT: unable to find a usable font (Sans): file /tmp/buildd/firefox-47.0.1/gfx/thebes/gfxTextRun.cpp, line 1875
[3875] ###!!! ABORT: unable to find a usable font (Sans): file /tmp/buildd/firefox-47.0.1/gfx/thebes/gfxTextRun.cpp, line 1875
Segmentation fault

apt-cache policy apparmor

  Installed: 2.9.0-3
  Candidate: 2.9.0-3
  Version table:
     2.10.95-4~bpo8+2 0
        100 http://ftp.uk.debian.org/debian/ jessie-backports/main amd64 Packages
 *** 2.9.0-3 0
        500 http://ftp.uk.debian.org/debian/ jessie/main amd64 Packages
        500 http://mirror.bytemark.co.uk/debian/ jessie/main amd64 Packages
        100 /var/lib/dpkg/status

ls -l on /etc/fonts/fonts.conf returns the following:

-rw-r--r-- 1 root root 5533 Nov 23 2014 /etc/fonts/fonts.conf

I tried exporting the font config path with the command

export FONTCONFIG_PATH=/etc/fonts

however this didn't help.

I know this is looking for a font that doesn't exist because I checked the path but now I'm at an impasse, out of ideas and can't find anymore help from Google.

  • I assume you are asking for the output? I've added it to the question. In future could you be more specific please? – Ben Jul 28 '16 at 16:29
  • 1
    export FONTCONFIG_PATH=/etc/fonts and then in the same terminal firefox – LinuxSecurityFreak Jul 28 '16 at 16:41
  • 1
    and please post ls -l /etc/fonts/fonts.conf – LinuxSecurityFreak Jul 28 '16 at 16:48
  • have you rebooted since the grub update? – LinuxSecurityFreak Jul 28 '16 at 16:49
  • to be more specific, of course, well, ok, export will give temporary instruction where to look for default fonts and ls -l will tell me if the config file even exists and what user rights it has – LinuxSecurityFreak Jul 28 '16 at 16:58

I have managed to solve the issue. The way I did this was by editing /etc/default/grub and changing GRUB_CMDLINE_LINUX from

GRUB_CMDLINE_LINUX=" apparmor=1 security=apparmor"



Then after running sudo update grub and sudo reboot the issue was fixed. However this stopped apparmor from working as it gave the error:

apparmor.common.AppArmorException: 'Warning: unable to find a suitable fs in /proc/mounts, is it mounted?\nUse --subdomainfs to override.\n'

However I managed to solve this by using the commands from the debian guide again.

sudo perl -pi -e 's,GRUB_CMDLINE_LINUX="(.*)"$,GRUB_CMDLINE_LINUX="$1 apparmor=1 security=apparmor",' /etc/default/grub
sudo update-grub
sudo reboot

After the reboot I tried to launch firefox and I didn't get any errors and it is all working fine now. However after trying it on my pc I started having the segfault issue again and this fix didn't work. but after comparing the apparmor profiles in /etc/apparmor.d I found that the profile rules were different.

Rules on segfaulting pc:

# Last Modified: Tue Aug  2 11:32:25 2016
#include <tunables/global>

/usr/lib/firefox/firefox {
  #include <abstractions/base>

  /usr/bin/firefox r,


Rules on working pc:

# Last Modified: Tue Aug  2 11:32:25 2016
#include <tunables/global>

/usr/bin/firefox {
  #include <abstractions/base>
  #include <abstractions/bash>

  /bin/dash ix,
  /usr/bin/firefox r,


I added #include <abstractions/bash> and /bin/dash ix, to the config file, then changed the path to /usr/bin/firefox and now the issue is fixed after rebooting.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.