Run apt update only when neccesary #334

Closed
opened 2023-04-20 00:33:12 +02:00 by Nikongen · 0 comments
Nikongen commented 2023-04-20 00:33:12 +02:00 (Migrated from github.com)

Most often using I am using kiauh to setup a full klipper installation with web frontend on a pi

  1. Klipper
  2. Moonraker
  3. Mainsail/Fluid
  4. Build/Flash
  5. Webcam stuff or else
    Each step will kick of an apt update which takes quite some time, especially on older hardware/pis

Describe the solution you'd like

Check when apt cache was last updated before running apt update.
If apt cache is still quite recent (e.g. last update <4h ago), don't run apt update to save some time.

Describe alternatives you've considered

Additional information

Example solution bash script on Ask Ubuntu

### Is your feature request related to a problem? Please describe Most often using I am using kiauh to setup a full klipper installation with web frontend on a pi 1. Klipper 2. Moonraker 3. Mainsail/Fluid 4. Build/Flash 5. Webcam stuff or else Each step will kick of an `apt update` which takes quite some time, especially on older hardware/pis ### Describe the solution you'd like Check when apt cache was last updated before running `apt update`. If apt cache is still quite recent (e.g. last update <4h ago), don't run `apt update` to save some time. ### Describe alternatives you've considered - ### Additional information [Example solution bash script on Ask Ubuntu ](https://askubuntu.com/a/589036)
Sign in to join this conversation.