aptitude safe-upgrade equivalence with apt-get

The apt-get command closer to aptitude safe-upgrade is upgrade, 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 to aptitude --no-new-installs safe-upgrade.


To be a bit more precise on package removal:

man aptitude says:

-safe-upgrade ... Installed packages will not be removed unless they are unused ...

whereas man apt-get says:

-upgrade ...under no circumstances are currently installed packages removed ...


I think that the equivalent would be:

apt-get --with-new-pkgs upgrade

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.

Tags:

Apt

Aptitude