-
Notifications
You must be signed in to change notification settings - Fork 72
[fix] : update cache before running install #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a package installation failure caused by stale package cache by ensuring apt-get update runs before driver installation. The fix adds error handling to the cache update operation and calls it at the appropriate point in the init sequence.
Changes:
- Added error handling to
_update_package_cache()to catch and report update failures - Called
_update_package_cache()before_install_driver()in theinit()function - Applied changes consistently across Ubuntu 22.04 and 24.04 driver scripts (both standard and precompiled variants)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ubuntu24.04/precompiled/nvidia-driver | Added error handling to cache update and called it before driver installation |
| ubuntu24.04/nvidia-driver | Added error handling to _update_package_cache() function |
| ubuntu22.04/precompiled/nvidia-driver | Added error handling to cache update and called it before driver installation |
| ubuntu22.04/nvidia-driver | Added error handling to _update_package_cache() function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/ok to test b5573b6 |
cdesiniotis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rahulait. I assume this was only affecting the precompiled Ubuntu containers since I see you only added a call to update_package_cache there?
Yeah, others already have the call to update_package_cache in them |
Fixes NVIDIA/gpu-operator#1244
Root cause
Package versions are rotated/updated on mirrors over time. The _install_driver() function in the nvidia-driver script was calling
apt-get installwithout first runningapt-get update. This meant it was using stale package lists that referenced package versions (like python3.10_3.10.12-1~22.04.7) that had been rotated out of the Ubuntu repositories in favor of newer/patched versions. This resulted in 404 errors when fetching those stale packages and install script exited with error.Fix
The fix proposes running
apt-get updatebefore running anyapt install.