howe
howe copied to clipboard
Please add 'updates' support for RHEL / CentOS systems
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.
@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?
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.