小编Chr*_*ris的帖子

如何让 APT 对 Bash 脚本中的所有安装假定“是”并强制“是”

我目前正在接触 Linux,想要编写一个 Bash 脚本来按照我想要的方式设置一台新机器。

为了做到这一点,我想在上面安装不同的东西,等等。

我在这里想要实现的是在 Bash 脚本的顶部进行一个设置,这将使 APT 接受脚本执行期间提出的所有 [y/n] 问题。

我想自动接受的问题示例:

After this operation, 1092 kB of additional disk space will be used. Do you want to continue? [Y/n]

我刚刚开始创建文件,所以到目前为止我所拥有的内容如下:

#!/bin/bash

# Constants

# Set APT to accept all [y/n] questions
>> some setting here <<

# Update and upgrade APT
apt update;
apt full-upgrade;

# Install terminator
apt install terminator
Run Code Online (Sandbox Code Playgroud)

bash apt apt-get

13
推荐指数
1
解决办法
1万
查看次数

标签 统计

apt ×1

apt-get ×1

bash ×1