Check if rpm exists in bash script silently - bash

I'm trying to do a quick check to see if an rpm is installed in a bash script using an if statement. But I want to do it silently. Currently, when I run the script, and the rpm does exist, it outputs the output of rpm to the screen which I dont want.
if rpm -qa | grep glib; then
do something
fi
Maybe there is an option to rpm that I am missing? or if I just need to change my statement?
THanks

There is the interesting --quiet option available for the rpm command. Man page says:
--quiet
Print as little as possible - normally only error messages will
be displayed.
So probably you may like to use this one:
if rpm -q --quiet glib ; then
do something
fi
This way should be faster because it doesn't have to wait a -qa (query all) rpm packages installed but just queries the target rpm package. Of course you have to know the correct name of the package you want to test if is installed or not.
Note: using RPM version 4.9.1.2 on fedora 15

1) You can add -q switch to grep
if rpm -qa | grep -q glib; then
do something
fi
2) You can redirect stout and/or stderr output to /dev/null
if rpm -qa | grep glib 2>&1 > /dev/null; then
do something
fi

You need only -q option actually:
$ rpm -q zabbix-agent
package zabbix-agent is not installed
$ rpm -q curl
curl-7.24.0-5.25.amzn1.x86_64
It will look like:
$ if rpm -q zabbix-agent > /dev/null; then echo "Package zabbix-agent is already installed."; fi
Package zabbix-agent is already installed.

You could do:
[ -z "$(rpm -qa|grep glib)" ] && echo none || echo present
...or, if you prefer:
if [ $(rpm -qa|grep -c glib) -gt 0 ]; then
echo present
else
echo none
fi

You could test if the command returns a string, the command substitution will capture the output:
[[ "$(rpm -qa | grep glib)" ]] && do something

curl_setopt(CurlHandle $handle, int $option, mixed $value): bool

