Linux下实现软件的静默安装 debconf
2016-03-23 09:33
1471 查看
1. 用debconf-show + 包名查出预配置项。
2. 在脚本里,用debconf-set-selections设置然后安装。
debconf-set-selections命令
-c, --checkonly 只检查输入文件的格式
-u, --unseen 在预置参数时,不设置'seen'标识
2、先输入文件,再一次性添入设置参数
3、使用echo方式输入设置参数
4、直接从文件中读取设置参数
2. 在脚本里,用debconf-set-selections设置然后安装。
debconf-set-selections命令
1.功能作用
在debconf database中插入默认值2.位置
/usr/bin/debconf-set-selections
3.格式用法
debconf-set-selections [-vcu] [file]
4.主要参数
-v, --verbose 显示运行过程信息-c, --checkonly 只检查输入文件的格式
-u, --unseen 在预置参数时,不设置'seen'标识
1 2 3 | -v, --verbose 显示运行过程信息 -c, --checkonly 只检查输入文件的格式 -u, --unseen 在预置参数时,不设置'seen'标识 |
5.应用实例
1、命令行输入设置参数sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password your_password' sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password your_password' sudo apt-get -y install mysql-server
2、先输入文件,再一次性添入设置参数
echo "mysql-server-5.5 mysql-server/root_password password $MYSQL_ROOT_PASS" > /tmp/mysql.preseed echo "mysql-server-5.5 mysql-server/root_password_again password $MYSQL_ROOT_PASS" >> /tmp/mysql.preseed cat /tmp/mysql.preseed | sudo debconf-set-selections rm /tmp/mysql.preseed sudo apt-get install -y mysql-server
3、使用echo方式输入设置参数
echo 'mysql-server-5.5 mysql-server/root_password password your_password' | sudo debconf-set-selections echo 'mysql-server-5.5 mysql-server/root_password_again password your_password' | sudo debconf-set-selections sudo apt-get install -y mysql-server
4、直接从文件中读取设置参数
sudo debconf-set-selections mysql-passwd sudo apt-get install -y mysql-server
相关文章推荐
- 生产环境中centOS7最简版安装
- Linux命令下,cp,rm,mv命令的使用
- linux内核在线阅读
- Linux的文件权限(简单易懂)
- Linux技术学习路线
- linux中makefile的用法
- Linux怎样创建FTP服务器--修改用户默认目录-完美解决 - 费元星
- C# 和 Linux 时间戳转换
- CentOS 7 安装 MySQL
- Linux平台Makefile文件的编写基础篇
- linux安装qt
- Qt for Embedded Linux
- linux 打包zip
- linux的一些记录
- centos6.7 64位安装及初始化环境配置
- windows后台服务如何部署到Linux
- 三、Linux学习之命令基本格式篇
- Linux wget命令详解
- LINUX
- VMware安装CentOS无法自动获取IP问题