Need help to remove asterisk

Using yum undo
If you installed VoIP PBX module alone (as one transaction, without other modules) the following should do it:

yum history package asterisk13*  # find history's transaction ID
yum history undo 14    # where 14 should be replaced with the corresponding transaction ID. Carefully read the package list before giving confirmation.

Manually removing packages
Otherwise, you can try to remove packages manually, as before carefully reading the list of packages and dependencies that will be removed (here I’ve excluded some packages like the ones related to php, mysql/mariadb, whois…):

yum --setopt=remove_leaf_only=1 remove asterisk-sounds-extra-en-ulaw asterisk13-\* dahdi-\* dos2unix flac-libs freepbx freetds ghostscript ghostscript-fonts glib glib-networking glibmm24 gsettings-desktop-schemas gsm gssdp gstreamer gstreamer-tools gstreamer1 gupnp gupnp-igd icu jack-audio-connection-kit janus-gateway jbigkit-libs kmod-dahdi-linux lcms2 libICE libSM libXfont libXi libXt libXtst libao libasyncns libconfig libffado libfontenc libical libicu-devel libiec61883 libmicrohttpd libnice libogg libopenr2 libpri libraw1394 libresample libsamplerate libsigc++20 libsndfile libsoup libsrtp15 libss7 libtiff libtonezone libuv libvorbis libvpx libwebsockets libxml++ mpg123 mpg123-libs mysql-connector-odbc nethserver-{freepbx,janus,unixODBC} nodejs npm opus poppler-data portaudio postgresql-libs postgresql-odbc pulseaudio-libs radiusclient-ng sofia-sip sox spandsp speex sqlite2 t1lib tftp-server unixODBC urw-fonts wavpack xorg-x11-font-utils

Removing (hopefully most) leftovers
Removing files, directories, symbolic links, databases, e-smith db entries…:

  • As the test was done on a clean PBX install, without any configuration, there could be a few remnants.
  • Here we assume you don’t care about any related data.
  • Note a lot of directories are empty and do nothing.
  • Log files/dirs are excluded.
  • If some other program is using some of the files (odbc…), don’t remove it.
  • As always, when using rm with -f option, check the command as many times as needed to make sure there are no typos (better safe than sorry).
  • If copy-pasting note these are multi-line commands.
rm /etc/{amportal.conf,freepbx.conf,odbc.ini,odbcinst.ini.rpmsave} \
/root/.odbc.ini \
/usr/sbin/amportal \
/usr/sbin/fwconsole \
/etc/systemd/system/multi-user.target.wants/httpd-fpbx.service \
/etc/rc.d/rc{0,1,2,3,4,5,6}.d/K60asterisk \
/var/spool/cron/asterisk \
/var/lib/systemd/linger/asterisk \
/var/lib/nethserver/secrets/JanusGateway \
/etc/httpd/conf.d/freepbx.conf

rm -rf /etc/asterisk/ \
/etc/e-smith/events/nethserver-{freepbx-httpd-save,freepbx-update,janus-update,unixODBC-update} \
/etc/e-smith/templates.metadata/opt/janus/ \
/etc/e-smith/templates/etc/{asterisk,backup-data.d/freepbx.include,httpd/conf.d/freepbx.conf,odbc.ini,odbcinst.ini} \
/etc/httpd/fpbx-conf \
/etc/systemd/system/asterisk.service.d \
/usr/lib64/asterisk \
/var/lib/asterisk \
/var/www/html/freepbx \
/var/www/sofia-sip \
/var/spool/asterisk \
/var/lib/mysql/asteriskcdrdb \
/etc/e-smith/events/certificate-update/templates2expand/opt/janus \
/etc/e-smith/templates/opt/janus \
/opt/janus \
/usr/src/freepbx

Removing databases:

mysql
DROP DATABASE asterisk;
DROP DATABASE asteriskcdr;
exit;

Removing e-smith db related entries:

db configuration delete httpd-fpbx
db configuration delete janus-gateway
db configuration delete asterisk
db configuration delete MySQL-asteriskcdrdb

Removing asterisk user (with its home folder and mail spool):

userdel -r asterisk

Just in case, reloading httpd

systemctl reload httpd

Agree with both of you (@LayLow and @danb35).

6 Likes