RPM, for whatever reason, doesn't provide a method that accepts a list of package names, and returns a list of those already installed (or the opposite, where it prints any which aren't already installed). Because it likes to print warnings for names which don't match, you can't take the output and feed it directly into another command, without using something like grep to filter the output.
While using grep will work, and is perfectly fine for interactive use cases, its a fragile strategy. And should should be avoided in an automatation/scripted situation. Thtat's because the string you might be looking for, like "is not installed" could be changed by the developers in a future release, or if someone tries to run your script/logic on a system configured to use a different language.
This is a better strategy:
#- echo "glib glib2" | tr ' ' '\n' | while read PKG ; do { rpm --quiet -q "$PKG" && echo "$PKG" ; } ; done
glib2
In my case, I needed a list of already installed QEMU installed, so I could replace them with rebuilt RPMs. And I didn't want to generate a lot of meaningless errors/warnings which might confuse others into thinking there was a problem. So I needed a list of the installed packages, that I could use during an install/removal transaction. The real world result looks like this:
#- echo "qemu-img qemu-kvm qemu-kvm-audio-pa qemu-kvm-block-curl qemu-kvm-block-rbd qemu-kvm-common qemu-kvm-core qemu-kvm-debugsource qemu-kvm-device-display-virtio-gpu qemu-kvm-device-display-virtio-gpu-gl qemu-kvm-device-display-virtio-gpu-pci qemu-kvm-device-display-virtio-gpu-pci-gl qemu-kvm-device-display-virtio-vga qemu-kvm-device-display-virtio-vga-gl qemu-kvm-device-usb-host qemu-kvm-device-usb-redirect qemu-kvm-docs qemu-kvm-tools qemu-kvm-ui-egl-headless qemu-kvm-ui-opengl qemu-pr-helper virtiofsd qemu-kvm-audio-pa-debuginfo qemu-kvm-block-curl-debuginfo qemu-kvm-block-rbd-debuginfo qemu-kvm-block-ssh-debuginfo qemu-kvm-common-debuginfo qemu-kvm-core-debuginfo qemu-kvm-debuginfo qemu-kvm-device-display-virtio-gpu-debuginfo qemu-kvm-device-display-virtio-gpu-gl-debuginfo qemu-kvm-device-display-virtio-gpu-pci-debuginfo qemu-kvm-device-display-virtio-gpu-pci-gl-debuginfo qemu-kvm-device-display-virtio-vga-debuginfo qemu-kvm-device-display-virtio-vga-gl-debuginfo qemu-kvm-device-usb-host-debuginfo qemu-kvm-device-usb-redirect-debuginfo qemu-kvm-tests-debuginfo qemu-kvm-tools-debuginfo qemu-kvm-ui-egl-headless-debuginfo qemu-kvm-ui-opengl-debuginfo qemu-guest-agent-debuginfo qemu-img-debuginfo qemu-pr-helper-debuginfo virtiofsd-debuginfo virtiofsd-debugsource" | tr ' ' '\n' | while read PKG ; do { rpm --quiet -q "$PKG" && echo "$PKG" ; } ; done
qemu-img
qemu-kvm
qemu-kvm-audio-pa
qemu-kvm-block-curl
qemu-kvm-block-rbd
qemu-kvm-common
qemu-kvm-core
qemu-kvm-debugsource
qemu-kvm-device-display-virtio-gpu
qemu-kvm-device-display-virtio-gpu-gl
qemu-kvm-device-display-virtio-gpu-pci
qemu-kvm-device-display-virtio-gpu-pci-gl
qemu-kvm-device-display-virtio-vga
qemu-kvm-device-display-virtio-vga-gl
qemu-kvm-device-usb-host
qemu-kvm-device-usb-redirect
qemu-kvm-docs
qemu-kvm-tools
qemu-kvm-ui-egl-headless
qemu-kvm-ui-opengl
qemu-pr-helper
virtiofsd
The final result for my use case looked something this (the example is using a hard-coded list of RPM file names for simplicity):
#- REMOVEPKGS=$(echo `echo "qemu-img qemu-kvm qemu-kvm-audio-pa qemu-kvm-block-curl qemu-kvm-block-rbd qemu-kvm-common qemu-kvm-core qemu-kvm-debugsource qemu-kvm-device-display-virtio-gpu qemu-kvm-device-display-virtio-gpu-gl qemu-kvm-device-display-virtio-gpu-pci qemu-kvm-device-display-virtio-gpu-pci-gl qemu-kvm-device-display-virtio-vga qemu-kvm-device-display-virtio-vga-gl qemu-kvm-device-usb-host qemu-kvm-device-usb-redirect qemu-kvm-docs qemu-kvm-tools qemu-kvm-ui-egl-headless qemu-kvm-ui-opengl qemu-pr-helper virtiofsd qemu-kvm-audio-pa-debuginfo qemu-kvm-block-curl-debuginfo qemu-kvm-block-rbd-debuginfo qemu-kvm-block-ssh-debuginfo qemu-kvm-common-debuginfo qemu-kvm-core-debuginfo qemu-kvm-debuginfo qemu-kvm-device-display-virtio-gpu-debuginfo qemu-kvm-device-display-virtio-gpu-gl-debuginfo qemu-kvm-device-display-virtio-gpu-pci-debuginfo qemu-kvm-device-display-virtio-gpu-pci-gl-debuginfo qemu-kvm-device-display-virtio-vga-debuginfo qemu-kvm-device-display-virtio-vga-gl-debuginfo qemu-kvm-device-usb-host-debuginfo qemu-kvm-device-usb-redirect-debuginfo qemu-kvm-tests-debuginfo qemu-kvm-tools-debuginfo qemu-kvm-ui-egl-headless-debuginfo qemu-kvm-ui-opengl-debuginfo qemu-guest-agent-debuginfo qemu-img-debuginfo qemu-pr-helper-debuginfo virtiofsd-debuginfo virtiofsd-debugsource" | tr ' ' '\n' | while read PKG ; do { rpm --quiet -q "$PKG" && echo "$PKG" ; } ; done`)
#- INSTALLPKGS="edk2-aarch64-20220826gitba0e0e4c6a17-1.btrh9.noarch.rpm edk2-arm-20220826gitba0e0e4c6a17-1.btrh9.noarch.rpm edk2-ovmf-20220826gitba0e0e4c6a17-1.btrh9.noarch.rpm edk2-tools-20220826gitba0e0e4c6a17-1.btrh9.x86_64.rpm edk2-tools-doc-20220826gitba0e0e4c6a17-1.btrh9.noarch.rpm edk2-tools-python-20220826gitba0e0e4c6a17-1.btrh9.noarch.rpm libcacard-2.8.1-3.btrh9.x86_64.rpm libcacard-devel-2.8.1-3.btrh9.x86_64.rpm lzfse-1.0-1.btrh9.x86_64.rpm lzfse-devel-1.0-1.btrh9.x86_64.rpm lzfse-libs-1.0-1.btrh9.x86_64.rpm mesa-libgbm-devel-21.3.4-2.el9.x86_64.rpm openbios-20200725-5.git7f28286.btrh9.noarch.rpm pcsc-lite-devel-1.9.4-1.el9.x86_64.rpm qemu-7.1.0-3.btrh9.x86_64.rpm qemu-audio-alsa-7.1.0-3.btrh9.x86_64.rpm qemu-audio-dbus-7.1.0-3.btrh9.x86_64.rpm qemu-audio-oss-7.1.0-3.btrh9.x86_64.rpm qemu-audio-pa-7.1.0-3.btrh9.x86_64.rpm qemu-audio-sdl-7.1.0-3.btrh9.x86_64.rpm qemu-audio-spice-7.1.0-3.btrh9.x86_64.rpm qemu-block-curl-7.1.0-3.btrh9.x86_64.rpm qemu-block-dmg-7.1.0-3.btrh9.x86_64.rpm qemu-block-iscsi-7.1.0-3.btrh9.x86_64.rpm qemu-block-rbd-7.1.0-3.btrh9.x86_64.rpm qemu-block-ssh-7.1.0-3.btrh9.x86_64.rpm qemu-char-baum-7.1.0-3.btrh9.x86_64.rpm qemu-char-spice-7.1.0-3.btrh9.x86_64.rpm qemu-common-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-qxl-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-vhost-user-gpu-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-gpu-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-gpu-ccw-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-gpu-gl-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-gpu-pci-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-gpu-pci-gl-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-vga-7.1.0-3.btrh9.x86_64.rpm qemu-device-display-virtio-vga-gl-7.1.0-3.btrh9.x86_64.rpm qemu-device-usb-host-7.1.0-3.btrh9.x86_64.rpm qemu-device-usb-redirect-7.1.0-3.btrh9.x86_64.rpm qemu-device-usb-smartcard-7.1.0-3.btrh9.x86_64.rpm qemu-docs-7.1.0-3.btrh9.x86_64.rpm qemu-guest-agent-7.1.0-3.btrh9.x86_64.rpm qemu-img-7.1.0-3.btrh9.x86_64.rpm qemu-kvm-7.1.0-3.btrh9.x86_64.rpm qemu-kvm-core-7.1.0-3.btrh9.x86_64.rpm qemu-pr-helper-7.1.0-3.btrh9.x86_64.rpm qemu-system-aarch64-7.1.0-3.btrh9.x86_64.rpm qemu-system-aarch64-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-alpha-7.1.0-3.btrh9.x86_64.rpm qemu-system-alpha-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-arm-7.1.0-3.btrh9.x86_64.rpm qemu-system-arm-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-avr-7.1.0-3.btrh9.x86_64.rpm qemu-system-avr-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-cris-7.1.0-3.btrh9.x86_64.rpm qemu-system-cris-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-hppa-7.1.0-3.btrh9.x86_64.rpm qemu-system-hppa-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-loongarch64-7.1.0-3.btrh9.x86_64.rpm qemu-system-loongarch64-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-m68k-7.1.0-3.btrh9.x86_64.rpm qemu-system-m68k-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-microblaze-7.1.0-3.btrh9.x86_64.rpm qemu-system-microblaze-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-mips-7.1.0-3.btrh9.x86_64.rpm qemu-system-mips-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-nios2-7.1.0-3.btrh9.x86_64.rpm qemu-system-nios2-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-or1k-7.1.0-3.btrh9.x86_64.rpm qemu-system-or1k-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-ppc-7.1.0-3.btrh9.x86_64.rpm qemu-system-ppc-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-riscv-7.1.0-3.btrh9.x86_64.rpm qemu-system-riscv-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-rx-7.1.0-3.btrh9.x86_64.rpm qemu-system-rx-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-s390x-7.1.0-3.btrh9.x86_64.rpm qemu-system-s390x-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-sh4-7.1.0-3.btrh9.x86_64.rpm qemu-system-sh4-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-sparc-7.1.0-3.btrh9.x86_64.rpm qemu-system-sparc-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-tricore-7.1.0-3.btrh9.x86_64.rpm qemu-system-tricore-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-x86-7.1.0-3.btrh9.x86_64.rpm qemu-system-x86-core-7.1.0-3.btrh9.x86_64.rpm qemu-system-xtensa-7.1.0-3.btrh9.x86_64.rpm qemu-system-xtensa-core-7.1.0-3.btrh9.x86_64.rpm qemu-tests-7.1.0-3.btrh9.x86_64.rpm qemu-tools-7.1.0-3.btrh9.x86_64.rpm qemu-ui-curses-7.1.0-3.btrh9.x86_64.rpm qemu-ui-dbus-7.1.0-3.btrh9.x86_64.rpm qemu-ui-egl-headless-7.1.0-3.btrh9.x86_64.rpm qemu-ui-gtk-7.1.0-3.btrh9.x86_64.rpm qemu-ui-opengl-7.1.0-3.btrh9.x86_64.rpm qemu-ui-sdl-7.1.0-3.btrh9.x86_64.rpm qemu-ui-spice-app-7.1.0-3.btrh9.x86_64.rpm qemu-ui-spice-core-7.1.0-3.btrh9.x86_64.rpm qemu-user-7.1.0-3.btrh9.x86_64.rpm qemu-user-binfmt-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-aarch64-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-alpha-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-arm-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-cris-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-hexagon-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-hppa-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-loongarch64-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-m68k-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-microblaze-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-mips-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-nios2-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-or1k-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-ppc-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-riscv-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-s390x-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-sh4-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-sparc-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-x86-7.1.0-3.btrh9.x86_64.rpm qemu-user-static-xtensa-7.1.0-3.btrh9.x86_64.rpm qemu-virtiofsd-7.1.0-3.btrh9.x86_64.rpm SDL2_image-2.0.5-6.el9.remi.x86_64.rpm SDL2_image-devel-2.0.5-6.el9.remi.x86_64.rpm SLOF-20210217-5.git33a7322d.btrh9.noarch.rpm spice-glib-0.40-1.btrh9.x86_64.rpm spice-glib-devel-0.40-1.btrh9.x86_64.rpm spice-gtk-0.40-1.btrh9.x86_64.rpm spice-gtk3-0.40-1.btrh9.x86_64.rpm spice-gtk3-devel-0.40-1.btrh9.x86_64.rpm spice-gtk3-vala-0.40-1.btrh9.x86_64.rpm spice-gtk-tools-0.40-1.btrh9.x86_64.rpm spice-server-0.15.0-5.btrh9.x86_64.rpm spice-server-devel-0.15.0-5.btrh9.x86_64.rpm spice-protocol-0.14.4-2.btrh9.noarch.rpm virglrenderer-0.10.1-1.20220912git19dc97a2.btrh9.x86_64.rpm virglrenderer-devel-0.10.1-1.20220912git19dc97a2.btrh9.x86_64.rpm virglrenderer-test-server-0.10.1-1.20220912git19dc97a2.btrh9.x86_64.rpm"
#- bash -c 'dnf shell --assumeyes <(printf "%s\n" "install $INSTALLPKGS" "remove $REMOVEPKGS" "run" "clean all" "exit")'
AlmaLinux 9 - AppStream 3.9 MB/s | 8.6 MB 00:02
AlmaLinux 9 - BaseOS 1.5 MB/s | 4.2 MB 00:02
AlmaLinux 9 - Extras 31 kB/s | 13 kB 00:00
Extra Packages for Enterprise Linux 9 - x86_64 3.6 MB/s | 11 MB 00:03
=======================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================
Installing:
SDL2_image x86_64 2.0.5-6.el9.remi #commandline 82 k
SDL2_image-devel x86_64 2.0.5-6.el9.remi #commandline 11 k
SLOF noarch 20210217-5.git33a7322d.btrh9 #commandline 218 k
edk2-aarch64 noarch 20220826gitba0e0e4c6a17-1.btrh9 #commandline 5.6 M
edk2-arm noarch 20220826gitba0e0e4c6a17-1.btrh9 #commandline 2.8 M
edk2-tools x86_64 20220826gitba0e0e4c6a17-1.btrh9 #commandline 405 k
edk2-tools-doc noarch 20220826gitba0e0e4c6a17-1.btrh9 #commandline 77 k
edk2-tools-python noarch 20220826gitba0e0e4c6a17-1.btrh9 #commandline 1.6 M
libcacard x86_64 3:2.8.1-3.btrh9 #commandline 55 k
libcacard-devel x86_64 3:2.8.1-3.btrh9 #commandline 18 k
lzfse x86_64 1.0-1.btrh9 #commandline 14 k
lzfse-devel x86_64 1.0-1.btrh9 #commandline 8.8 k
lzfse-libs x86_64 1.0-1.btrh9 #commandline 25 k
mesa-libgbm-devel x86_64 21.3.4-2.el9 #commandline 17 k
openbios noarch 1:20200725-5.git7f28286.btrh9 #commandline 303 k
pcsc-lite-devel x86_64 1.9.4-1.el9 #commandline 45 k
qemu x86_64 768:7.1.0-3.btrh9 #commandline 15 k
qemu-audio-alsa x86_64 768:7.1.0-3.btrh9 #commandline 24 k
qemu-audio-dbus x86_64 768:7.1.0-3.btrh9 #commandline 25 k
qemu-audio-oss x86_64 768:7.1.0-3.btrh9 #commandline 23 k
qemu-audio-pa x86_64 768:7.1.0-3.btrh9 #commandline 24 k
qemu-audio-sdl x86_64 768:7.1.0-3.btrh9 #commandline 21 k
qemu-audio-spice x86_64 768:7.1.0-3.btrh9 #commandline 20 k
qemu-block-curl x86_64 768:7.1.0-3.btrh9 #commandline 26 k
qemu-block-dmg x86_64 768:7.1.0-3.btrh9 #commandline 20 k
qemu-block-iscsi x86_64 768:7.1.0-3.btrh9 #commandline 34 k
qemu-block-rbd x86_64 768:7.1.0-3.btrh9 #commandline 30 k
qemu-block-ssh x86_64 768:7.1.0-3.btrh9 #commandline 29 k
qemu-char-baum x86_64 768:7.1.0-3.btrh9 #commandline 23 k
qemu-char-spice x86_64 768:7.1.0-3.btrh9 #commandline 22 k
qemu-common x86_64 768:7.1.0-3.btrh9 #commandline 568 k
qemu-device-display-qxl x86_64 768:7.1.0-3.btrh9 #commandline 43 k
qemu-device-display-vhost-user-gpu x86_64 768:7.1.0-3.btrh9 #commandline 236 k
qemu-device-display-virtio-gpu x86_64 768:7.1.0-3.btrh9 #commandline 37 k
qemu-device-display-virtio-gpu-ccw x86_64 768:7.1.0-3.btrh9 #commandline 19 k
qemu-device-display-virtio-gpu-gl x86_64 768:7.1.0-3.btrh9 #commandline 25 k
qemu-device-display-virtio-gpu-pci x86_64 768:7.1.0-3.btrh9 #commandline 19 k
qemu-device-display-virtio-gpu-pci-gl x86_64 768:7.1.0-3.btrh9 #commandline 18 k
qemu-device-display-virtio-vga x86_64 768:7.1.0-3.btrh9 #commandline 20 k
qemu-device-display-virtio-vga-gl x86_64 768:7.1.0-3.btrh9 #commandline 18 k
qemu-device-usb-host x86_64 768:7.1.0-3.btrh9 #commandline 32 k
qemu-device-usb-redirect x86_64 768:7.1.0-3.btrh9 #commandline 39 k
qemu-device-usb-smartcard x86_64 768:7.1.0-3.btrh9 #commandline 27 k
qemu-docs x86_64 768:7.1.0-3.btrh9 #commandline 1.0 M
qemu-guest-agent x86_64 768:7.1.0-3.btrh9 #commandline 307 k
qemu-system-aarch64 x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-aarch64-core x86_64 768:7.1.0-3.btrh9 #commandline 4.8 M
qemu-system-alpha x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-alpha-core x86_64 768:7.1.0-3.btrh9 #commandline 3.1 M
qemu-system-arm x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-arm-core x86_64 768:7.1.0-3.btrh9 #commandline 4.4 M
qemu-system-avr x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-avr-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-cris x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-cris-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-hppa x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-hppa-core x86_64 768:7.1.0-3.btrh9 #commandline 3.4 M
qemu-system-loongarch64 x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-loongarch64-core x86_64 768:7.1.0-3.btrh9 #commandline 3.2 M
qemu-system-m68k x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-m68k-core x86_64 768:7.1.0-3.btrh9 #commandline 2.6 M
qemu-system-microblaze x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-microblaze-core x86_64 768:7.1.0-3.btrh9 #commandline 2.7 M
qemu-system-mips x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-mips-core x86_64 768:7.1.0-3.btrh9 #commandline 13 M
qemu-system-nios2 x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-nios2-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-or1k x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-or1k-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-ppc x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-ppc-core x86_64 768:7.1.0-3.btrh9 #commandline 8.4 M
qemu-system-riscv x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-riscv-core x86_64 768:7.1.0-3.btrh9 #commandline 6.7 M
qemu-system-rx x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-rx-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-s390x x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-s390x-core x86_64 768:7.1.0-3.btrh9 #commandline 2.8 M
qemu-system-sh4 x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-sh4-core x86_64 768:7.1.0-3.btrh9 #commandline 6.0 M
qemu-system-sparc x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-sparc-core x86_64 768:7.1.0-3.btrh9 #commandline 5.2 M
qemu-system-tricore x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-tricore-core x86_64 768:7.1.0-3.btrh9 #commandline 2.2 M
qemu-system-x86 x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-x86-core x86_64 768:7.1.0-3.btrh9 #commandline 7.2 M
qemu-system-xtensa x86_64 768:7.1.0-3.btrh9 #commandline 16 k
qemu-system-xtensa-core x86_64 768:7.1.0-3.btrh9 #commandline 6.8 M
qemu-tests x86_64 768:7.1.0-3.btrh9 #commandline 652 k
qemu-tools x86_64 768:7.1.0-3.btrh9 #commandline 370 k
qemu-ui-curses x86_64 768:7.1.0-3.btrh9 #commandline 28 k
qemu-ui-dbus x86_64 768:7.1.0-3.btrh9 #commandline 77 k
qemu-ui-egl-headless x86_64 768:7.1.0-3.btrh9 #commandline 20 k
qemu-ui-gtk x86_64 768:7.1.0-3.btrh9 #commandline 43 k
qemu-ui-opengl x86_64 768:7.1.0-3.btrh9 #commandline 25 k
qemu-ui-sdl x86_64 768:7.1.0-3.btrh9 #commandline 30 k
qemu-ui-spice-app x86_64 768:7.1.0-3.btrh9 #commandline 21 k
qemu-ui-spice-core x86_64 768:7.1.0-3.btrh9 #commandline 38 k
<<<SNIPPED>>>>
spice-glib x86_64 0.40-1.btrh9 #commandline 360 k
spice-glib-devel x86_64 0.40-1.btrh9 #commandline 106 k
spice-gtk x86_64 0.40-1.btrh9 #commandline 31 k
spice-gtk-tools x86_64 0.40-1.btrh9 #commandline 40 k
spice-gtk3 x86_64 0.40-1.btrh9 #commandline 65 k
spice-gtk3-devel x86_64 0.40-1.btrh9 #commandline 18 k
spice-gtk3-vala x86_64 0.40-1.btrh9 #commandline 14 k
spice-protocol noarch 0.14.4-2.btrh9 #commandline 30 k
spice-server x86_64 0.15.0-5.btrh9 #commandline 385 k
spice-server-devel x86_64 0.15.0-5.btrh9 #commandline 17 k
virglrenderer x86_64 0.10.1-1.20220912git19dc97a2.btrh9 #commandline 211 k
virglrenderer-devel x86_64 0.10.1-1.20220912git19dc97a2.btrh9 #commandline 13 k
virglrenderer-test-server x86_64 0.10.1-1.20220912git19dc97a2.btrh9 #commandline 27 k
Upgrading:
edk2-ovmf noarch 20220826gitba0e0e4c6a17-1.btrh9 #commandline 10 M
qemu-img x86_64 768:7.1.0-3.btrh9 #commandline 1.8 M
qemu-kvm x86_64 768:7.1.0-3.btrh9 #commandline 14 k
qemu-kvm-core x86_64 768:7.1.0-3.btrh9 #commandline 14 k
qemu-pr-helper x86_64 768:7.1.0-3.btrh9 #commandline 327 k
Removing:
qemu-kvm-audio-pa x86_64 17:6.2.0-11.el9_0.5 #appstream 28 k
qemu-kvm-block-curl x86_64 17:6.2.0-11.el9_0.5 #appstream 40 k
qemu-kvm-block-rbd x86_64 17:6.2.0-11.el9_0.5 #appstream 41 k
qemu-kvm-common x86_64 17:6.2.0-11.el9_0.5 #appstream 1.4 M
qemu-kvm-device-display-virtio-gpu x86_64 17:6.2.0-11.el9_0.5 #appstream 56 k
qemu-kvm-device-display-virtio-gpu-gl x86_64 17:6.2.0-11.el9_0.5 #appstream 15 k
qemu-kvm-device-display-virtio-gpu-pci x86_64 17:6.2.0-11.el9_0.5 #appstream 15 k
qemu-kvm-device-display-virtio-gpu-pci-gl x86_64 17:6.2.0-11.el9_0.5 #appstream 15 k
qemu-kvm-device-display-virtio-vga x86_64 17:6.2.0-11.el9_0.5 #appstream 16 k
qemu-kvm-device-display-virtio-vga-gl x86_64 17:6.2.0-11.el9_0.5 #appstream 15 k
qemu-kvm-device-usb-host x86_64 17:6.2.0-11.el9_0.5 #appstream 54 k
qemu-kvm-device-usb-redirect x86_64 17:6.2.0-11.el9_0.5 #appstream 73 k
qemu-kvm-docs x86_64 17:6.2.0-11.el9_0.5 #appstream 9.7 M
qemu-kvm-tools x86_64 17:6.2.0-11.el9_0.5 #appstream 1.1 M
qemu-kvm-ui-egl-headless x86_64 17:6.2.0-11.el9_0.5 #appstream 15 k
qemu-kvm-ui-opengl x86_64 17:6.2.0-11.el9_0.5 #appstream 32 k
virtiofsd x86_64 1.1.0-4.el9_0 #appstream 1.9 M
Transaction Summary
=======================================================================================================================
Install 133 Packages
Upgrade 5 Packages
Remove 17 Packages
Total size: 171 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : qemu-common-768:7.1.0-3.btrh9.x86_64 1/160
Running scriptlet: qemu-common-768:7.1.0-3.btrh9.x86_64 1/160
Installing : qemu-ui-opengl-768:7.1.0-3.btrh9.x86_64 2/160
<<<<SNIPPED>>>>
Cleanup : qemu-kvm-17:6.2.0-11.el9_0.5.x86_64 139/160
Cleanup : qemu-kvm-core-17:6.2.0-11.el9_0.5.x86_64 140/160
Erasing : qemu-kvm-ui-egl-headless-17:6.2.0-11.el9_0.5.x86_64 141/160
<<<<SNIPPED>>>>
Upgraded:
edk2-ovmf-20220826gitba0e0e4c6a17-1.btrh9.noarch qemu-img-768:7.1.0-3.btrh9.x86_64
qemu-kvm-768:7.1.0-3.btrh9.x86_64 qemu-kvm-core-768:7.1.0-3.btrh9.x86_64
qemu-pr-helper-768:7.1.0-3.btrh9.x86_64
Installed:
qemu-768:7.1.0-3.btrh9.x86_64
qemu-audio-alsa-768:7.1.0-3.btrh9.x86_64
qemu-audio-dbus-768:7.1.0-3.btrh9.x86_64
<<<SNIPPED>>>>
Removed:
qemu-kvm-audio-pa-17:6.2.0-11.el9_0.5.x86_64
qemu-kvm-block-curl-17:6.2.0-11.el9_0.5.x86_64
qemu-kvm-block-rbd-17:6.2.0-11.el9_0.5.x86_64
<<<<SNIPPED>>>>
Complete!
Last metadata expiration check: 0:00:18 ago on Wed 19 Oct 2022 08:59:40 AM UTC.
34 files removed
Leaving Shell
Snipped to stay within character limit.

Related

Execute command on each line in a file

I have a list of ids in one file that I want to use to grep their information from a second file. I can only get my output to show only the information for the last id and I think I just can't figure out how to tweak my code a bit so that it outputs the info for each line, not the last one only.
my command:
for i in $(cat my_ids.txt);
do
for name in $i;
do
class=$(grep -A 25 $name id_info.txt | grep -E "tf_class");
family=$(grep -A 25 $name id_info.txt | grep -E "tf_family");
echo -e "$name\n\class\n\family";
done
done
I only get the last id's information lines that I need. I need it to show up for each ID and I don't know how else to tweak this. I also tried removing the second for loop but it was giving the exact same output.
Sample input from my_ids.txt:
MA0052.4
MA0602.1
MA0497.1
MA0786.1
MA0515.1
Sample input from id_info.txt
AC MA0052.4
XX
ID MEF2A
XX
DE MA0052.4 MEF2A ; From JASPAR
PO A C G T
01 5075.0 2119.0 3651.0 5317.0
02 4033.0 1960.0 4493.0 5676.0
03 1984.0 10919.0 1007.0 2252.0
04 627.0 2974.0 236.0 12325.0
05 12437.0 1013.0 1066.0 1646.0
06 13132.0 253.0 610.0 2167.0
07 14680.0 141.0 506.0 835.0
08 14453.0 231.0 241.0 1237.0
09 14956.0 173.0 202.0 831.0
10 441.0 349.0 215.0 15157.0
11 15582.0 50.0 422.0 108.0
12 2566.0 1060.0 11104.0 1432.0
13 7709.0 4039.0 1605.0 2809.0
14 6171.0 3523.0 1810.0 4658.0
15 5254.0 3812.0 2479.0 4617.0
XX
CC tax_group:vertebrates
CC tf_family:Regulators of differentiation
CC tf_class:MADS box factors
CC pubmed_ids:25217591
CC uniprot_ids:Q02078
CC data_type:ChIP-seq
AC MA0602.1
XX
ID Arid5a
XX
DE MA0602.1 Arid5a ; From JASPAR
PO A C G T
01 18.0 43.0 23.0 17.0
02 16.0 32.0 3.0 48.0
03 85.0 3.0 7.0 5.0
04 96.0 0.0 1.0 2.0
05 6.0 0.0 1.0 93.0
06 93.0 1.0 1.0 6.0
07 2.0 1.0 1.0 96.0
08 4.0 9.0 4.0 83.0
09 23.0 3.0 52.0 22.0
10 34.0 35.0 18.0 12.0
11 29.0 13.0 27.0 31.0
12 57.0 8.0 19.0 16.0
13 29.0 18.0 26.0 27.0
14 34.0 23.0 15.0 27.0
XX
CC tax_group:vertebrates
CC tf_family:ARID-related
CC tf_class:ARID
CC pubmed_ids:25215497
CC uniprot_ids:Q3U108
CC data_type:PBM
XX
AC MA0497.1
XX
ID MEF2C
XX
DE MA0497.1 MEF2C ; From JASPAR
PO A C G T
01 705.0 321.0 676.0 507.0
02 733.0 151.0 573.0 752.0
03 431.0 196.0 822.0 760.0
04 382.0 1412.0 78.0 337.0
05 0.0 985.0 0.0 1224.0
06 1616.0 256.0 74.0 263.0
07 1706.0 32.0 241.0 230.0
08 2107.0 0.0 87.0 15.0
09 2131.0 0.0 2.0 76.0
10 2135.0 0.0 4.0 70.0
11 56.0 62.0 0.0 2091.0
12 2177.0 0.0 32.0 0.0
13 389.0 120.0 1671.0 29.0
14 975.0 836.0 148.0 250.0
15 1009.0 450.0 126.0 624.0
XX
CC tax_group:vertebrates
CC tf_family:Regulators of differentiation
CC tf_class:MADS box factors
CC pubmed_ids:7559475
CC uniprot_ids:Q06413
CC data_type:ChIP-seq
XX
AC MA0786.1
XX
ID POU3F1
XX
DE MA0786.1 POU3F1 ; From JASPAR
PO A C G T
01 1034.0 126.0 322.0 1437.0
02 505.0 186.0 128.0 2471.0
03 2471.0 7.0 26.0 21.0
04 44.0 53.0 21.0 2471.0
05 37.0 13.0 2471.0 232.0
06 170.0 2471.0 413.0 1119.0
07 1423.0 1.0 21.0 1048.0
08 2471.0 103.0 130.0 284.0
09 2471.0 20.0 25.0 63.0
10 259.0 95.0 128.0 2471.0
11 382.0 302.0 620.0 1167.0
12 1510.0 478.0 452.0 961.0
XX
CC tax_group:vertebrates
CC tf_family:POU domain factors
CC tf_class:Homeo domain factors
CC pubmed_ids:1361172
CC uniprot_ids:Q03052
CC data_type:HT-SELEX
XX
AC MA0515.1
XX
ID Sox6
XX
DE MA0515.1 Sox6 ; From JASPAR
PO A C G T
01 4.0 139.0 50.0 56.0
02 0.0 221.0 0.0 28.0
03 161.0 0.0 0.0 88.0
04 0.0 0.0 0.0 249.0
05 0.0 0.0 0.0 249.0
06 0.0 0.0 249.0 0.0
07 0.0 0.0 0.0 249.0
08 0.0 115.0 5.0 129.0
09 4.0 112.0 0.0 133.0
10 14.0 76.0 31.0 128.0
XX
CC tax_group:vertebrates
CC tf_family:SOX-related factors
CC tf_class:High-mobility group (HMG) domain factors
CC pubmed_ids:21985497
CC uniprot_ids:P40645
CC data_type:ChIP-seq
XX
Example of the output I get when I run this as a bash script:
MA0052.4
MA0602.1
MA0497.1
MA0786.1
MA0515.1 CC tf_class:High-mobility group (HMG) domain factors CC tf_family:SOX-related factors
Desired output:
MA0602.1 CC ARID CC ARID-related
MA0497.1 CC MADS box factors CC Regulators of differentiation
MA0786.1 CC Homeo domain factors CC POU domain factors
MA0515.1 CC tf_class:High-mobility group (HMG) domain factors CC tf_family:SOX-related factors
Another code snippet I tried but the output just gives me id names and nothing more; probably because I am messing up the syntax somehow (ran this in terminal):
while IFS= read -r line; do class=$(grep -A 25 $line id_infoc.txt | grep -E "tf_class"); family=$(grep -A 25 $line id_info.txt | grep -E "tf_family"); echo -e "$line\n\class\n\family"; done < my_ids.txt
Try this script:
#! /usr/bin/env bash
while read -r id; do
name="$id"
class=$( grep -A 25 "$name" id_info.txt | grep -E "tf_class")
family=$(grep -A 25 "$name" id_info.txt | grep -E "tf_family")
echo -e "${name}\n${class}\n${family}"
done <"my_ids.txt"
Ignoring style, the bug in your code is that you use \family and \class instead of $family and $class.
Invoking grep multiple times as you do will be a bit inefficient if the file is large and there are many ids to check.
A straightforward solution in awk that only needs to read each file once might be:
awk '
function do_print () {
if (name in ids)
printf("%s\n%s\n%s\n",name,class,family)
name=family=class=""
}
# read ids into an array
NR==FNR { ids[$0]; next }
# start of a section
/^AC / { do_print(); name=$2; next }
# other candidate values found
/^CC tf_family:/ { family=$0; next }
/^CC tf_class:/ { class=$0; next }
# maybe print final section
END { do_print() }
' my_ids.txt id_info.txt
To filter out the tf_family:,etc, the regexes can be replaced by sub:
sub(/^CC tf_family:/,"CC ") { family=$0; next }
sub(/^CC tf_class:/,"CC ") { class=$0; next }

Install CentOS Web Panel (CWP) on CentOS 8

This is a fresh install of CentOS 8 on a dedicated server with dual Xenon (20 cores) and 24GB of RAM. There are no other things installed, so CWP is the first thing to go on there. There are a couple of bugs with the install that we need to resolve to get CWP to install on CentOS 8.
# sh cwp-el7-latest
CentOS Web Panel repo for Linux 7 - x86_64 10 kB/s | 2.9 kB 00:00
MariaDB 2.6 kB/s | 2.9 kB 00:01
Package epel-release-8-7.el8.noarch is already installed.
Package wget-1.19.5-7.el8_0.1.x86_64 is already installed.
Package screen-4.6.2-10.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
dnf makecache: error: argument timer: invalid choice: 'fast' (choose from 'timer')
Last metadata expiration check: 0:00:01 ago on Sat 23 Nov 2019 03:22:59 PM EST.
No match for argument: MariaDB
* Maybe you meant: mariadb
No match for argument: MariaDB-server
* Maybe you meant: mariadb-server
Error: Unable to find a match
Last metadata expiration check: 0:00:02 ago on Sat 23 Nov 2019 03:22:59 PM EST.
No match for argument: cpulimit
No match for argument: links
Error: Unable to find a match
Last metadata expiration check: 0:00:02 ago on Sat 23 Nov 2019 03:22:59 PM EST.
... (already installed items)
No match for argument: perl-Crypt-SSLeay
Error: Unable to find a match
No match for argument: exim
No match for argument: sendmail
Dependencies resolved.
...
Complete!
Last metadata expiration check: 0:00:27 ago on Sat 23 Nov 2019 03:22:59 PM EST.
No match for argument: dovecot-pigeonhole
Error: Unable to find a match
cwp-el7-latest: line 158: mysql: command not found
cwp-el7-latest: line 159: mysql: command not found
PREPARING THE SERVER
##########################
setenforce: SELinux is disabled
#############################################
Please wait... installing web server files...
#############################################
Last metadata expiration check: 0:00:48 ago on Sat 23 Nov 2019 03:22:59 PM EST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
cwp-httpd x86_64 2.4.39-3 cwp 5.5 M
apr-util x86_64 1.6.0-1 cwp 103 k
apr x86_64 1.6.2-1 cwp 228 k
Installing dependencies:
compat-openssl10 x86_64 1:1.0.2o-3.el8 AppStream 1.1 M
dwz x86_64 0.12-9.el8 AppStream 109 k
efi-srpm-macros noarch 3-2.el8 AppStream 22 k
ghc-srpm-macros noarch 1.4.2-7.el8 AppStream 9.3 k
go-srpm-macros noarch 2-16.el8 AppStream 14 k
libpq x86_64 10.5-1.el8 AppStream 188 k
ocaml-srpm-macros noarch 5-4.el8 AppStream 9.4 k
openblas-srpm-macros noarch 2-2.el8 AppStream 7.9 k
perl x86_64 4:5.26.3-416.el8 AppStream 72 k
perl-Algorithm-Diff noarch 1.1903-9.el8 AppStream 52 k
perl-Archive-Tar noarch 2.30-1.el8 AppStream 79 k
perl-Archive-Zip noarch 1.60-3.el8 AppStream 108 k
perl-Attribute-Handlers noarch 0.99-416.el8 AppStream 88 k
perl-B-Debug noarch 1.26-2.el8 AppStream 26 k
perl-CPAN noarch 2.18-397.el8 AppStream 554 k
perl-CPAN-Meta noarch 2.150010-396.el8 AppStream 191 k
perl-CPAN-Meta-Requirements noarch 2.140-396.el8 AppStream 37 k
perl-CPAN-Meta-YAML noarch 0.018-397.el8 AppStream 34 k
perl-Compress-Bzip2 x86_64 2.26-6.el8 AppStream 72 k
perl-Compress-Raw-Bzip2 x86_64 2.081-1.el8 AppStream 40 k
perl-Compress-Raw-Zlib x86_64 2.081-1.el8 AppStream 68 k
perl-Config-Perl-V noarch 0.30-1.el8 AppStream 22 k
perl-DB_File x86_64 1.842-1.el8 AppStream 83 k
perl-Data-OptList noarch 0.110-6.el8 AppStream 31 k
perl-Data-Section noarch 0.200007-3.el8 AppStream 30 k
perl-Devel-PPPort x86_64 3.36-5.el8 AppStream 118 k
perl-Devel-Peek x86_64 1.26-416.el8 AppStream 93 k
perl-Devel-SelfStubber noarch 1.06-416.el8 AppStream 75 k
perl-Devel-Size x86_64 0.81-2.el8 AppStream 34 k
perl-Digest noarch 1.17-395.el8 AppStream 27 k
perl-Digest-MD5 x86_64 2.55-396.el8 AppStream 37 k
perl-Digest-SHA x86_64 1:6.02-1.el8 AppStream 66 k
perl-Encode-devel x86_64 4:2.97-3.el8 AppStream 39 k
perl-Env noarch 1.04-395.el8 AppStream 21 k
perl-ExtUtils-CBuilder noarch 1:0.280230-2.el8 AppStream 48 k
perl-ExtUtils-Command noarch 1:7.34-1.el8 AppStream 19 k
perl-ExtUtils-Embed noarch 1.34-416.el8 AppStream 79 k
perl-ExtUtils-Install noarch 2.14-4.el8 AppStream 46 k
perl-ExtUtils-MM-Utils noarch 1:7.34-1.el8 AppStream 17 k
perl-ExtUtils-MakeMaker noarch 1:7.34-1.el8 AppStream 300 k
perl-ExtUtils-Manifest noarch 1.70-395.el8 AppStream 37 k
perl-ExtUtils-Miniperl noarch 1.06-416.el8 AppStream 76 k
perl-ExtUtils-ParseXS noarch 1:3.35-2.el8 AppStream 83 k
perl-File-Fetch noarch 0.56-2.el8 AppStream 33 k
perl-File-HomeDir noarch 1.002-4.el8 AppStream 61 k
perl-File-Which noarch 1.22-2.el8 AppStream 23 k
perl-Filter x86_64 2:1.58-2.el8 AppStream 82 k
perl-Filter-Simple noarch 0.94-2.el8 AppStream 29 k
perl-IO-Compress noarch 2.081-1.el8 AppStream 258 k
perl-IO-Socket-IP noarch 0.39-5.el8 AppStream 47 k
perl-IO-Zlib noarch 1:1.10-416.el8 AppStream 80 k
perl-IPC-Cmd noarch 2:1.02-1.el8 AppStream 43 k
perl-IPC-SysV x86_64 2.07-397.el8 AppStream 43 k
perl-IPC-System-Simple noarch 1.25-17.el8 AppStream 43 k
perl-JSON-PP noarch 1:2.97.001-3.el8 AppStream 68 k
perl-Locale-Codes noarch 3.57-1.el8 AppStream 311 k
perl-Locale-Maketext noarch 1.28-396.el8 AppStream 99 k
perl-Locale-Maketext-Simple noarch 1:0.21-416.el8 AppStream 78 k
perl-MRO-Compat noarch 0.13-4.el8 AppStream 24 k
perl-Math-BigInt-FastCalc x86_64 0.500.600-6.el8 AppStream 27 k
perl-Math-BigRat noarch 0.2614-1.el8 AppStream 40 k
perl-Memoize noarch 1.03-416.el8 AppStream 118 k
perl-Module-Build noarch 2:0.42.24-5.el8 AppStream 273 k
perl-Module-CoreList noarch 1:5.20181130-1.el8 AppStream 87 k
perl-Module-CoreList-tools noarch 1:5.20181130-1.el8 AppStream 22 k
perl-Module-Load noarch 1:0.32-395.el8 AppStream 19 k
perl-Module-Load-Conditional noarch 0.68-395.el8 AppStream 24 k
perl-Module-Loaded noarch 1:0.08-416.el8 AppStream 74 k
perl-Module-Metadata noarch 1.000033-395.el8 AppStream 44 k
perl-Net-Ping noarch 2.55-416.el8 AppStream 101 k
perl-Net-SSLeay x86_64 1.85-6.el8 AppStream 358 k
perl-Package-Generator noarch 1.106-11.el8 AppStream 27 k
perl-Params-Check noarch 1:0.38-395.el8 AppStream 24 k
perl-Params-Util x86_64 1.07-22.el8 AppStream 44 k
perl-Perl-OSType noarch 1.010-396.el8 AppStream 29 k
perl-PerlIO-via-QuotedPrint noarch 0.08-395.el8 AppStream 13 k
perl-Pod-Checker noarch 4:1.73-395.el8 AppStream 33 k
perl-Pod-Html noarch 1.22.02-416.el8 AppStream 87 k
perl-Pod-Parser noarch 1.63-396.el8 AppStream 108 k
perl-SelfLoader noarch 1.23-416.el8 AppStream 82 k
perl-Software-License noarch 0.103013-2.el8 AppStream 138 k
perl-Sub-Exporter noarch 0.987-15.el8 AppStream 73 k
perl-Sub-Install noarch 0.928-14.el8 AppStream 27 k
perl-Sys-Syslog x86_64 0.35-397.el8 AppStream 50 k
perl-Test noarch 1.30-416.el8 AppStream 89 k
perl-Test-Harness noarch 1:3.42-1.el8 AppStream 279 k
perl-Test-Simple noarch 1:1.302135-1.el8 AppStream 516 k
perl-Text-Balanced noarch 2.03-395.el8 AppStream 58 k
perl-Text-Diff noarch 1.45-2.el8 AppStream 45 k
perl-Text-Glob noarch 0.11-4.el8 AppStream 17 k
perl-Text-Template noarch 1.51-1.el8 AppStream 64 k
perl-Thread-Queue noarch 3.13-1.el8 AppStream 24 k
perl-Time-HiRes x86_64 1.9758-1.el8 AppStream 61 k
perl-Time-Piece x86_64 1.31-416.el8 AppStream 98 k
perl-URI noarch 1.73-3.el8 AppStream 116 k
perl-Unicode-Collate x86_64 1.25-2.el8 AppStream 686 k
perl-autodie noarch 2.29-396.el8 AppStream 98 k
perl-bignum noarch 0.49-2.el8 AppStream 44 k
perl-devel x86_64 4:5.26.3-416.el8 AppStream 599 k
perl-encoding x86_64 4:2.22-3.el8 AppStream 68 k
perl-experimental noarch 0.019-2.el8 AppStream 24 k
perl-inc-latest noarch 2:0.500-9.el8 AppStream 25 k
perl-libnet noarch 3.11-3.el8 AppStream 121 k
perl-libnetcfg noarch 4:5.26.3-416.el8 AppStream 77 k
perl-local-lib noarch 2.000024-2.el8 AppStream 74 k
perl-open noarch 1.11-416.el8 AppStream 77 k
perl-perlfaq noarch 5.20180605-1.el8 AppStream 386 k
perl-srpm-macros noarch 1-25.el8 AppStream 11 k
perl-utils noarch 5.26.3-416.el8 AppStream 128 k
perl-version x86_64 6:0.99.24-1.el8 AppStream 67 k
python-srpm-macros noarch 3-37.el8 AppStream 14 k
python3-rpm-macros noarch 3-37.el8 AppStream 13 k
qt5-srpm-macros noarch 5.11.1-2.el8 AppStream 11 k
redhat-rpm-config noarch 116-1.el8.0.1 AppStream 82 k
rust-srpm-macros noarch 5-2.el8 AppStream 9.2 k
systemtap-sdt-devel x86_64 4.0-7.el8 AppStream 79 k
make x86_64 1:4.2.1-9.el8 BaseOS 498 k
perl-Carp noarch 1.42-396.el8 BaseOS 30 k
perl-Data-Dumper x86_64 2.167-399.el8 BaseOS 58 k
perl-Encode x86_64 4:2.97-3.el8 BaseOS 1.5 M
perl-Errno x86_64 1.28-416.el8 BaseOS 76 k
perl-Exporter noarch 5.72-396.el8 BaseOS 34 k
perl-File-Path noarch 2.15-2.el8 BaseOS 38 k
perl-File-Temp noarch 0.230.600-1.el8 BaseOS 63 k
perl-Getopt-Long noarch 1:2.50-4.el8 BaseOS 63 k
perl-HTTP-Tiny noarch 0.074-1.el8 BaseOS 58 k
perl-IO x86_64 1.38-416.el8 BaseOS 141 k
perl-MIME-Base64 x86_64 3.15-396.el8 BaseOS 31 k
perl-Math-BigInt noarch 1:1.9998.11-5.el8 BaseOS 195 k
perl-Math-Complex noarch 1.59-416.el8 BaseOS 108 k
perl-PathTools x86_64 3.74-1.el8 BaseOS 90 k
perl-Pod-Escapes noarch 1:1.07-395.el8 BaseOS 20 k
perl-Pod-Perldoc noarch 3.28-396.el8 BaseOS 86 k
perl-Pod-Simple noarch 1:3.35-395.el8 BaseOS 213 k
perl-Pod-Usage noarch 4:1.69-395.el8 BaseOS 34 k
perl-Scalar-List-Utils x86_64 3:1.49-2.el8 BaseOS 68 k
perl-Socket x86_64 4:2.027-2.el8 BaseOS 59 k
perl-Storable x86_64 1:3.11-3.el8 BaseOS 98 k
perl-Term-ANSIColor noarch 4.06-396.el8 BaseOS 46 k
perl-Term-Cap noarch 1.17-395.el8 BaseOS 23 k
perl-Text-ParseWords noarch 3.30-395.el8 BaseOS 18 k
perl-Text-Tabs+Wrap noarch 2013.0523-395.el8 BaseOS 24 k
perl-Time-Local noarch 1:1.280-1.el8 BaseOS 34 k
perl-Unicode-Normalize x86_64 1.25-396.el8 BaseOS 82 k
perl-constant noarch 1.33-396.el8 BaseOS 25 k
perl-interpreter x86_64 4:5.26.3-416.el8 BaseOS 6.3 M
perl-libs x86_64 4:5.26.3-416.el8 BaseOS 1.6 M
perl-macros x86_64 4:5.26.3-416.el8 BaseOS 72 k
perl-parent noarch 1:0.237-1.el8 BaseOS 20 k
perl-podlators noarch 4.11-1.el8 BaseOS 118 k
perl-threads x86_64 1:2.21-2.el8 BaseOS 61 k
perl-threads-shared x86_64 1.58-2.el8 BaseOS 48 k
python3-pyparsing noarch 2.1.10-7.el8 BaseOS 142 k
Installing weak dependencies:
perl-Encode-Locale noarch 1.05-9.el8 AppStream 21 k
perl-IO-Socket-SSL noarch 2.060-2.el8 AppStream 289 k
perl-Mozilla-CA noarch 20160104-7.el8 AppStream 15 k
perl-TermReadKey x86_64 2.37-7.el8 AppStream 40 k
Transaction Summary
================================================================================
Install 160 Packages
Total download size: 30 M
Installed size: 95 M
Downloading Packages:
(1/160): apr-util-1.6.0-1.x86_64.rpm 148 kB/s | 103 kB 00:00
... (removed for space limitations on stackoverflow)
(160/160): perl-interpreter-5.26.3-416.el8.x86_ 7.6 MB/s | 6.3 MB 00:00
--------------------------------------------------------------------------------
Total 5.6 MB/s | 30 MB 00:05
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : perl-Exporter-5.72-396.el8.noarch 1/160
... (removed for space limitations on stackoverflow)
Installing : perl-4:5.26.3-416.el8.x86_64 159/160
Running scriptlet: cwp-httpd-2.4.39-3.x86_64 160/160
Installing : cwp-httpd-2.4.39-3.x86_64 160/160
Running scriptlet: cwp-httpd-2.4.39-3.x86_64 160/160
Verifying : cwp-httpd-2.4.39-3.x86_64 1/160
... (removed for space limitations on stackoverflow)
Verifying : python3-pyparsing-2.1.10-7.el8.noarch 160/160
Installed:
cwp-httpd-2.4.39-3.x86_64
apr-util-1.6.0-1.x86_64
apr-1.6.2-1.x86_64
perl-Encode-Locale-1.05-9.el8.noarch
perl-IO-Socket-SSL-2.060-2.el8.noarch
perl-Mozilla-CA-20160104-7.el8.noarch
perl-TermReadKey-2.37-7.el8.x86_64
compat-openssl10-1:1.0.2o-3.el8.x86_64
dwz-0.12-9.el8.x86_64
efi-srpm-macros-3-2.el8.noarch
ghc-srpm-macros-1.4.2-7.el8.noarch
go-srpm-macros-2-16.el8.noarch
libpq-10.5-1.el8.x86_64
ocaml-srpm-macros-5-4.el8.noarch
openblas-srpm-macros-2-2.el8.noarch
perl-4:5.26.3-416.el8.x86_64
perl-Algorithm-Diff-1.1903-9.el8.noarch
perl-Archive-Tar-2.30-1.el8.noarch
perl-Archive-Zip-1.60-3.el8.noarch
perl-Attribute-Handlers-0.99-416.el8.noarch
perl-B-Debug-1.26-2.el8.noarch
perl-CPAN-2.18-397.el8.noarch
perl-CPAN-Meta-2.150010-396.el8.noarch
perl-CPAN-Meta-Requirements-2.140-396.el8.noarch
perl-CPAN-Meta-YAML-0.018-397.el8.noarch
perl-Compress-Bzip2-2.26-6.el8.x86_64
perl-Compress-Raw-Bzip2-2.081-1.el8.x86_64
perl-Compress-Raw-Zlib-2.081-1.el8.x86_64
perl-Config-Perl-V-0.30-1.el8.noarch
perl-DB_File-1.842-1.el8.x86_64
perl-Data-OptList-0.110-6.el8.noarch
perl-Data-Section-0.200007-3.el8.noarch
perl-Devel-PPPort-3.36-5.el8.x86_64
perl-Devel-Peek-1.26-416.el8.x86_64
perl-Devel-SelfStubber-1.06-416.el8.noarch
perl-Devel-Size-0.81-2.el8.x86_64
perl-Digest-1.17-395.el8.noarch
perl-Digest-MD5-2.55-396.el8.x86_64
perl-Digest-SHA-1:6.02-1.el8.x86_64
perl-Encode-devel-4:2.97-3.el8.x86_64
perl-Env-1.04-395.el8.noarch
perl-ExtUtils-CBuilder-1:0.280230-2.el8.noarch
perl-ExtUtils-Command-1:7.34-1.el8.noarch
perl-ExtUtils-Embed-1.34-416.el8.noarch
perl-ExtUtils-Install-2.14-4.el8.noarch
perl-ExtUtils-MM-Utils-1:7.34-1.el8.noarch
perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch
perl-ExtUtils-Manifest-1.70-395.el8.noarch
perl-ExtUtils-Miniperl-1.06-416.el8.noarch
perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch
perl-File-Fetch-0.56-2.el8.noarch
perl-File-HomeDir-1.002-4.el8.noarch
perl-File-Which-1.22-2.el8.noarch
perl-Filter-2:1.58-2.el8.x86_64
perl-Filter-Simple-0.94-2.el8.noarch
perl-IO-Compress-2.081-1.el8.noarch
perl-IO-Socket-IP-0.39-5.el8.noarch
perl-IO-Zlib-1:1.10-416.el8.noarch
perl-IPC-Cmd-2:1.02-1.el8.noarch
perl-IPC-SysV-2.07-397.el8.x86_64
perl-IPC-System-Simple-1.25-17.el8.noarch
perl-JSON-PP-1:2.97.001-3.el8.noarch
perl-Locale-Codes-3.57-1.el8.noarch
perl-Locale-Maketext-1.28-396.el8.noarch
perl-Locale-Maketext-Simple-1:0.21-416.el8.noarch
perl-MRO-Compat-0.13-4.el8.noarch
perl-Math-BigInt-FastCalc-0.500.600-6.el8.x86_64
perl-Math-BigRat-0.2614-1.el8.noarch
perl-Memoize-1.03-416.el8.noarch
perl-Module-Build-2:0.42.24-5.el8.noarch
perl-Module-CoreList-1:5.20181130-1.el8.noarch
perl-Module-CoreList-tools-1:5.20181130-1.el8.noarch
perl-Module-Load-1:0.32-395.el8.noarch
perl-Module-Load-Conditional-0.68-395.el8.noarch
perl-Module-Loaded-1:0.08-416.el8.noarch
perl-Module-Metadata-1.000033-395.el8.noarch
perl-Net-Ping-2.55-416.el8.noarch
perl-Net-SSLeay-1.85-6.el8.x86_64
perl-Package-Generator-1.106-11.el8.noarch
perl-Params-Check-1:0.38-395.el8.noarch
perl-Params-Util-1.07-22.el8.x86_64
perl-Perl-OSType-1.010-396.el8.noarch
perl-PerlIO-via-QuotedPrint-0.08-395.el8.noarch
perl-Pod-Checker-4:1.73-395.el8.noarch
perl-Pod-Html-1.22.02-416.el8.noarch
perl-Pod-Parser-1.63-396.el8.noarch
perl-SelfLoader-1.23-416.el8.noarch
perl-Software-License-0.103013-2.el8.noarch
perl-Sub-Exporter-0.987-15.el8.noarch
perl-Sub-Install-0.928-14.el8.noarch
perl-Sys-Syslog-0.35-397.el8.x86_64
perl-Test-1.30-416.el8.noarch
perl-Test-Harness-1:3.42-1.el8.noarch
perl-Test-Simple-1:1.302135-1.el8.noarch
perl-Text-Balanced-2.03-395.el8.noarch
perl-Text-Diff-1.45-2.el8.noarch
perl-Text-Glob-0.11-4.el8.noarch
perl-Text-Template-1.51-1.el8.noarch
perl-Thread-Queue-3.13-1.el8.noarch
perl-Time-HiRes-1.9758-1.el8.x86_64
perl-Time-Piece-1.31-416.el8.x86_64
perl-URI-1.73-3.el8.noarch
perl-Unicode-Collate-1.25-2.el8.x86_64
perl-autodie-2.29-396.el8.noarch
perl-bignum-0.49-2.el8.noarch
perl-devel-4:5.26.3-416.el8.x86_64
perl-encoding-4:2.22-3.el8.x86_64
perl-experimental-0.019-2.el8.noarch
perl-inc-latest-2:0.500-9.el8.noarch
perl-libnet-3.11-3.el8.noarch
perl-libnetcfg-4:5.26.3-416.el8.noarch
perl-local-lib-2.000024-2.el8.noarch
perl-open-1.11-416.el8.noarch
perl-perlfaq-5.20180605-1.el8.noarch
perl-srpm-macros-1-25.el8.noarch
perl-utils-5.26.3-416.el8.noarch
perl-version-6:0.99.24-1.el8.x86_64
python-srpm-macros-3-37.el8.noarch
python3-rpm-macros-3-37.el8.noarch
qt5-srpm-macros-5.11.1-2.el8.noarch
redhat-rpm-config-116-1.el8.0.1.noarch
rust-srpm-macros-5-2.el8.noarch
systemtap-sdt-devel-4.0-7.el8.x86_64
make-1:4.2.1-9.el8.x86_64
perl-Carp-1.42-396.el8.noarch
perl-Data-Dumper-2.167-399.el8.x86_64
perl-Encode-4:2.97-3.el8.x86_64
perl-Errno-1.28-416.el8.x86_64
perl-Exporter-5.72-396.el8.noarch
perl-File-Path-2.15-2.el8.noarch
perl-File-Temp-0.230.600-1.el8.noarch
perl-Getopt-Long-1:2.50-4.el8.noarch
perl-HTTP-Tiny-0.074-1.el8.noarch
perl-IO-1.38-416.el8.x86_64
perl-MIME-Base64-3.15-396.el8.x86_64
perl-Math-BigInt-1:1.9998.11-5.el8.noarch
perl-Math-Complex-1.59-416.el8.noarch
perl-PathTools-3.74-1.el8.x86_64
perl-Pod-Escapes-1:1.07-395.el8.noarch
perl-Pod-Perldoc-3.28-396.el8.noarch
perl-Pod-Simple-1:3.35-395.el8.noarch
perl-Pod-Usage-4:1.69-395.el8.noarch
perl-Scalar-List-Utils-3:1.49-2.el8.x86_64
perl-Socket-4:2.027-2.el8.x86_64
perl-Storable-1:3.11-3.el8.x86_64
perl-Term-ANSIColor-4.06-396.el8.noarch
perl-Term-Cap-1.17-395.el8.noarch
perl-Text-ParseWords-3.30-395.el8.noarch
perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch
perl-Time-Local-1:1.280-1.el8.noarch
perl-Unicode-Normalize-1.25-396.el8.x86_64
perl-constant-1.33-396.el8.noarch
perl-interpreter-4:5.26.3-416.el8.x86_64
perl-libs-4:5.26.3-416.el8.x86_64
perl-macros-4:5.26.3-416.el8.x86_64
perl-parent-1:0.237-1.el8.noarch
perl-podlators-4.11-1.el8.noarch
perl-threads-1:2.21-2.el8.x86_64
perl-threads-shared-1.58-2.el8.x86_64
python3-pyparsing-2.1.10-7.el8.noarch
Complete!
Last metadata expiration check: 0:01:19 ago on Sat 23 Nov 2019 03:22:59 PM EST.
Package cwp-suphp-0.7.2-3.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
#############################################
Please wait... Installing PHP ...
#############################################
Last metadata expiration check: 0:01:20 ago on Sat 23 Nov 2019 03:22:59 PM EST.
Error:
Problem: cannot install the best candidate for the job
- nothing provides libpng15.so.15()(64bit) needed by cwp-php-5.6.37-1.x86_64
- nothing provides libpng15.so.15(PNG15_0)(64bit) needed by cwp-php-5.6.37-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Compiler requires 512 MB RAM + SWAP
Installation FAILED at php
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 899 100 899 0 0 1872 0 --:--:-- --:--:-- --:--:-- 1869
sh: line 36: mysql: command not found
sh: line 46: /usr/local/bin/php: No such file or directory
grep: /etc/init.d/httpd: No such file or directory
Received
#
In order to try to resolve the errors, which seem to be primarily this:
Error:
Problem: cannot install the best candidate for the job
- nothing provides libpng15.so.15()(64bit) needed by cwp-php-5.6.37-1.x86_64
- nothing provides libpng15.so.15(PNG15_0)(64bit) needed by cwp-php-5.6.37-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Compiler requires 512 MB RAM + SWAP
Installation FAILED at php
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 899 100 899 0 0 1872 0 --:--:-- --:--:-- --:--:-- 1869
sh: line 36: mysql: command not found
sh: line 46: /usr/local/bin/php: No such file or directory
grep: /etc/init.d/httpd: No such file or directory
Firstly, I tried to install php manually, and was able to successfully do so with yum install php. However, the installer still proceeded with the identical problem, nothing changed.
The preceeding errors like nothing provides libpng15.so.15()(64bit) I tried to resolve by manually installing libpng, but it seems that libpng is already installed.
# yum install libpng
Last metadata expiration check: 0:06:35 ago on Sat 23 Nov 2019 03:26:25 PM EST.
Package libpng-2:1.6.34-5.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
However, it's possibly because libpng15 as asked for by cwp is an older package. See https://pkgs.org/download/libpng15.so.15()(64bit), which I found the rpm for CentOS at https://centos.pkgs.org/7/centos-x86_64/libpng-1.5.13-7.el7_2.x86_64.rpm.html
An attempt to install libpng15 from the rpm (since it can't be found with yum install libpng15), results in another error:
c# rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/libpng-1.5.13-7.el7_2.x86_64.rpm
Retrieving http://mirror.centos.org/centos/7/os/x86_64/Packages/libpng-1.5.13-7.el7_2.x86_64.rpm
warning: /var/tmp/rpm-tmp.lWZHpk: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
package libpng-2:1.6.34-5.el8.x86_64 (which is newer than libpng-2:1.5.13-7.el7_2.x86_64) is already installed
file /usr/share/man/man5/png.5.gz from install of libpng-2:1.5.13-7.el7_2.x86_64 conflicts with file from package libpng-2:1.6.34-5.el8.x86_64
It seems that libpng16 is already installed, so libpng15 can't be installed with libpng16 installed.
The error, Compiler requires 512 MB RAM + SWAP doesn't make sense, since I have 24GB of RAM.
Here is my setup:
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 18M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/cl-root 13G 1.9G 11G 15% /
/dev/mapper/cl-tmp 5.5G 72M 5.4G 2% /tmp
/dev/mapper/cl-home 199G 1.5G 198G 1% /home
/dev/sda1 2.0G 182M 1.7G 10% /boot
tmpfs 3.2G 0 3.2G 0% /run/user/0
The error sh: line 36: mysql: command not found comes from the fact that I can't seem to get mysql installed due to MariaDB conflict.
The error grep: /etc/init.d/httpd: No such file or directory seems to be because apache is not installed, of course, possibly because the script ended without installing it? Not sure.
Please help me get CentOS Web Panel installed on CentOS 8. Thank you!
As of today, a beta version of the CWP for Centos 8 is available. CWP Documentation for install on Centos 8
the CWP is not supporting centos 8 yet, they are working on it.
I recommend waiting until they officially support centos 8.
It's very important to install cwp with the appropriate shell script, if you try to install cwp for CentOS 7 on a CentOS 8 is natural it's not working.
cwp-el7-latest it's only for CentOS 7, link:
wget https://centos-webpanel.com/cwp-el7-latest
cwp-el8-latest it's only for CentOS 8, link:
wget https://centos-webpanel.com/cwp-el8-latest
As per CWP Installation Instructions, they have installation for CentOS 8. Below are the instructions:
#cd /usr/local/src
#wget http://centos-webpanel.com/cwp-el8-latest
#chmod +x cwp-el8-latest
#bash cwp-el8-latest
The shell script shall install all the necessary packages through yum.
Steps to install CWP on Centos8
1.Login to server/VPS through SSH by using root login
2.Update the server and install wget, use below commands.
yum update -y
yum install wget
3.Go to src directory, as below
cd /usr/local/src/
4.Download the latest version of CWP, using below commands
wget http://centos-webpanel.com/cwp-el8-latest
5.Start CWP control panel installation.
sh cwp-el7-latest
It will take around 30-60 mins for its complete installation, also you will get all details after installation. Like CWP login url and details.
Once the installation is completed, you will get the following messages as shown in the following image.

Not able to compile with gcc using -m32

amar#pc:/local/mnt/workspace/amarn$ gcc -m32 a.c
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
amar#pc:/local/mnt/workspace/amarn$ cat a.c
#include <stdio.h>
int
main ()
{
long z;
printf("Long int size is %d bytes long!\n", sizeof(z));
;
return 0;
}
amarn#hyd-tbsbld01:/local/mnt/workspace/amarn$ uname -a
Linux mypc 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I made following change for gcc.
gcc was mapped to gcc-5.
I mapped gcc to gcc-4.8.
amar#mypc:/usr/bin$ ll | grep gcc
-rwxr-xr-x 1 root root 428 May 7 2006 c89-gcc
-rwxr-xr-x 1 root root 454 Apr 11 2011 c99-gcc
lrwxrwxrwx 1 root root 7 Jun 1 11:54 gcc -> gcc-4.8
-rwxr-xr-x 1 root root 776344 Jan 26 2016 gcc-4.8
-rwxr-xr-x 1 root root 915736 Nov 3 2016 gcc-5
lrwxrwxrwx 1 root root 10 Jun 1 11:55 gcc-ar -> gcc-ar-4.8
-rwxr-xr-x 1 root root 27032 Jan 26 2016 gcc-ar-4.8
-rwxr-xr-x 1 root root 31136 Nov 3 2016 gcc-ar-5
lrwxrwxrwx 1 root root 10 Jun 1 11:56 gcc-nm -> gcc-nm-4.8
-rwxr-xr-x 1 root root 27032 Jan 26 2016 gcc-nm-4.8
-rwxr-xr-x 1 root root 31136 Nov 3 2016 gcc-nm-5
lrwxrwxrwx 1 root root 14 Jun 1 11:56 gcc-ranlib -> gcc-ranlib-4.8
-rwxr-xr-x 1 root root 27032 Jan 26 2016 gcc-ranlib-4.8
-rwxr-xr-x 1 root root 31136 Nov 3 2016 gcc-ranlib-5
lrwxrwxrwx 1 root root 7 Jun 1 12:32 x86_64-linux-gnu-gcc -> gcc-4.8
lrwxrwxrwx 1 root root 7 Jan 26 2016 x86_64-linux-gnu-gcc-4.8 -> gcc-4.8
lrwxrwxrwx 1 root root 5 Nov 3 2016 x86_64-linux-gnu-gcc-5 -> gcc-5
lrwxrwxrwx 1 root root 10 Jun 1 12:34 x86_64-linux-gnu-gcc-ar -> gcc-ar-4.8
lrwxrwxrwx 1 root root 10 Jan 26 2016 x86_64-linux-gnu-gcc-ar-4.8 -> gcc-ar-4.8
lrwxrwxrwx 1 root root 8 Nov 3 2016 x86_64-linux-gnu-gcc-ar-5 -> gcc-ar-5
lrwxrwxrwx 1 root root 10 Jun 1 12:34 x86_64-linux-gnu-gcc-nm -> gcc-nm-4.8
lrwxrwxrwx 1 root root 10 Jan 26 2016 x86_64-linux-gnu-gcc-nm-4.8 -> gcc-nm-4.8
lrwxrwxrwx 1 root root 8 Nov 3 2016 x86_64-linux-gnu-gcc-nm-5 -> gcc-nm-5
lrwxrwxrwx 1 root root 14 Jun 1 12:35 x86_64-linux-gnu-gcc-ranlib -> gcc-ranlib-4.8
lrwxrwxrwx 1 root root 14 Jan 26 2016 x86_64-linux-gnu-gcc-ranlib-4.8 -> gcc-ranlib-4.8
lrwxrwxrwx 1 root root 12 Nov 3 2016 x86_64-linux-gnu-gcc-ranlib-5 -> gcc-ranlib-5

Get next month in terminal

In OSX on the terminal, how can cal be used to obtain the calendar of the next month?
i.e. the following
command: "cal -m && date +%m +1"
should equate to
command: "cal -m 7"
and produce:
July 2014
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Use this:
m=$(date +'%m'); ((m++)) ; cal -m $m
or this:
cal $(date -v+1m +'%m %y')

Installing tree-1.6.0 in cygwin. What am I missing?

I am trying to install tree 1.6.0 in my cygwin console. To do that, I downloaded the source.
Here is the content of the file
===> ls -lh
total 269K
-rw-r--r-- 1 user None 8.8K Jun 24 2011 CHANGES
-rw-r--r-- 1 user None 16K Jun 22 2011 color.c
-rw-r--r-- 1 user None 17K Apr 14 11:35 color.o
drwxr-xr-x+ 1 user None 0 Apr 14 11:35 doc
-rw-r--r-- 1 user None 3.1K Jun 24 2011 hash.c
-rw-r--r-- 1 user None 2.4K Apr 14 11:35 hash.o
-rw-r--r-- 1 user None 15K Jun 24 2011 html.c
-rw-r--r-- 1 user None 21K Apr 14 11:35 html.o
-rw-r--r-- 1 user None 596 Jun 24 2011 INSTALL
-rw-r--r-- 1 user None 18K Aug 12 2004 LICENSE
-rw-r--r-- 1 user None 2.6K Jun 24 2011 Makefile
-rw-r--r-- 1 user None 4.6K Jun 24 2011 README
-rw-r--r-- 1 user None 5.2K Aug 27 2008 strverscmp.c
-rw-r--r-- 1 user None 2.2K Jun 24 2011 TODO
-rw-r--r-- 1 user None 31K Jun 24 2011 tree.c
-rw-r--r-- 1 user None 5.0K Jun 24 2011 tree.h
-rw-r--r-- 1 user None 37K Apr 14 11:35 tree.o
-rw-r--r-- 1 user None 7.4K Jun 22 2011 unix.c
-rw-r--r-- 1 user None 11K Apr 14 11:35 unix.o
-rw-r--r-- 1 user None 8.7K Jun 24 2011 xml.c
-rw-r--r-- 1 user None 13K Apr 14 11:35 xml.o
When I run make, the following is what I get:
===> make
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o tree.o tree.c
tree.c: In function ‘main’:
tree.c:481:7: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘off_t’ [-Wformat=]
if (duflag) fprintf(outfile," <size>%lld</size>\n", size);
^
tree.c:481:7: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘off_t’ [-Wformat=]
tree.c: In function ‘versort’:
tree.c:782:5: warning: implicit declaration of function ‘strverscmp’ [-Wimplicit-function-declaration]
if ((*a)->isdir == (*b)->isdir) return strverscmp((*a)->name,(*b)->name);
^
tree.c: In function ‘psize’:
tree.c:1107:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘off_t’ [-Wformat=]
} else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9ld", size);
^
tree.c:1107:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘off_t’ [-Wformat=]
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o unix.o unix.c
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o html.o html.c
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o xml.o xml.c
xml.c: In function ‘xml_fillinfo’:
xml.c:301:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘ off_t’ [-Wformat=]
if (sflag) fprintf(outfile, " size=\"%lld\"", ent->size);
^
xml.c:301:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘ off_t’ [-Wformat=]
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o hash.o hash.c
gcc -O4 -Wall -DLINUX -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o color.o color.c
gcc -s -o tree tree.o unix.o html.o xml.o hash.o color.o
tree.o:tree.c:(.text+0x1ba): undefined reference to `strverscmp'
tree.o:tree.c:(.text+0x1ba): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `strve rscmp'
/usr/bin/ld: tree.o: bad reloc address 0x0 in section `.data'
/usr/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status
Makefile:86: recipe for target 'tree' failed
make: *** [tree] Error 1
What is wrong and how can I fix this?
You should follow the instructions in the document INSTALL, in the top level of the distribution directory. In particular the first step:
1. Edit the Makefile for your OS.

Resources