9

使用dpkg-reconfigure重新配置已安装好的应用

 3 years ago
source link: https://www.lujun9972.win/blog/2018/09/24/%E4%BD%BF%E7%94%A8dpkg-reconfigure%E9%87%8D%E6%96%B0%E9%85%8D%E7%BD%AE%E5%B7%B2%E5%AE%89%E8%A3%85%E5%A5%BD%E7%9A%84%E5%BA%94%E7%94%A8/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用dpkg-reconfigure重新配置已安装好的应用

在Ubuntu/Debian上安装应用时,若应用需要配置则安装脚本通常会问你几个问题并根据回答自动生成配置。 这种生成配置的方法很人性化,也很方便。

那么对于已经安装好的应用,若希望修改配置,能够也采用这种方法来重新配置吗? 答案是“能”,这就需要用到今天要介绍的主角: dpkg-reconfigure 了.

dpkg-reconfigure的使用方法很简单:

sudo dpkg-reconfigure phpmyadmin

你还可以通过它的 -r 选项来选择使用哪个前端来显示问题,比如(dailog,readline,gnome,kde,editor和noninteractive)

sudo dpkg-reconfigure -r readline phpmyadmin

我们还可以通过 -p 选项来设置哪个级别的问题才需要咨询用户(critical,high,medium,low),少于这个级别的问题则直接使用默认值就好

sudo dpkg-reconfigure -p high phpmyadmin

使用dpkg-reconfigure配置应用时,会先检查应用的状态,若为损坏的状态则dpkg-reconfigure会报错退出。 若需要pkg-reconfigure不检查应用状态,强制进行重配置,则需要使用 -f 参数

sudo dpkg-reconfigure -f phpmyadmin

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK