yum – List Installed Packages

unix-tutorial

CentOS and RedHat Linux are still the majority of my Linux servers and so now and then I have a RedHat specific question to investigate. This time around, I’ve explored getting the list of installed packages using yum command.

yum list installed

As hard as it may be to believe it, the actual command I needed is this:

[greys@rhel8 ~]$ yum list installed

That’s right – type it word for word and yum will report the full list of packages installed in your system along with package versions and package group names.

Here’s what Red Hat Enterprise Linux 8 beta VM reports:

[greys@rhel8 ~]$ yum list installed | more
Not root, Subscription Management repositories not updated
2018-10-28 13:33:38,137 [WARNING] yum:31323:MainThread @logutil.py:141 - logging already initialized
Not root, Subscription Management repositories not updated
Installed Packages
GConf2.x86_64 3.2.6-22.el8 @rhel-8-for-x86_64-appstream-beta-rpms
ModemManager.x86_64 1.8.0-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
ModemManager-glib.x86_64 1.8.0-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager.x86_64 1:1.14.0-5.el8 @anaconda
NetworkManager-adsl.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-bluetooth.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-libnm.x86_64 1:1.14.0-5.el8 @anaconda
NetworkManager-ovs.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-team.x86_64 1:1.14.0-5.el8 @anaconda
NetworkManager-tui.x86_64 1:1.14.0-5.el8 @anaconda
NetworkManager-wifi.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-wwan.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
PackageKit.x86_64 1.1.10-6.el8 @rhel-8-for-x86_64-appstream-beta-rpms
PackageKit-command-not-found.x86_64 1.1.10-6.el8 @rhel-8-for-x86_64-appstream-beta-rpms
PackageKit-glib.x86_64 1.1.10-6.el8 @rhel-8-for-x86_64-appstream-beta-rpms
PackageKit-gstreamer-plugin.x86_64 1.1.10-6.el8 @rhel-8-for-x86_64-appstream-beta-rpms
PackageKit-gtk3-module.x86_64 1.1.10-6.el8 @rhel-8-for-x86_64-appstream-beta-rpms
abattis-cantarell-fonts.noarch 0.0.25-4.el8 @rhel-8-for-x86_64-appstream-beta-rpms
accountsservice.x86_64 0.6.50-5.el8 @rhel-8-for-x86_64-appstream-beta-rpms
accountsservice-libs.x86_64 0.6.50-5.el8 @rhel-8-for-x86_64-appstream-beta-rpms
acl.x86_64 2.2.53-1.el8 @anaconda
adcli.x86_64 0.8.2-2.el8 @rhel-8-for-x86_64-baseos-beta-rpms
adobe-mappings-cmap.noarch 20171205-3.el8 @rhel-8-for-x86_64-appstream-beta-rpms
adobe-mappings-cmap-deprecated.noarch 20171205-3.el8 @rhel-8-for-x86_64-appstream-beta-rpms
...

Grep yum list installed using group name

The output makes is very easy to grep for packages that belong to the same software group, like rhel-8-for-x86_64-baseos-beta-rpms in this example:

[greys@rhel8 ~]$ yum list installed | grep rhel-8-for-x86_64-baseos-beta-rpms | more
2018-10-28 13:40:14,740 [WARNING] yum:31405:MainThread @logutil.py:141 - logging already initialized
ModemManager.x86_64 1.8.0-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
ModemManager-glib.x86_64 1.8.0-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-adsl.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-bluetooth.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-ovs.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-wifi.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
NetworkManager-wwan.x86_64 1:1.14.0-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
adcli.x86_64 0.8.2-2.el8 @rhel-8-for-x86_64-baseos-beta-rpms
at.x86_64 3.1.20-11.el8 @rhel-8-for-x86_64-baseos-beta-rpms
attr.x86_64 2.4.48-3.el8 @rhel-8-for-x86_64-baseos-beta-rpms
augeas-libs.x86_64 1.10.1-3.el8 @rhel-8-for-x86_64-baseos-beta-rpms
avahi.x86_64 0.7-18.el8 @rhel-8-for-x86_64-baseos-beta-rpms
avahi-glib.x86_64 0.7-18.el8 @rhel-8-for-x86_64-baseos-beta-rpms
avahi-libs.x86_64 0.7-18.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bash-completion.noarch 1:2.7-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bc.x86_64 1.07.1-5.el8 @rhel-8-for-x86_64-baseos-beta-rpms
binutils.x86_64 2.30-49.el8 @rhel-8-for-x86_64-baseos-beta-rpms
blktrace.x86_64 1.2.0-9.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bluez.x86_64 5.50-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bluez-libs.x86_64 5.50-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bluez-obexd.x86_64 5.50-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bolt.x86_64 0.4-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bpftool.x86_64 4.18.0-32.el8 @rhel-8-for-x86_64-baseos-beta-rpms
bubblewrap.x86_64 0.3.0-1.el8 @rhel-8-for-x86_64-baseos-beta-rpms

That’s it for today!

See Also




Time/Date Operations with timedatectl

Screen Shot 2019-05-31 at 15.14.26.png

One of the recently introduced commands in modern Linux distros is timedatectl. It’s a convenient way to review and configure time, date and timezone information. I noticed wrong time on one of my Raspberry Pi systems and used this opportunity to learn how timedatectl is used.

Show Current Time and Date Info with timedatectl

Run the command without any options to see current status:

greys@becky:~ $ timedatectl
Local time: Fri 2019-05-31 14:01:04 UTC
Universal time: Fri 2019-05-31 14:01:04 UTC
RTC time: n/a
Time zone: Etc/UTC (UTC, +0000)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

List Timezones with timedatectl

Run timedatectl list-timezones to see all the available timezones. I used the following command line to confirm timezone for Dublin, Ireland:

greys@becky:~ $ timedatectl list-timezones | grep Europe | head -20
Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Busingen
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey

Change Timezone with timedatectl

Let’s update timezone to Europe/Dublin.

If you try running it as regular user, it won’t work:

greys@becky:~ $ timedatectl set-timezone Europe/Dublin
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-timezone ===
Authentication is required to set the system timezone.
Multiple identities can be used for authentication:
1. ,,, (pi)
2. root
^C

so use sudo command to run it:

greys@becky:~ $ sudo timedatectl set-timezone Europe/Dublin

… and then check status again:

greys@becky:~ $ timedatectl
Local time: Fri 2019-05-31 15:04:33 IST
Universal time: Fri 2019-05-31 14:04:33 UTC
RTC time: n/a
Time zone: Europe/Dublin (IST, +0100)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

Perfect!

See Also

 

 




How To: Install Kernel Source Code in CentOS/RedHat

CentOS-linux-logo

From time to time it’s required to compile some Linux kernel specific software on your CentOS/RedHat Linux system. Most often it’s some kind of kernel module specific to a software that requires deep integration with your operating system.

Install Kernel Sources and Headers in RedHat/CentOS

You need to install two packages: kernel sources from kernel-develop and header files from kernel-headers:

root@centos:~ # yum install kernel-devel kernel-headers
Loaded plugins: fastestmirror, langpacks 
Determining fastest mirrors
epel/x86_64/metalink | 28 kB 00:00:00 
* base: centos.quelquesmots.fr
* epel: mirror.in2p3.fr 
* extras: centos.crazyfrogs.org
* updates: centos.quelquesmots.fr 
base | 3.6 kB 00:00:00 
epel | 4.7 kB 00:00:00 
extras | 3.4 kB 00:00:00 
updates | 3.4 kB 00:00:00 
(1/4): epel/x86_64/updateinfo | 998 kB 00:00:00 
(2/4): extras/7/x86_64/primary_db | 201 kB 00:00:00 
(3/4): updates/7/x86_64/primary_db | 5.0 MB 00:00:00 
(4/4): epel/x86_64/primary_db | 6.7 MB 00:00:00 
Resolving Dependencies 
--> Running transaction check 
---> Package kernel-devel.x86_64 0:3.10.0-957.12.2.el7 will be installed 
---> Package kernel-headers.x86_64 0:3.10.0-957.12.2.el7 will be installed 
--> Finished Dependency Resolution 
Dependencies Resolved 
============================================================================
Package Arch Version Repository Size 
============================================================================
Installing: 
kernel-devel x86_64 3.10.0-957.12.2.el7 updates 17 M 
kernel-headers x86_64 3.10.0-957.12.2.el7 updates 8.0 M 

Transaction Summary
============================================================================
Install 2 Packages

Total download size: 25 M
Installed size: 41 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): kernel-headers-3.10.0-957.12.2.el7.x86_64.rpm | 8.0 MB 00:00:00 
(2/2): kernel-devel-3.10.0-957.12.2.el7.x86_64.rpm | 17 MB 00:00:00 
------------------------------------------------------------------------------------------------------------------------
Total 55 MB/s | 25 MB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : kernel-devel-3.10.0-957.12.2.el7.x86_64 1/2
Installing : kernel-headers-3.10.0-957.12.2.el7.x86_64 2/2 
Verifying : kernel-headers-3.10.0-957.12.2.el7.x86_64 1/2 
Verifying : kernel-devel-3.10.0-957.12.2.el7.x86_64 2/2

