apt-get and/or dpkg should be used in lieu of apt in scripts when possible. From the apt manpage (emphasis mine):
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.
All features of apt(8) are available in dedicated APT tools like apt-get(8) and apt-cache(8) as well. apt(8) just changes the default value of some options (see apt.conf(5)
and specifically the Binary scope). So you should prefer using these commands (potentially
with some additional options enabled) in your scripts as they keep backward compatibility
as much as possible.
apt-get
and/ordpkg
should be used in lieu ofapt
in scripts when possible. From theapt
manpage (emphasis mine):We are using
apt
in at least one location: https://github.com/irods/irods_python_ci_utilities/blob/946d6cb479ca7717a07014befaf49a0b20774352/irods_python_ci_utilities/irods_python_ci_utilities.py#L107apt-get
should be used to install packages from repositories.dpkg
should be used to install local packages, thenapt-get
should be used to resolve dependencies, like so: https://github.com/irods/irods_development_environment/blob/224706f9f00c27d99be152660fb0c340dcfaf082/build_and_copy_packages_to_dir.sh#L49-L61