WARNING: apt does not have a stable CLI interface. Use with caution in scripts

Hello, I have Virtualmin on Ubuntu and I try to install an app that required php imap.
after some quick googling, this is the very basic line to install.

sudo apt install php8.1-imap

I’m on php8.1
I get this message : WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

I tried with apt and with apt-get and apt update && upgrade. Same problem.

This is exacly that I got:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libllvm11
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libapache2-mod-php8.1 libc-client2007e mlock php8.1-bcmath php8.1-cgi
  php8.1-cli php8.1-common php8.1-curl php8.1-fpm php8.1-gd php8.1-mbstring
  php8.1-mysql php8.1-opcache php8.1-readline php8.1-xml php8.1-zip
Suggested packages:
  uw-mailutils
The following NEW packages will be installed:
  libc-client2007e mlock php8.1-imap
The following packages will be upgraded:
  libapache2-mod-php8.1 php8.1-bcmath php8.1-cgi php8.1-cli php8.1-common
  php8.1-curl php8.1-fpm php8.1-gd php8.1-mbstring php8.1-mysql php8.1-opcache
  php8.1-readline php8.1-xml php8.1-zip
14 upgraded, 3 newly installed, 0 to remove and 12 not upgraded.
Need to get 9,323 kB of archives.
After this operation, 1,649 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.

sudo apt autoremove gave the same problem too. I tried the thinks on stackoverflow but it doesn’t work.

Thanks for your help

You’re trying to run interactive commands in a non-interactive shell. The Command Shell in Webmin (and the popup shell in Authentic Theme) is not interactive. You cannot run anything that needs you to answers questions in it. You can’t run vim, emacs, etc.

If you want to use apt-get you need to include the -y flag to choose yes.

Or, just use a real shell, which is the better choice for anything complicated.

1 Like

Thanks but I will have to do it every time I use apt and apt-get are they a way to fix it once and for all?

if you need to update, just go to /package-updates/index.cgi?mode=updates&xnavigation=1 directory, you can set scheduled update.

I just told you what you have to do. Either use a real interactive (not the popup shell in Webmin), or use the -y option to assume the answer to any question is “yes”. Using a real terminal is the better choice.

There is a Software Packages module if you want to run apt in Webmin. And, you’ll already be notified of available updates in the UI whenever they’re available, as long as you haven’t disabled status collection.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.