Remove Asterisk from Linux server (ubuntu/centos/debian/rhel)

Remove Asterisk

The following removal instructions go over how to completely remove Asterisk from your Linux Instance.


Here is how to remove Asterisk from a Linux server and reinstall from source.
Pre-requirements: Download source, configure, make menuselect, and make. All done with root (sudo su) Example:
sudo su
mkdir ~/build
cd ~/build
tar -xvf asterisk-14-current.tar.gz
cd asterisk-14
./contrib/scripts/install_prereq install
./configure --with-jansson-bundled ##Note: you may not need jansson-bundled so omit this if needed##
make menuselect
###Select any needed addons: MP3, etc.###

Note: you can install asterisk 13, 15, or custom git asterisk branch (i.e. gvsip) instead of Asterisk-14 tar
Once you have the project built, you now need to clean the old asterisk out and reboot
make uninstall
###OR to clean EVERYTHING###
make uninstall-all

Once this is complete I like to reboot, and then run a make install to install the different version of asterisk.


Now let’s say you just want to remove Asterisk and just don’t want it anymore. Well, that is far simpler. Just run the following commands and it will be gone forever
killall -9 safe_asterisk
killall -9 asterisk
systemctl disable asterisk ##Note: depending on the install this may not be enabled or was set to run via @reboot cron or daemon service - Mileage will vary##
rm -rf /etc/asterisk
rm -rf /var/log/asterisk
rm -rf /var/lib/asterisk
rm -rf /var/lib64/asterisk
rm -rf /var/spool/asterisk
rm -rf /usr/lib/asterisk
rm -rf /usr/lib64/asterisk

These instructions should work on any Linux Based system and it shouldn’t matter if it is Red Hat based or Debian based. Let me know below if you have any issues. Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube, Steemit, and so if you’d like to see more videos please like, subscribe, and follow me.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: