[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt update behaves differently from apt-get update



On Fri, Jun 22, 2018 at 4:23 PM Nish Aravamudan
<nish.aravamudan@gmail.com> wrote:
>
> On Fri, Jun 22, 2018 at 9:46 AM Lao Shaw <laoshaw21@gmail.com> wrote:
>>
>> On my freshly installed ubuntu 18.06 my cron job use 'apt-get' as 'apt' is not recommended to be used in scripts. however, 'apt-get update' will keep back my packages while 'apt upgrade' will upgrade them, this is not expected.
>
>
> I think you have the wrong mailing list, but, `man apt` says:
>
>        apt provides a high-level commandline interface for the package
>        management system. It is intended as an end user interface and enables
>        some options better suited for interactive usage by default compared to
>        more specialized APT tools like apt-get(8) and apt-cache(8).
>
> This does not make me think that `apt` and `apt-get` are intended to have the same behavior in all operations (given that some options are explicitly (well the "some" is explicit, which actually are is not) enabled in `apt` only by default.

$ man apt | grep -E -A 3 '^       upgrade'
       upgrade (apt-get(8))
           upgrade is used to install available upgrades of all
packages currently installed on the system from the sources configured
via sources.list(5). New packages will be installed if required to
satisfy dependencies, but existing packages will never be
           removed. If an upgrade for a package requires the remove of
an installed package the upgrade for this package isn't performed.

$ man apt-get | grep -E -A 4 '^       upgrade'
       upgrade
           upgrade is used to install the newest versions of all
packages currently installed on the system from the sources enumerated
in /etc/apt/sources.list. Packages currently installed with new
versions available are retrieved and upgraded; under no
           circumstances are currently installed packages removed, or
packages not already installed retrieved and installed. New versions
of currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
           their current version. An update must be performed first so
that apt-get knows that new versions of packages are available.


as you said, notice the difference in behavior:
apt: "New packages will be installed if required to satisfy dependencies"
apt-get: "under no circumstances are ... packages not already
installed retrieved and installed"


>
> Thanks,
> Nish
> --
> Ubuntu-devel-discuss mailing list
> Ubuntu-devel-discuss@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Reply to: