238

The system crash dialog is annoying me, how can I turn it off? I'd also like to know how to turn it back on just in case I need it to report a problem.

Jorge Castro
  • 71,754
jokerdino
  • 41,320
  • 4
    since this seems to effect numerous people, is it a bug with apport itself? – Thufir Nov 15 '14 at 00:04
  • 1
    Not sure but I also think the crash dump may contain full text files for ex. so if you have sensitive data on it, better keep it disabled. I think, every time a crash happens and that pops up, we should be clearly informed that a crash dump of like 200MB will be uploaded and it will contain data you were editing on the application. I finally found something that I dislike on ubuntu :(, never thought this day would come... – Aquarius Power Mar 22 '15 at 23:45
  • Please follow the instructions from the official Apport article in the Ubuntu wiki. – der_michael Oct 14 '16 at 05:57

8 Answers8

270

As of Ubuntu 16.04 systemd apport does not seem to honor its config file

The systemd commands to enable / disable apport are:

Disable

sudo systemctl disable apport.service

If that does not work, you would then need to mask the service

systemctl mask apport.service

To reenable

systemctl unmask apport.service # if you masked it
sudo systemctl enable apport.service

Previous versions of Ubuntu:

You need to edit /etc/default/apport. The following changes will prevent Apport from starting at boot:


Graphical: Open a terminal with (CTRL+ALT+T) and type this:

sudo -i gedit /etc/default/apport

and then push ENTER. You password is being typed, but will not display as dots.

or

Command line:

sudo nano /etc/default/apport

A file editor is now open. Change enabled from "0" to a "1" so it looks like this:

enabled=1    

To turn it off make it:

enabled=0

Now save your changes and close the file editor. Apport will now no longer start at boot. If you want to turn it off immediately without rebooting, run sudo service apport stop.

You can also use sudo service apport stop without modifying /etc/default/apport to turn it off temporarily.

See also:

Zanna
  • 70,465
Panther
  • 102,067
41

On Unity: 17.04 and below:

  1. Click on Ubuntu icon, search for "System settings"

  2. Select Privacy > Diagnostics tab

  3. Unlock

  4. Tick "Send error reports to Canonical"

    Ubuntu 12.04 > Privacy > Diagnostics tab > Send error reports to Canonical

    On GNOME: 17.10+

    GNOME > Problem reporting screenshot

Pablo Bianchi
  • 15,657
34
sudo service apport stop ; sudo sed -ibak -e s/^enabled\=1$/enabled\=0/ /etc/default/apport ; sudo mv /etc/default/apportbak ~

The above script should stop apport, then take a backup of its configuration file, disable apport on boot, and lastly moves the backup to your home directory.

Seth
  • 58,122
Anonymous
  • 341
  • 1
    Thanks! Out of all three of the answers, only this one worked for my friend when we overwrote Ubuntu onto his Chromebook! – Pip Sep 06 '14 at 23:52
14

On newer versions of ubuntu (15.04+)

To stop the service:

systemctl stop apport.service

To disable the service at startup:

sudo systemctl disable apport.service

To check the status of the service:

systemctl status apport.service

Finally, you can also prevent the startup of a systemd service by masking it. The service will not be able to start (even manually) unless unmasked.

systemctl mask apport.service

This should create symlink from /etc/systemd/system/apport.service to /dev/null. fedoraproject.org

mchid
  • 43,546
  • 8
  • 97
  • 150
3

Don't disable apport. One of these days, you might have a sequence of crashes and never know it except for system bad behavior or some application-specific symptom.

The /var/crash directory is there to record any mishap. You might need it some day.

Suggested procedure:

  • Create a new folder E.g. $HOME/crash and copy all of the existing crash reports to it.
  • sudo rm /var/crash/*
  • sudo reboot

The repetitive crash pop-up behavior should now be gone. Also, the crash reports that you saved might be valuable in reporting a bug to launchpad.

Nephente
  • 5,595
  • 1
  • 17
  • 23
Richard Elkins
  • 474
  • 4
  • 7
3

Since there's a bug in apport that breaks standard unix command line debugging, and this bug has been known since 2007 (I'm going to buy it a cake when it turns 10) (see https://bugs.launchpad.net/ubuntu/+source/apport/+bug/160999) turning it off is far and away the best thing to do if you are trying to fix your own code.

2

Why not just remove it entirely?

Version 16.04 LTS

sudo apt-get update
sudo apt-get remove apport
sudo rm /etc/cron.daily/apport

Also, might want to check this out:

Removing popularity-contest without trashing the system?

New to 18.04:

How to Opt Out of System Information Reports

SDsolar
  • 3,169
0

I found that I still wanted to disable Apport's crash handling in Python3. I had both tried disabling apport via cmdline (sudo systemctl disable apport.service), GUI (see this hopefully-original blog post), and via removal (sudo apt purge); however, Python backtraces showed apport still being present.

It seems like python3-apport is a prereq of ubuntu-desktop (relates launchpad bug 1773087), so may be hard to remove it.

I then looked at the Apport#Crash_interception, and seems like we can hack /etc/python*/sitecustomize.py.

As an example, the following worked (disabled apport) on my system for python3.6:

# N.B. Authenticate sudo first!
cat | sudo tee /etc/python3.6/sitecustomize.py <<EOF
## install the apport exception handler if available
#try:
#    import apport_python_hook
#except ImportError:
#    pass
#else:
#    apport_python_hook.install()
EOF

EDIT: Didn't try doing stuff like isolated mode in python3 - dunno if that'd work with Ubuntu-baked site customizations.