Last active
July 16, 2020 01:41
-
-
Save heiwa4126/68f0b7fa8deafdc1516f68f8de768f9f to your computer and use it in GitHub Desktop.
/etc/yum.confに`exclude=kernel-* kmod-* perf-* python-perf-* redhat-release-* initscripts` みたいなことのかいてあるRHELのホストに最新カーネルをインストールするコマンドを表示するスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pkgs=(bpftool bpftool-debuginfo kernel kernel-abi-whitelists kernel-debug kernel-debug-debuginfo kernel-debug-devel kernel-debuginfo kernel-debuginfo-common-x86_64 kernel-devel kernel-doc kernel-headers kernel-tools kernel-tools-debuginfo kernel-tools-libs kernel-tools-libs-devel perf perf-debuginfo python-perf python-perf-debuginfo) | |
installed=() | |
for pkg in ${pkgs[@]}; do | |
rpm -q "$pkg" &> /dev/null | |
if [ $? -eq 0 ] ; then | |
installed+=("$pkg") | |
fi | |
done | |
# echo -n "sudo yum install --disableexcludes=all " | |
echo -n "sudo -i yum install --disableexcludes=all --downloadonly " | |
echo ${installed[@]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
出力例:
12-13行目をちょっと変えれば、即実行もできる。