Skip to content
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

Please add 'updates' support for RHEL / CentOS systems #3

Open
otherguy opened this issue Dec 7, 2018 · 2 comments
Open

Please add 'updates' support for RHEL / CentOS systems #3

otherguy opened this issue Dec 7, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@otherguy
Copy link
Contributor

otherguy commented Dec 7, 2018

The command to get the number of pending updates on yum based systems is yum check-update --quiet | grep '^[a-Z0-9]' | wc -l. CentOS/RHEL have no apt package manager.

@heyvito
Copy link
Owner

heyvito commented Dec 8, 2018

@otherguy I checked the command on brand-new Fedora installation, and noticed that it checks for updates instead of only listing them. After reading some manpages, I ended up with this command:

yum list updates --cacheonly --noplugins

The problem is that it will only work after initial cache has been built, thus leading to my question to you: Does yum-based distributions automatically update that said cache? Asking because I rarely used another distribution other than Debian on my servers, and I know it periodically updates it.

The point of using this other command, is that howe should return as soon as possible (since we're running as a MOTD), and waiting for yum to download repository information may block for too long.

Any ideas?

@otherguy
Copy link
Contributor Author

otherguy commented Dec 8, 2018

Fair point and fine for my use case. I’m using yum-cron to regularly update that cache. I assume you have something similar for Debian because by default it also doesn’t update the cache periodically (unattended-upgrades or similar).

Personally I also use Debian but at work we have RHEL.

@heyvito heyvito added the enhancement New feature or request label Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants