とあるスクリプト内に apt update
と書いたら
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
と出力された。なんだこれはと思ってウェブ検索すると、
https://askubuntu.com/questions/990823/apt-gives-unstable-cli-interface-warning/
apt
‘s output is not well useable in scripts.
とのこと。man ページにも
SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
$ man apt
The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.
とあるので、通常のインタラクティブなコマンドラインでは apt
、スクリプト内では apt-get
を使いましょう!ということですね。