Run apt-get update before installing packages #128

Closed
opened 2021-11-20 13:24:23 +00:00 by ungleich-gitea · 1 comment

Created by: matthijskooijman

AFAICS, currently apt-get update is not ran before installing packages, which might lead to outdated packages being installed, or 404 errors on downloads.

There is __apt_update_index, but that only updates if anything in /etc/apt changed, ignoring the fact that the package archive itself also changes. There is __package_update_index, which supports updating on every run, or whenever the indexes are older than some specified time, but that will likely cause downloading the indices when they're not going to be used.

To properly solve this, the __package_apt type should (implicitly?) depend on __package_update_index, which should have some kind of --only-when-needed flag (implied when the user does not specify __package_update_index in the manifest explicitly?). This does require the __package_update_index type to be able to look into the future to see if any __package_apt types are going to be executed (and it should probably not hardcode that name, so the relation should probably be reversed).

Ideally, this update type would also be used by __apt_source, which now just calls apt-get update, which could then lead to running it twice when not really needed.

Again, not sure how this should work, but would be nice if it would work automatically :-)

*Created by: matthijskooijman* AFAICS, currently apt-get update is not ran before installing packages, which might lead to outdated packages being installed, or 404 errors on downloads. There is `__apt_update_index`, but that only updates if anything in `/etc/apt` changed, ignoring the fact that the package archive itself also changes. There is `__package_update_index`, which supports updating on every run, or whenever the indexes are older than some specified time, but that will likely cause downloading the indices when they're not going to be used. To properly solve this, the `__package_apt` type should (implicitly?) depend on `__package_update_index`, which should have some kind of `--only-when-needed` flag (implied when the user does not specify `__package_update_index` in the manifest explicitly?). This does require the `__package_update_index` type to be able to look into the future to see if any `__package_apt` types are going to be executed (and it should probably not hardcode that name, so the relation should probably be reversed). Ideally, this update type would also be used by `__apt_source`, which now just calls `apt-get update`, which could then lead to running it twice when not really needed. Again, not sure how this should work, but would be nice if it *would* work automatically :-)
ungleich-gitea added the
Stale
label 2021-11-20 13:24:23 +00:00
Author
Owner

closed

closed
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#128
No description provided.