Skip to content

Instantly share code, notes, and snippets.

@cuiwm
Last active June 11, 2018 05:59
Show Gist options
  • Save cuiwm/e98da6868bba7596d81ac6b3e7e0f4f2 to your computer and use it in GitHub Desktop.
Save cuiwm/e98da6868bba7596d81ac6b3e7e0f4f2 to your computer and use it in GitHub Desktop.
yum_install_openresty
bash -c "echo 7 > /etc/yum/vars/releasever" && yum install -y yum-utils && sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo && sudo yum install -y openresty && command -v opentresty
yum install -y yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/rhel/openresty.repo
sudo yum install -y openresty
# change info about os version
vi /etc/yum.repos.d/openresty.repo
sudo yum install openresty
#python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
#To get a clean display of $releasever in the bash shell, use this:
#/usr/bin/python -c 'import yum;yb=yum.YumBase();yb.doConfigSetup(init_plugins=False);print yb.conf.yumvar["releasever"]'
```Bash
# bash -c "echo 6 > /etc/yum/vars/releasever"
# python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Loaded plugins: fastestmirror, product-id
{'arch': 'ia32e',
'basearch': 'x86_64',
'releasever': '6',
'uuid': '1619e94a-ea8d-473f-ae3b-6a533f7a6ed7'}
# echo '6s' > /etc/yum/
pluginconf.d/ protected.d/ vars/ version-groups.conf
# echo '6s' > /etc/yum/v
vars/ version-groups.conf
# echo '6s' > /etc/yum/vars/releasever
# python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Loaded plugins: fastestmirror, product-id
{'arch': 'ia32e',
'basearch': 'x86_64',
'releasever': '6s',
'uuid': '1619e94a-ea8d-473f-ae3b-6a533f7a6ed7'}
#To get a clean display of $releasever in the bash shell, use this:
/usr/bin/python -c 'import yum;yb=yum.YumBase();yb.doConfigSetup(init_plugins=False);print yb.conf.yumvar["releasever"]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment