quantum-mobile icon indicating copy to clipboard operation
quantum-mobile copied to clipboard

Run `apt upgrade` and `apt autoremove`?

Open borellim opened this issue 4 years ago • 3 comments

This would:

  • keep all packages up to date (upgrade)
  • save disk space (autoremove)

Questions:

  • any disadvantages?
  • do we already do it anywhere?

This is also for the Cloud edition.

borellim avatar Jul 20 '20 19:07 borellim

Both of these commands are already run as part of the simulationbase role.

  • apt upgrade is already run here https://github.com/marvel-nccr/ansible-role-simulationbase/blob/68b025c9bfcfe50b046aca06f50796cc212960e1/tasks/package_managers.yml#L5
  • apt autoremove (as well as other "cleaning" commands) are run when https://github.com/marvel-nccr/ansible-role-simulationbase/blob/master/handlers/main.yml

Note that both require guards since they aren't idempotent (guard for apt upgrade: 1 day cache; guard for autoremove: only run on demand)

ltalirz avatar Jul 20 '20 20:07 ltalirz

Ok, thanks a lot. I'll look into these.

EDIT: I'm not closing the issue because several packages are out of date even immediately after deployment. In fact, I suspect the correct form of the first task you linked would be:

  apt:
    name: "*"
    state: latest
    cache_valid_time: 86400  # One day

borellim avatar Jul 21 '20 12:07 borellim

MEMO: upgrading the kernel breaks the VirtualBox guest additions, unless kernel headers are also installed. To install kernel headers, install package linux-headers-generic: the latest version will be installed.

borellim avatar Jul 23 '20 10:07 borellim