Non-interactive APT installation for Percona Server for MySQL 9.7¶
Automate Percona Server for MySQL installation with APT on Debian or Ubuntu. Use cloud-init, Ansible, or a continuous integration (CI) image. For an interactive install, see Use an APT repository to install Percona Server for MySQL 9.7.
Non-interactive installs and debconf¶
The -y flag on apt install skips APT confirmation prompts only. Maintainer scripts for percona-server-server can still ask debconf questions. Common prompts include the following:
-
The MySQL
rootpassword -
Whether to reuse an existing data directory
-
Lowercase table names
Prompts depend on the percona-server-server package version and on data on the disk.
Lab baseline and debconf validation¶
Debconf template names and valid answers depend on the Linux distribution, the release (such as 22.04 or 24.04), and the percona-server-server package version. Template names do not depend on the Percona Server 9.7 product line alone.
Treat each preseed example as illustrative until you confirm keys on a disposable host that matches production.
-
Pick a lab image that matches production. Match
.listrepositories, distribution release, and architecture. The examples target Ubuntu 22.04 LTS (Jammy) and Percona Server for MySQL 9.7 packages from the Percona APT repository. On Debian, Ubuntu 24.04 LTS, or other distributions, keys can differ. Extra questions can appear. -
On the lab host or on a CI image with the same configuration, install the package version you plan for production. Capture the output:
lsb_release -a dpkg-query -W percona-server-server sudo debconf-show percona-server-server | tee debconf-percona-server-server.txtStore
debconf-percona-server-server.txtwith your automation (Ansible, cloud-init, or similar). Run the capture again after a base-image or package upgrade. -
For automation, pin the
percona-server-serverversion or record the build ID fromdpkg-query. Pinning ties preseed scripts to a knowndebconf-showresult.
To automate prompts:
-
Discover questions for your package version. On a lab host, install once interactively or inspect templates. Run:
sudo debconf-show percona-server-serverThe package ships template definitions at paths such as
/var/lib/dpkg/info/percona-server-server.templates.Verify templates for each target. Preseed names and choices can differ by distribution, point release, and package version. Run
debconf-showagain after upgrades or after a base-image change. For production automation, keep a checklist that maps distribution and package version to saveddebconf-showoutput. -
Preseed answers with
debconf-set-selectionsbeforeapt install. Many Percona Server for MySQL 9.7 packages usepercona-server-server/root-passandpercona-server-server/re-root-passfor password prompts:echo "percona-server-server percona-server-server/root-pass password <strong-password>" | sudo debconf-set-selections echo "percona-server-server percona-server-server/re-root-pass password <strong-password>" | sudo debconf-set-selectionsOther prompts, such as
percona-server-server/lowercase-table-namesorpercona-server-server/remove-data-dir, appear only on some upgrade or edge-case paths. Add lines fromdebconf-showoutput. Do not commit real passwords to version control or shell history. -
Optional: set
DEBIAN_FRONTEND=noninteractivefor thepercona-server-serverinstall so debconf does not open a user interface. Combine non-interactive installs with preseeding. Without defaults for required questions, the Debian packageconfigurestep can fail or leave the server in an unexpected state.sudo DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server
Default authentication plugin¶
When a distribution or package adds a debconf choice for authentication, the prompt appears in debconf-show output for percona-server-server. On 9.7, native-password authentication is unavailable. Unattended installs must use caching_sha2_password and compatible clients. See Configure authentication during APT install and Authentication methods.
See also¶
-
Telemetry: Set
PERCONA_TELEMETRY_DISABLE=1on theaptcommand line to disable collection -
Authentication methods:
caching_sha2_passwordand related settings -
Post-installation: Secure and configure the server after package install
-
Debian Wiki — debconf : Debconf and preseeding on Debian-derived systems
Unattended installations¶
Use the apt and percona-release sequence in Install Percona Server for MySQL using APT. Add -y to each sudo apt install command that must skip APT confirmations. For percona-release, use the non-interactive options in the following snippet.
The -y flag confirms all actions without user input. Use the flag for unattended installations or automated scripts. The flag skips confirmation prompts. You cannot review changes before the command runs. Use the flag only when you trust the command.
Recommended syntax with percona-release setup:
percona-release setup -y ps-97-lts