Last active
September 5, 2017 20:45
-
-
Save mohanraj-r/2f797a4687833a156688919509d829e3 to your computer and use it in GitHub Desktop.
[centos] Utils for working with centos #shell #reference
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
# list files from a rpm file on disk without extracting it | |
# source: http://stackoverflow.com/a/18787544 | |
rpmx(){ | |
rpm_file=$1 | |
rpm2cpio $rpm_file | cpio -idmv | |
} | |
# uninstalling package with issues | |
# http://serverfault.com/a/613258 | |
yum clean all && rpm --rebuilddb | |
package-cleanup --problems | |
yum erase foo | |
# if that fails (due to errors in scripts) | |
yum --setopt=tsflags=noscripts remove foo | |
# if that fails .. | |
rpm -e --noscripts | |
# print metadata from a rpm file | |
# http://serverfault.com/a/414557 | |
rpm -qip /path/file.rpm | |
# bunch of info about current sys - including hostname, kernel | |
hostnamectl | |
# centos version | |
rpm --query centos-release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment