debconf-utils是一个可以在Ubuntu下预先配置要安装程序的小工具,它可以避免在安装一个DEB程序时的弹窗输入问题,这可能在编写一键部署脚本的时候非常有用。

以下我们用安装MySQL-APT源作为示例。

1、安装debconf-utils

root@ubuntu:~# apt-get -y install debconf-utils

2、更新APT源

root@ubuntu:~# apt-get update

3、先手动安装一遍MySQL-APT源

此时有弹窗!根据弹窗和自己的需求输入并安装一遍。

root@ubuntu:~# wget https://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb
root@ubuntu:~# dpkg -i mysql-apt-config_0.8.13-1_all.deb

4、查询想要预先配置的DEB程序的相关配置信息

通过已安装的DEB程序,获取到想要静默安装预配置信息。

root@ubuntu:~# debconf-get-selections |grep 'mysql-apt-config'
mysql-apt-config mysql-apt-config/select-tools select Enabled
mysql-apt-config mysql-apt-config/select-server select mysql-5.7
mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt
mysql-apt-config mysql-apt-config/preview-component string
mysql-apt-config mysql-apt-config/repo-codename select xenial
mysql-apt-config mysql-apt-config/tools-component string mysql-tools
mysql-apt-config mysql-apt-config/select-preview select Disabled
mysql-apt-config mysql-apt-config/select-product select Ok
mysql-apt-config mysql-apt-config/repo-distro select ubuntu
mysql-apt-config mysql-apt-config/unsupported-platform select abort
mysql-apt-config mysql-apt-config/dmr-warning note

5、然后卸载已安装的DEB包

卸载刚刚需要通过图形化弹窗安装程序。

root@ubuntu:~# apt-get -y remove mysql-apt-config

6、重新安装DEB包,预配置软件

根据上面获取到预配置信息,预配置软件。

root@ubuntu:~# debconf-set-selections << EOF
mysql-apt-config mysql-apt-config/select-tools select Enabled
mysql-apt-config mysql-apt-config/select-server select mysql-5.7
mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt
mysql-apt-config mysql-apt-config/preview-component string
mysql-apt-config mysql-apt-config/repo-codename select xenial
mysql-apt-config mysql-apt-config/tools-component string mysql-tools
mysql-apt-config mysql-apt-config/select-preview select Disabled
mysql-apt-config mysql-apt-config/select-product select Ok
mysql-apt-config mysql-apt-config/repo-distro select ubuntu
mysql-apt-config mysql-apt-config/unsupported-platform select abort
mysql-apt-config mysql-apt-config/dmr-warning note
EOF

6、关闭交互式的静默安装DEB包

你会发现没有弹窗提示了!

root@ubuntu:~# DEBIAN_FRONTEND=noninteractive apt-get -y install ./mysql-apt-config_0.8.13-1_all.deb

debconf-utils-交互式安装时预配置的更多相关文章

  1. centos最小化安装时网络配置

    查看网卡: ip addr 修改网络配置文件 vi /etc/sysconfig/network-scripts/ifcfg-enp33 BOOTPROTO=dhcp ONBOOT=yes 重启网络服 ...

  2. 年终福利,PHP7+Apache2.4+MySQL5.6 源码编译安装,环境配置,搭建你自己的LAMP环境

    PHP7 都出来了,你还在玩PHP5吗? MySQL5.6 早都出来了,你还在玩MySql5.2吗? Apache2.4 早都出来了,你还在玩Apache2.2吗? 笔者不才,愿意亲自搭建环境,供搭建 ...

  3. mate-desktop安装在其他目录时一些配置信息

    1.mate-desktop安装在其他目录时一些配置信息 2.BIN目录下添加相应的mate-session_gtk2/3 3.首先配置如下环境变量 #!/bin/sh if [[ "${E ...

  4. saltstack配置安装的一些关键步骤及安装时各种报错的分析

    以下其他仅做参考,官方网址才是安装重点:http://docs.saltstack.cn/topics/installation/rhel.html 与安装相关的一些文档或资料: 一.linux服务器 ...

  5. 安装时后的idea,项目不能运行,pom.xml文件不能下载到本地仓库,maven配置是正确的

    安装时后的idea,项目不能运行,pom.xml文件不能下载到本地仓库,maven配置是正确的 项目上传到svn后,同事下载项目后,没有识别出来mavn中的pom.xml文件,导致idea不能自动下载 ...

  6. Android Studio的安装及第一次启动时的配置

    Android Studio的安装及第一次启动时的配置 一.下载Android Studio 百度搜索“Android Studio" 点击中文社区进入,选择最新版本下载. 下载后双击安装包 ...

  7. apache安装时的一些术语

    apache源码安装时,需要的哪些必须依赖模块? 主要需要apr, apr-util, pcre模块 其中 apr模块时必须的. 如何卸载 源码安装的软件? 在源码 的 解压目录下, 使用 make ...

  8. 【菜鸟玩Linux开发】Redis安装和自启动配置

    Redis是一个C实现的基于内存.可持久化的键值对数据库,在分布式服务中常作为缓存服务.本篇将介绍在CentOS下如何从零开始安装到配置启动服务. 一. 安装Redis Redis的安装其实相当简单, ...

  9. Yeoman入门之安装及环境配置

    Yeoman入门之安装及环境配置 http://blog.csdn.net/panlingfan/article/details/27345037 http://www.nodejs.orgYEOMA ...

随机推荐

  1. 内网穿透系列-Go语言

    一.介绍 软件在KCP出现后进行了重构,将其底层UDP支持替换为了KCP,使其效率大大提高,在某些恶劣的网络环境下依旧能有不错的效果.当然,它也是支持TCP模式的,另外它也是支持加密的,在P2P打洞失 ...

  2. html5文件上传断点续传

    最近公司要做一个html5上传的jquery插件,要在下先实现功能,要求显示上传进度,文件信息,断点续传等等.我一看,艾玛!Σ(゚д゚lll),没做过啊.没办法,(# ゚Д゚),只能去查资料了.作为一 ...

  3. 浏览器中唤起native app || 跳转到应用商城下载

    前段时间遇到一个小需求:要求在分享出来的h5页面中,有一个立即打开的按钮,如果本地安装了我们的app,那么点击就直接唤起本地app,如果没有安装,则跳转到下载. 因为从来没有做过这个需求,因此这注定是 ...

  4. C#内置委托类型Func和Action对比及用法

    C#的内置委托类型 Func Action 返回值 有(只有一个Tresult) 无 重载 17个(0参-16参) 17个(0参-16参) 泛型 支持 支持 系统内置 是 是 是否需要声明 否 否 c ...

  5. 使用babel编译器将es6代码转为es5的方法

    1.首先需要安装工具 babel-cli =========  npm i babel-cli -g   install 可以使用i 代替 2.安装插件   npm i --save-dev babe ...

  6. docker搭建cordova 11环境

    cordova@11 依赖环境: Java_jdk@1.8.0 Nodejs@12.22.9 android-sdk Build-tools 28 API 28 apache-ant@1.10.12 ...

  7. Coursera 学习笔记|Machine Learning by Standford University - 吴恩达

    / 20220404 Week 1 - 2 / Chapter 1 - Introduction 1.1 Definition Arthur Samuel The field of study tha ...

  8. C++---变量、数据类型和运算符

    内存 计算机使用内存来记忆或存储计算时所使用的的数据. 计算机执行程序时, 组成程序的指令和程序所操作的数据都必须存放在某个地方, 而这个地方就是计算机的内存, 也称为主存, 或随机访问存储器(RAM ...

  9. 从数据库中获取图片编号,然后通过request获取图片下载

    import pandas as pd from pandas.core.dtypes.dtypes import register_extension_dtype from sqlalchemy i ...

  10. sqlplus文件查看自带oracle命令的执行过程

    问题描述:看到一篇文章 在$ORACLE_HOME/bin/sqlplus中可以查看到数据库命令的查询语句.可以直接编辑sqlplus文件,查到到我们平时标准系统命令的原脚本,但是自己进行编辑查看却是 ...