como repopular o / etc / asterisk / depois de limpar o asterisco?

4

Como repovoar ou reconstruir /etc/asterisk depois de remover asterisk e remover manualmente o diretório?

thufir@mordor:~$ 
thufir@mordor:~$ sudo apt-get purge asterisk asterisk-mp3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  asterisk* asterisk-mp3* asterisk-voicemail*
0 upgraded, 0 newly installed, 3 to remove and 306 not upgraded.
After this operation, 5,345 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 271591 files and directories currently installed.)
Removing asterisk-voicemail (1:13.1.0~dfsg-1.1ubuntu3) ...
Removing asterisk-mp3 (1:13.1.0~dfsg-1.1ubuntu3) ...
Removing asterisk (1:13.1.0~dfsg-1.1ubuntu3) ...
Purging configuration files for asterisk (1:13.1.0~dfsg-1.1ubuntu3) ...
dpkg: warning: while removing asterisk, directory '/var/spool/asterisk/monitor' not empty so not removed
Processing triggers for man-db (2.7.4-1) ...
thufir@mordor:~$ 
thufir@mordor:~$ sudo rm -rf /etc/asterisk/
thufir@mordor:~$ 
thufir@mordor:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules asterisk-moh-opsound-gsm freetds-common
  libiksemel3 libjansson4 libpj2 libpjlib-util2 libpjmedia-audiodev2 libpjmedia2 libpjnath2 libpjsip-simple2 libpjsip-ua2 libpjsip2
  libresample1 libsqlite0 libsybdb5
