清除星号后如何重新填充 /etc/asterisk/?

清除星号后如何重新填充 /etc/asterisk/?

/etc/asterisk清除asterisk并手动删除目录后,如何重新填充或重建?

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:~$ 

缺少开箱即用的配置文件。


这在一定程度上起到了作用:

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.)

但是,似乎实际上不起作用。是否有一些配置存储在其他地方?

答案1

中的文件/etc/asterisk看起来通常由软件包附带asterisk-config。因此您需要清除的是这个软件包。您的自动删除功能确实删除了这个软件包,但没有清除它。sudo apt-get --purge autoremove本来可以这样做,但现在它已被删除,dpkg -P asterisk-config这是必要的。

可能还有其他文件需要清除。关键是确定哪个软件包包含您删除的文件,然后清除并重新安装这些软件包。

该命令debsums -ecdebsums首先安装软件包)将告诉您哪些配置文件已被删除以及哪些软件包提供了这些配置文件,因此这可以告诉您需要清除和重新安装哪些文件。或者,对于任何文件,运行该命令以告诉您哪个软件包提供了该文件。dpkg -S file

相关内容