Installed:
kernel-devel.x86_64 0:3.10.0-957.12.2.el7 kernel-headers.x86_64 0:3.10.0-957.12.2.el7

Complete!

I just realised that the same packages will most obviously be needed if you ever decide to compile your Linux kernel.

Why Kernel Source is Old Version in Your OS

Most Linux distros lag quite a big behing the latest Linux kernel version: this is expected, because their maintainers need time to download and complile the latest kernel and to also complete the full suite of integratory tests. This is done so that most of key software running in a particular distro will still function. Quite possibly, lots of kernel modules specific to a distro are re-compiled at that stage.

What this means is that your Linux distro will not have the latest branch of Kernel sources (5.1 as of May 2019). In this example today, my CentOS 7.6 system is using and downloading Linux Kernel 3.10.0.

Verify If You Have Kernel Sources Installed

Simply look in the /usr/src/kernels directory: you will at least have the just-installed packages but quite possibly older versions as well:

root@s2:~ # ls /usr/src/kernels/
3.10.0-957.12.2.el7.x86_64
root@s2:~ # ls /usr/src/kernels/3.10.0-957.12.2.el7.x86_64/
arch drivers include Kconfig Makefile Module.symvers scripts System.map virt
block firmware init kernel Makefile.qlock net security tools vmlinux.id
crypto fs ipc lib mm samples sound usr

That’s quite a bit of source codes:

root@s2:~ # du -sh /usr/src/kernels/3.10.0-957.12.2.el7.x86_64
74M /usr/src/kernels/3.10.0-957.12.2.el7.x86_64

See Also

 




Web Console in RHEL8

I’m not a fan of web interfaces for managing Linux systems and usually don’t see them unless a hosting provider preinstalled something. But it seems my default Red Hat Enterprise Linux 8 in a VirtualBox VM got the web console enabled by default.

Accessing Web Console in RHEL8

I see reminder of the web console upon every SSH login into the VM:

Web console: https://rhel8:9090/ or https://192.168.X.Y:9090/

So, connection to the virtual machine’s IP address on port 9090 will open the RHEL8 web console:

Web console in RHEL8

Screenshots of Web Console in RHEL8

Here are just the screenshots of the web panel, it seems most of the common tasks can now be accomplished using the panel – from joining AD domain to managing users, updates, disk storage and subscriptions. Pretty cool!

What do you like most in Red Hat Enterprise Linux 8? Let me know!

See Also




How To: Remove Old Kernels in CentOS

CentOS-linux-logo.pngFor dedicated servers and virtual machines that you keep upgrading in-place, you will eventually reach the situation where there’s a number of old kernel packages installed. That’s because when you’re updating OS packages and get new kernel installed, the old ones are not auto-removed – allowing you to fall back if there are issues with the latest kernel.

How To List Old Kernels in CentOS/Red Hat Linux

rpm -q command comes to the resque! just run it for the kernel packages:

root@centos:~ # rpm -q kernel
kernel-3.10.0-327.28.3.el7.x86_64
kernel-3.10.0-327.36.3.el7.x86_64
kernel-3.10.0-693.21.1.el7.x86_64
kernel-3.10.0-957.5.1.el7.x86_64

You can use the uname command to verify the current kernel you’re running:

root@centos:~ # uname -a
Linux centos.ts.fm 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

How To Remove Old Linux Kernels in CentOS

There’s actually a special command for doing this, but it’s probably not installed by default. It’s part of the yum-utils package that you may have to install like this first:

root@centos:~ # yum install yum-utils

Now that it’s installed, we’ll use the package-cleanup command. It takes the number of most recent kernels that you want to keep. So if you want to keep just the currently used kernel, the number should be 1. I recommend you keep 2 kernels – current and the one before it, so the count should be 2.

Just to be super sure, the package-cleanup -oldkernels command will ask you if you’re positive about removing the listed kernel packages before progressing:

root@centos:~ # package-cleanup --oldkernels --count=2
Loaded plugins: fastestmirror, langpacks
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-327.28.3.el7 will be erased
---> Package kernel.x86_64 0:3.10.0-327.36.3.el7 will be erased
--> Finished Dependency Resolution
epel/x86_64/metalink | 22 kB 00:00:00

Dependencies Resolved

===============================================================
Package Arch Version Repository Size
=============================================================== 
Removing:
kernel x86_64 3.10.0-327.28.3.el7 @centos-updates 136 M
kernel x86_64 3.10.0-327.36.3.el7 @updates 136 M

Transaction Summary
=============================================================== 
Remove 2 Packages

Installed size: 272 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : kernel.x86_64 1/2
Erasing : kernel.x86_64 2/2
Verifying : kernel-3.10.0-327.36.3.el7.x86_64 1/2
Verifying : kernel-3.10.0-327.28.3.el7.x86_64 2/2

Removed:
kernel.x86_64 0:3.10.0-327.28.3.el7 kernel.x86_64 0:3.10.0-327.36.3.el7

Complete!

… and yes, don’t worry to be left without any Linux kernels! I checked, and specifying count=0 will not result in the package-cleanup killing your operating system:

root@centos:~ # package-cleanup --oldkernels --count=0
Loaded plugins: fastestmirror, langpacks
Error should keep at least 1 kernel!

That’s it for today. Hope you enjoyed the article!

See Also




screenFetch in Linux Mint

screenfetch-linux-mint-19-1-xps.png

Great stuff, I have just installed Linux Mint 19.1 on my Dell XPS 13 laptop! Naturally, one of the first things to be run is the screenFetch utility.

Install screenFetch on Linux Mint

Based on Ubuntu Linux, Linux Mint enjoys abundant software repositories, which means it’s super easy to install screenFetch on the new system:

root@xps:~# apt-get install screenfetch
Reading package lists... Done
Building dependency tree 
Reading state information... Done
Recommended packages:
scrot
The following NEW packages will be installed:
screenfetch
0 upgraded, 1 newly installed, 0 to remove and 245 not upgraded.
Need to get 50.6 kB of archives.
After this operation, 236 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 screenfetch all 3.8.0-8 [50.6 kB]
Fetched 50.6 kB in 0s (308 kB/s) 
Selecting previously unselected package screenfetch.
(Reading database ... 249721 files and directories currently installed.)
Preparing to unpack .../screenfetch_3.8.0-8_all.deb ...
Unpacking screenfetch (3.8.0-8) ...
Setting up screenfetch (3.8.0-8) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

screenFetch in Linux Mint 19.1

This is the output of screenFetch on my laptop:

screenfetch-linux-mint-19-1-xps.png

See Also




How To: List Files with SELinux Contexts

Snag_21dc154.png

When running a SELinux based setup, it might be useful to know how to quickly inspect files and directories to confirm their current SELinux context.

What is SELinux Context?

Every process and file in SELinux based environment can be labeled with additional information that helps fulfill RBAC (Role-Based Access Control), TE (Type Enforcement) and MLS (Multi-Level Security).

SELinux context is the combination of such additional information:

  • user
  • role
  • type
  • level

In the following example we can see that unconfined_u is the SELinux user, object_r is the role, user_home_dir_t is the object type (home user directory) and the SELinux sensitivity (MCS terminology) level is s0:

drwx------. 17 greys greys unconfined_u:object_r:user_home_dir_t:s0 4096 Feb 19 12:14 .

Use ls -Z to show SELinux Context

Using ls command with -Z option will show the SELinux contexts. This command line option is totally made to be combined with other ls command options:

[greys@rhel8 ~]$ ls -alZ .
total 64
drwx------. 17 greys greys unconfined_u:object_r:user_home_dir_t:s0 4096 Feb 19 12:14 .
drwxr-xr-x. 3 root root system_u:object_r:home_root_t:s0 19 Jan 15 17:34 ..
-rw-------. 1 greys greys unconfined_u:object_r:user_home_t:s0 2035 Feb 19 12:14 .bash_history
-rw-r--r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 18 Oct 12 17:56 .bash_logout
-rw-r--r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 218 Jan 28 17:42 .bash_profile
-rw-r--r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 312 Oct 12 17:56 .bashrc
drwx------. 12 greys greys unconfined_u:object_r:cache_home_t:s0 4096 Jan 21 06:41 .cache
drwx------. 14 greys greys unconfined_u:object_r:config_home_t:s0 278 Jan 21 06:41 .config
drwx------. 3 greys greys unconfined_u:object_r:dbus_home_t:s0 25 Jan 20 18:28 .dbus
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Desktop
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Documents
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Downloads
-rw-------. 1 greys greys unconfined_u:object_r:pulseaudio_home_t:s0 16 Jan 15 19:15 .esd_auth
-rw-------. 1 greys greys unconfined_u:object_r:iceauth_home_t:s0 1244 Jan 20 18:46 .ICEauthority
-rw-------. 1 greys greys unconfined_u:object_r:user_home_t:s0 3434 Jan 22 18:06 id_rsa_4k
-rw-r--r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 737 Jan 22 18:06 id_rsa_4k.pub
-rw-rw-r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 21 Jan 28 17:53 infile2.txt
-rw-------. 1 greys greys unconfined_u:object_r:user_home_t:s0 38 Jan 22 18:05 .lesshst
drwxr-xr-x. 3 greys greys unconfined_u:object_r:gconf_home_t:s0 19 Jan 20 18:28 .local
drwxr-xr-x. 2 greys greys unconfined_u:object_r:audio_home_t:s0 6 Jan 20 18:28 Music
-rw-rw-r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 0 Jan 22 18:01 newkey
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Pictures
drwxrw----. 3 greys greys unconfined_u:object_r:home_cert_t:s0 19 Jan 20 18:28 .pki
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Public
drwxrwxr-x. 4 greys greys unconfined_u:object_r:user_home_t:s0 165 Jan 16 11:00 screenFetch
-rw-------. 1 greys greys unconfined_u:object_r:xauth_home_t:s0 150 Jan 20 18:44 .serverauth.1859
-rw-------. 1 greys greys unconfined_u:object_r:xauth_home_t:s0 50 Jan 20 18:39 .serverauth.1893
drwx------. 2 greys greys unconfined_u:object_r:ssh_home_t:s0 70 Jan 22 18:07 .ssh
-rw-rw-r--. 1 greys greys unconfined_u:object_r:user_home_t:s0 0 Jan 21 07:49 system_u:object_r:shell_exec_t:s0
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Templates
drwxr-xr-x. 2 greys greys unconfined_u:object_r:user_home_t:s0 6 Jan 20 18:28 Videos
-rw-------. 1 greys greys unconfined_u:object_r:user_home_t:s0 2874 Jan 29 04:40 .viminfo
-rw-------. 1 greys greys unconfined_u:object_r:xauth_home_t:s0 260 Feb 19 12:14 .Xauthority

See Also




List RPM packages sorted by install date

rpm-qa-last.jpg

I had to confirm the most recently installed packages on a Red Hat system recently, and was plesantly surprised that this is a very easy task in Red Hat, Fedora and CentOS Linux systems.

RPM packages sorted by install date

All you need is the –last option for the rpm command.

Here’s how it looks on a CentOS 7.4 server that hasn’t been updated in a month:

root@centos74:~ # rpm -qa --last | more
time-1.7-45.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
ssmtp-2.64-14.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
spax-1.5.2-13.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
redhat-lsb-submod-security-4.1-27.el7.centos.1.x86_64 Mon 10 Dec 2018 12:18:13 GMT
redhat-lsb-core-4.1-27.el7.centos.1.x86_64 Mon 10 Dec 2018 12:18:13 GMT
psmisc-22.20-15.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
patch-2.7.1-10.el7_5.x86_64 Mon 10 Dec 2018 12:18:13 GMT
mailx-12.5-19.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
ed-1.9-4.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
cups-client-1.6.3-35.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
bc-1.06.95-13.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
at-3.1.13-24.el7.x86_64 Mon 10 Dec 2018 12:18:13 GMT
mariadb-5.5.60-1.el7_5.x86_64 Wed 12 Sep 2018 22:22:32 IST
mariadb-libs-5.5.60-1.el7_5.x86_64 Wed 12 Sep 2018 22:22:31 IST
xorg-x11-font-utils-7.5-20.el7.x86_64 Fri 17 Aug 2018 07:44:00 IST
xorg-x11-fonts-Type1-7.5-9.el7.noarch Fri 17 Aug 2018 07:44:00 IST
ttmkfdir-3.0.9-42.el7.x86_64 Fri 17 Aug 2018 07:44:00 IST
libXfont-1.5.2-1.el7.x86_64 Fri 17 Aug 2018 07:44:00 IST
libfontenc-1.1.3-3.el7.x86_64 Fri 17 Aug 2018 07:43:59 IST
xorg-x11-server-utils-7.7-20.el7.x86_64 Thu 16 Aug 2018 18:18:48 IST
libXxf86misc-1.0.3-7.1.el7.x86_64 Thu 16 Aug 2018 18:18:48 IST
libXrandr-1.5.1-2.el7.x86_64 Thu 16 Aug 2018 18:18:48 IST
libXi-1.7.9-1.el7.x86_64 Thu 16 Aug 2018 18:18:48 IST

After I run yum update though, you can run the same command and see that a lot of packages have been updated and showing 03 Fed 2019 as their install date:

root@centos74:~ # rpm -qa --last | more
gcc-c++-4.8.5-36.el7.x86_64 Sun 03 Feb 2019 09:14:56 GMT
unzip-6.0-19.el7.x86_64 Sun 03 Feb 2019 09:14:55 GMT
libstdc++-devel-4.8.5-36.el7.i686 Sun 03 Feb 2019 09:14:55 GMT
libstdc++-4.8.5-36.el7.i686 Sun 03 Feb 2019 09:14:55 GMT
dialog-1.2-5.20130523.el7.x86_64 Sun 03 Feb 2019 09:14:55 GMT
datadog-agent-6.9.0-1.x86_64 Sun 03 Feb 2019 09:14:54 GMT
p7zip-16.02-10.el7.x86_64 Sun 03 Feb 2019 09:14:48 GMT
libicu-50.1.2-17.el7.x86_64 Sun 03 Feb 2019 09:14:48 GMT
iprutils-2.4.16.1-1.el7.x86_64 Sun 03 Feb 2019 09:14:48 GMT
xorg-x11-font-utils-7.5-21.el7.x86_64 Sun 03 Feb 2019 09:14:47 GMT
perl-Pod-Escapes-1.04-294.el7_6.noarch Sun 03 Feb 2019 09:14:47 GMT
libXfont-1.5.4-1.el7.x86_64 Sun 03 Feb 2019 09:14:47 GMT
libstdc++-devel-4.8.5-36.el7.x86_64 Sun 03 Feb 2019 09:14:47 GMT
gdisk-0.8.10-2.el7.x86_64 Sun 03 Feb 2019 09:14:47 GMT
yum-utils-1.1.31-50.el7.noarch Sun 03 Feb 2019 09:14:46 GMT
xfsprogs-4.5.0-18.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT
wget-1.14-18.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT
sudo-1.8.23-3.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT
python-urllib3-1.10.2-5.el7.noarch Sun 03 Feb 2019 09:14:46 GMT
python2-psutil-2.2.1-4.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT
pam_ssh_agent_auth-0.10.3-2.16.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT
man-db-2.6.3-11.el7.x86_64 Sun 03 Feb 2019 09:14:46 GMT

See Also




yum: List and Install Software Groups

yum-group-list.jpg

yum package manager, and dnf package manager in later Red Hat Linux versions, is quite a capable tool. In addition to expertly resolving dependencies when installing and removing individual software packages (RPMs), yum can also be used to manage whole package groups.

List software groups with yum

Here’s how to get a list of available software groups and also get an indication of which groups you already have installed in your RHEL:

[root@rhel8 ~]# yum group list
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:02:40 ago on Tue 29 Jan 2019 18:38:39 EST.
Available Environment Groups:
Custom Operating System
Server
Installed Environment Groups:
Minimal Install
Workstation
Available Groups:
.NET Core Development
RPM Development Tools
Container Management
Smart Card Support
Scientific Support
Security Tools
Development Tools
System Tools
Headless Management
Network Servers
Legacy UNIX Compatibility
Graphical Administration Tools

Install a software group with yum

Simply using the entries from the list in previous section, you can install software groups like shown below.

IMPORTANT: because these are descriptive names and they have multiple words in mostt group’s names, you must use quotes:

[root@rhel8 ~]# yum group install "Development Tools"
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:02:59 ago on Tue 29 Jan 2019 18:38:39 EST.
Dependencies resolved
===========================================================
Package Arch Version Repository Size
===========================================================
Installing group/module packages:
source-highlight x86_64 3.1.8-16.el8 rhel-8-for-x86_64-appstream-beta-rpms 657 k
autoconf noarch 2.69-27.el8 rhel-8-for-x86_64-appstream-beta-rpms 710 k
perl-Fedora-VSP noarch 0.001-9.el8 rhel-8-for-x86_64-appstream-beta-rpms 25 k
patchutils x86_64 0.3.4-10.el8 rhel-8-for-x86_64-appstream-beta-rpms 115 k
libtool x86_64 2.4.6-25.el8 rhel-8-for-x86_64-appstream-beta-rpms 709 k
bison x86_64 3.0.4-10.el8 rhel-8-for-x86_64-appstream-beta-rpms 688 k
flex x86_64 2.6.1-9.el8 rhel-8-for-x86_64-appstream-beta-rpms 320 k
valgrind x86_64 1:3.14.0-1.el8 rhel-8-for-x86_64-appstream-beta-rpms 11 M
pesign x86_64 0.112-25.el8 rhel-8-for-x86_64-appstream-beta-rpms 181 k
gdb x86_64 8.2-3.el8 rhel-8-for-x86_64-appstream-beta-rpms 296 k
ctags x86_64 5.8-22.el8 rhel-8-for-x86_64-appstream-beta-rpms 170 k
ltrace x86_64 0.7.91-27.el8 rhel-8-for-x86_64-appstream-beta-rpms 160 k
systemtap x86_64 4.0-0.20180830git.el8 rhel-8-for-x86_64-appstream-beta-rpms 17 k
perl-generators noarch 1.10-7.el8 rhel-8-for-x86_64-appstream-beta-rpms 18 k
byacc x86_64 1.9.20170709-4.el8 rhel-8-for-x86_64-appstream-beta-rpms 91 k
rpm-build x86_64 4.14.2-4.el8 rhel-8-for-x86_64-appstream-beta-rpms 166 k
asciidoc noarch 8.6.10-0.5.20180627gitf7c2274.el8 rhel-8-for-x86_64-appstream-beta-rpms 216 k
automake noarch 1.16.1-6.el8 rhel-8-for-x86_64-appstream-beta-rpms 713 k
intltool noarch 0.51.0-11.el8 rhel-8-for-x86_64-appstream-beta-rpms 66 k
diffstat x86_64 1.61-7.el8 rhel-8-for-x86_64-appstream-beta-rpms 44 k
make x86_64 1:4.2.1-9.el8 rhel-8-for-x86_64-baseos-beta-rpms 498 k
rpm-sign x86_64 4.14.2-4.el8 rhel-8-for-x86_64-baseos-beta-rpms 74 k
Installing dependencies:
perl-Thread-Queue noarch 3.13-1.el8 rhel-8-for-x86_64-appstream-beta-rpms 24 k
docbook-style-xsl noarch 1.79.2-7.el8 rhel-8-for-x86_64-appstream-beta-rpms 1.6 M
libXaw x86_64 1.0.13-10.el8 rhel-8-for-x86_64-appstream-beta-rpms 194 k
dyninst x86_64 9.3.2-12.el8 rhel-8-for-x86_64-appstream-beta-rpms 3.7 M
gdb-headless x86_64 8.2-3.el8 rhel-8-for-x86_64-appstream-beta-rpms 3.7 M
guile x86_64 5:2.0.14-7.el8 rhel-8-for-x86_64-appstream-beta-rpms 3.5 M
graphviz x86_64 2.40.1-37.el8 rhel-8-for-x86_64-appstream-beta-rpms 1.7 M
systemtap-runtime x86_64 4.0-0.20180830git.el8 rhel-8-for-x86_64-appstream-beta-rpms 461 k
libipt x86_64 1.6.1-8.el8 rhel-8-for-x86_64-appstream-beta-rpms 50 k
perl-XML-Parser x86_64 2.44-10.el8 rhel-8-for-x86_64-appstream-beta-rpms 226 k
libdwarf x86_64 20180129-4.el8 rhel-8-for-x86_64-appstream-beta-rpms 172 k
systemtap-devel x86_64 4.0-0.20180830git.el8 rhel-8-for-x86_64-appstream-beta-rpms 2.1 M
systemtap-client x86_64 4.0-0.20180830git.el8 rhel-8-for-x86_64-appstream-beta-rpms 3.5 M
libatomic_ops x86_64 7.6.2-3.el8 rhel-8-for-x86_64-appstream-beta-rpms 38 k
docbook-dtds noarch 1.0-69.el8 rhel-8-for-x86_64-appstream-beta-rpms 377 k
nss-tools x86_64 3.39.0-1.0.el8 rhel-8-for-x86_64-appstream-beta-rpms 558 k
libbabeltrace x86_64 1.5.4-2.el8 rhel-8-for-x86_64-appstream-beta-rpms 201 k
gc x86_64 7.6.4-3.el8 rhel-8-for-x86_64-appstream-beta-rpms 109 k
xorg-x11-fonts-ISO8859-1-100dpi noarch 7.5-19.el8 rhel-8-for-x86_64-appstream-beta-rpms 1.1 M
elfutils x86_64 0.174-1.el8 rhel-8-for-x86_64-baseos-beta-rpms 340 k
patch x86_64 2.7.6-7.el8 rhel-8-for-x86_64-baseos-beta-rpms 138 k
m4 x86_64 1.4.18-7.el8 rhel-8-for-x86_64-baseos-beta-rpms 223 k
sgml-common noarch 0.6.3-50.el8 rhel-8-for-x86_64-baseos-beta-rpms 62 k
kernel-debug-devel x86_64 4.18.0-32.el8 rhel-8-for-x86_64-baseos-beta-rpms 12 M
gettext-devel x86_64 0.19.8.1-14.el8 rhel-8-for-x86_64-baseos-beta-rpms 331 k
gettext-common-devel noarch 0.19.8.1-14.el8 rhel-8-for-x86_64-baseos-beta-rpms 419 k
mokutil x86_64 1:0.3.0-9.el8 rhel-8-for-x86_64-baseos-beta-rpms 44 k
Installing weak dependencies:
gcc-gdb-plugin x86_64 8.2.1-3.3.el8 rhel-8-for-x86_64-appstream-beta-rpms 115 k

Transaction Summary
===========================================================
Install 50 Packages

Total download size: 53 M
Installed size: 193 M
Is this ok [y/N]:

That’s it for today! Will show you a few more really cool tricks with yum some other time.

See Also

 




List RHEL subscriptions

Screen Shot 2019-01-28 at 22.45.00.pngIf you’re lucky to be working with a recent enough version of Red Hat Enterprise Linux (RHEL) – namely, anything after RHEL 5.7 and RHEL 6.1, then you should know what software subscriptions are and how to list them.

List active subscriptions in Red Hat

subscription-manager is a Linux command in RHEL, you run it with the list option to show what current subscriptions are active for your server.

Here’s how this looks on my recently build RHEL8 beta virtual machine:

[root@rhel8 ~]# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Product ID: 486
Version: 8.0 Beta
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 23/11/18
Ends: 22/11/19

If you attempt running the same command as a regular user, you’ll probably need to authenticate (tell the root password) first:

[greys@rhel8 ~]$ subscription-manager list
You are attempting to run "subscription-manager" which requires administrative
privileges, but more information is needed in order to do so.
Authenticating as "root"
Password:
...

List all the available subscriptions in Red Hat

It may well be that you have multiple subsriptions available as part of your setup – for instance, you might have additional software installed that is maintained and supported by Red Hat, but uses separate subscription channel instead of being supplied with the default OS one.

You can use the same subscription-manager command to list all the available subscriptions:

[root@rhel8 ~]# subscription-manager list --available
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Developer Subscription
Provides: dotNET on RHEL Beta (for RHEL Server)
Red Hat Enterprise Linux for SAP
Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
Red Hat Ansible Engine
RHEL for SAP HANA - Update Services for SAP Solutions
Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
RHEL for SAP HANA - Extended Update Support
Red Hat Container Images Beta
Red Hat Enterprise Linux Atomic Host Beta
Red Hat Container Images
Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Load Balancer (for RHEL Server)
Red Hat Container Development Kit
Red Hat Beta
Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
RHEL for SAP (for IBM Power LE) - Update Services for SAP Solutions
MRG Realtime
Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
dotNET on RHEL (for RHEL Server)
Red Hat Enterprise Linux High Availability - Update Services for SAP Solutions
Oracle Java (for RHEL Server)
Red Hat Enterprise Linux Server - Update Services for SAP Solutions
Red Hat Software Collections (for RHEL Server)
Red Hat Enterprise Linux for ARM 64
Red Hat Enterprise Linux High Availability (for RHEL Server)
Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
Red Hat Enterprise Linux Scalable File System (for RHEL Server)
Red Hat Enterprise Linux for Real Time
Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
RHEL for SAP - Update Services for SAP Solutions
Oracle Java (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux Atomic Host
Red Hat Enterprise Linux Server - Extended Update Support
Red Hat Developer Tools (for RHEL Server)
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Enterprise Linux Server
Red Hat Developer Tools Beta (for RHEL Server)
RHEL for SAP - Extended Update Support
Red Hat Developer Toolset (for RHEL Server)
Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support
Red Hat Enterprise Linux for SAP Hana
Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
SKU: RH00798
Contract:
Pool ID: 8a85f99a65c8c8a1016698f9e87423fe
Provides Management: No
Available: 16
Suggested: 1
Service Level: Self-Support
Service Type:
Subscription Type: Standard
Starts: 21/10/18
Ends: 21/10/19
System Type: Physical

Pretty impressive, isn’t it? Can’t wait to try some of these out, Red Hat Developer Tools, Red Hat Container Images and Red Hat Enterprise Linux High Availability all sound fun!

See Also