0 upgraded, 0 newly installed, 19 to remove and 306 not upgraded.
After this operation, 17.5 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 271402 files and directories currently installed.)
Removing asterisk-config (1:13.1.0~dfsg-1.1ubuntu3) ...
Removing asterisk-core-sounds-en (1.4.22-1) ...
Removing asterisk-core-sounds-en-gsm (1.4.22-1) ...
Removing asterisk-modules (1:13.1.0~dfsg-1.1ubuntu3) ...
Removing asterisk-moh-opsound-gsm (2.03-1) ...
Removing libsybdb5:amd64 (0.91-6.1) ...
Removing freetds-common (0.91-6.1) ...
Removing libiksemel3:amd64 (1.4-2) ...
Removing libjansson4:amd64 (2.7-1ubuntu1) ...
Removing libpjsip-ua2 (2.1.0.0.ast20130823-1) ...
Removing libpjsip-simple2 (2.1.0.0.ast20130823-1) ...
Removing libpjsip2 (2.1.0.0.ast20130823-1) ...
Removing libpjmedia2 (2.1.0.0.ast20130823-1) ...
Removing libpjnath2 (2.1.0.0.ast20130823-1) ...
Removing libpjlib-util2 (2.1.0.0.ast20130823-1) ...
Removing libpjmedia-audiodev2 (2.1.0.0.ast20130823-1) ...
Removing libresample1 (0.1.3-4) ...
Removing libsqlite0 (2.8.17-12fakesync1) ...
Removing libpj2 (2.1.0.0.ast20130823-1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for man-db (2.7.4-1) ...
thufir@mordor:~$ 
thufir@mordor:~$ sudo apt-get install asterisk 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules asterisk-moh-opsound-gsm asterisk-voicemail
  freetds-common libiksemel3 libjansson4 libpj2 libpjlib-util2 libpjmedia-audiodev2 libpjmedia2 libpjnath2 libpjsip-simple2
  libpjsip-ua2 libpjsip2 libresample1 libsqlite0 libsybdb5
Suggested packages:
  asterisk-doc asterisk-dev asterisk-ooh323 asterisk-dahdi asterisk-vpb
The following NEW packages will be installed:
  asterisk asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules asterisk-moh-opsound-gsm
  asterisk-voicemail freetds-common libiksemel3 libjansson4 libpj2 libpjlib-util2 libpjmedia-audiodev2 libpjmedia2 libpjnath2
  libpjsip-simple2 libpjsip-ua2 libpjsip2 libresample1 libsqlite0 libsybdb5
0 upgraded, 21 newly installed, 0 to remove and 306 not upgraded.
Need to get 0 B/8,796 kB of archives.
After this operation, 22.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Selecting previously unselected package libiksemel3:amd64.
(Reading database ... 270371 files and directories currently installed.)
Preparing to unpack .../libiksemel3_1.4-2_amd64.deb ...
Unpacking libiksemel3:amd64 (1.4-2) ...
Selecting previously unselected package libjansson4:amd64.
Preparing to unpack .../libjansson4_2.7-1ubuntu1_amd64.deb ...
Unpacking libjansson4:amd64 (2.7-1ubuntu1) ...
Selecting previously unselected package asterisk-config.
Preparing to unpack .../asterisk-config_1%3a13.1.0~dfsg-1.1ubuntu3_all.deb ...
Unpacking asterisk-config (1:13.1.0~dfsg-1.1ubuntu3) ...
Selecting previously unselected package libpj2.
Preparing to unpack .../libpj2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpj2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjlib-util2.
Preparing to unpack .../libpjlib-util2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjlib-util2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjmedia-audiodev2.
Preparing to unpack .../libpjmedia-audiodev2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjmedia-audiodev2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjnath2.
Preparing to unpack .../libpjnath2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjnath2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjmedia2.
Preparing to unpack .../libpjmedia2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjmedia2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjsip2.
Preparing to unpack .../libpjsip2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjsip2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjsip-simple2.
Preparing to unpack .../libpjsip-simple2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjsip-simple2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libpjsip-ua2.
Preparing to unpack .../libpjsip-ua2_2.1.0.0.ast20130823-1_amd64.deb ...
Unpacking libpjsip-ua2 (2.1.0.0.ast20130823-1) ...
Selecting previously unselected package libresample1.
Preparing to unpack .../libresample1_0.1.3-4_amd64.deb ...
Unpacking libresample1 (0.1.3-4) ...
Selecting previously unselected package libsqlite0.
Preparing to unpack .../libsqlite0_2.8.17-12fakesync1_amd64.deb ...
Unpacking libsqlite0 (2.8.17-12fakesync1) ...
Selecting previously unselected package freetds-common.
Preparing to unpack .../freetds-common_0.91-6.1_all.deb ...
Unpacking freetds-common (0.91-6.1) ...
Selecting previously unselected package libsybdb5:amd64.
Preparing to unpack .../libsybdb5_0.91-6.1_amd64.deb ...
Unpacking libsybdb5:amd64 (0.91-6.1) ...
Selecting previously unselected package asterisk-modules.
Preparing to unpack .../asterisk-modules_1%3a13.1.0~dfsg-1.1ubuntu3_amd64.deb ...
Unpacking asterisk-modules (1:13.1.0~dfsg-1.1ubuntu3) ...
Selecting previously unselected package asterisk-core-sounds-en-gsm.
Preparing to unpack .../asterisk-core-sounds-en-gsm_1.4.22-1_all.deb ...
Unpacking asterisk-core-sounds-en-gsm (1.4.22-1) ...
Selecting previously unselected package asterisk-core-sounds-en.
Preparing to unpack .../asterisk-core-sounds-en_1.4.22-1_all.deb ...
Unpacking asterisk-core-sounds-en (1.4.22-1) ...
Selecting previously unselected package asterisk.
Preparing to unpack .../asterisk_1%3a13.1.0~dfsg-1.1ubuntu3_amd64.deb ...
Unpacking asterisk (1:13.1.0~dfsg-1.1ubuntu3) ...
Selecting previously unselected package asterisk-voicemail.
Preparing to unpack .../asterisk-voicemail_1%3a13.1.0~dfsg-1.1ubuntu3_amd64.deb ...
Unpacking asterisk-voicemail (1:13.1.0~dfsg-1.1ubuntu3) ...
Selecting previously unselected package asterisk-moh-opsound-gsm.
Preparing to unpack .../asterisk-moh-opsound-gsm_2.03-1_all.deb ...
Unpacking asterisk-moh-opsound-gsm (2.03-1) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
Setting up libiksemel3:amd64 (1.4-2) ...
Setting up libjansson4:amd64 (2.7-1ubuntu1) ...
Setting up asterisk-config (1:13.1.0~dfsg-1.1ubuntu3) ...
Setting up libpj2 (2.1.0.0.ast20130823-1) ...
Setting up libpjlib-util2 (2.1.0.0.ast20130823-1) ...
Setting up libpjmedia-audiodev2 (2.1.0.0.ast20130823-1) ...
Setting up libpjnath2 (2.1.0.0.ast20130823-1) ...
Setting up libpjmedia2 (2.1.0.0.ast20130823-1) ...
Setting up libpjsip2 (2.1.0.0.ast20130823-1) ...
Setting up libpjsip-simple2 (2.1.0.0.ast20130823-1) ...
Setting up libpjsip-ua2 (2.1.0.0.ast20130823-1) ...
Setting up libresample1 (0.1.3-4) ...
Setting up libsqlite0 (2.8.17-12fakesync1) ...
Setting up freetds-common (0.91-6.1) ...
Setting up libsybdb5:amd64 (0.91-6.1) ...
Setting up asterisk-modules (1:13.1.0~dfsg-1.1ubuntu3) ...
Setting up asterisk-core-sounds-en-gsm (1.4.22-1) ...
Setting up asterisk-core-sounds-en (1.4.22-1) ...
update-alternatives: using /usr/share/asterisk/sounds/en_US_f_Allison to provide /usr/share/asterisk/sounds/en (asterisk-prompt-en) in auto mode
update-alternatives: using /usr/share/asterisk/sounds/en_US_f_Allison to provide /usr/share/asterisk/sounds/en_US (asterisk-prompt-en-us) in auto mode
Setting up asterisk (1:13.1.0~dfsg-1.1ubuntu3) ...
Adding system user for Asterisk
Adding user 'asterisk' to group 'dialout' ...
Adding user asterisk to group dialout
Done.
Adding user 'asterisk' to group 'audio' ...
Adding user asterisk to group audio
Done.
Setting up asterisk-voicemail (1:13.1.0~dfsg-1.1ubuntu3) ...
Setting up asterisk-moh-opsound-gsm (2.03-1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
thufir@mordor:~$ 
thufir@mordor:~$ 
thufir@mordor:~$ sudo ls /etc/asterisk/
manager.d
thufir@mordor:~$ 

Faltam arquivos de configuração que estão incluídos fora da caixa.

Isso estava funcionando de certa forma:

thufir@mordor:~$ 
thufir@mordor:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules asterisk-moh-opsound-gsm freetds-common
  libiksemel3 libjansson4 libpj2 libpjlib-util2 libpjmedia-audiodev2 libpjmedia2 libpjnath2 libpjsip-simple2 libpjsip-ua2 libpjsip2
  libresample1 libsqlite0 libsybdb5
0 upgraded, 0 newly installed, 19 to remove and 304 not upgraded.
After this operation, 17.5 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 271360 files and directories currently installed.)

No entanto, não parece realmente funcionar. Existe alguma configuração armazenada em outro lugar?

    
por Thufir 14.07.2016 / 12:53

1 resposta

4

Os arquivos em /etc/asterisk parecem que geralmente são enviados pelo pacote asterisk-config . Então é esse pacote que você precisa limpar. Seu autoremove removeu esse pacote, mas não o removeu. sudo apt-get --purge autoremove teria feito isso, mas agora que foi removido, dpkg -P asterisk-config é necessário.

Pode haver outros arquivos que você também precisa limpar. A chave é identificar qual pacote envia os arquivos removidos e limpar e reinstalar esses pacotes.

O comando debsums -ec (instale primeiro o pacote debsums ) lhe dirá quais arquivos de configuração foram removidos e quais pacotes os forneceram, portanto, isso pode informar o que você precisa limpar e reinstalar. Como alternativa, para qualquer arquivo, execute o comando dpkg -S file para informar qual pacote o forneceu.

    
por Robie Basak 18.07.2016 / 22:38