And the key is that --with-new-pkgs allow installing new packages when used in conjunction with upgrade so it basically do the same thing than aptitude safe-upgrad, install upgrades and new packages that are needed by this updates.
Combining PhoenixS's command and Roland Becker's comment about removal of unused packages (and double checking all this in the man pages of aptitude and apt-get), it would appear that the command using apt-get that completely mimics the behvaiour of aptitude safe-upgrade is
apt-get upgrade --with-new-pkgs --autoremove
This has been tested once on Ubuntu 16.04, and it at least ran, removing some packages and upgrading some other packages, but not installing any new packages (guess it was not necessary in that context)
The
apt-get
command closer toaptitude safe-upgrade
isupgrade
, but there is a difference.aptitude safe-upgrade
upgrades currently installed packages and can install new packages to resolve new dependencies, but never removes packages.apt-get upgrade
upgrades currently installed packages, but never installs or removes packages.So
apt-get upgrade
is comparable toaptitude --no-new-installs safe-upgrade
.To be a bit more precise on package removal:
man aptitude says:
whereas man apt-get says:
I think that the equivalent would be:
And the key is that
--with-new-pkgs
allow installing new packages when used in conjunction with upgrade so it basically do the same thing thanaptitude safe-upgrad
, install upgrades and new packages that are needed by this updates.Combining PhoenixS's command and Roland Becker's comment about removal of unused packages (and double checking all this in the man pages of
aptitude
andapt-get
), it would appear that the command usingapt-get
that completely mimics the behvaiour ofaptitude safe-upgrade
isapt-get upgrade --with-new-pkgs --autoremove
This has been tested once on Ubuntu 16.04, and it at least ran, removing some packages and upgrading some other packages, but not installing any new packages (guess it was not necessary in that context)