RHEL: Difference between revisions
→Package management: Install downloaded RPM package |
|||
Line 37: | Line 37: | ||
== Package management == | == Package management == | ||
=== Clean up cache for yum PM === | |||
<source lang="console"> | |||
$ sudo service rhsmcertd restart | |||
$ sudo subscription-manager refresh | |||
$ sudo yum clean all && yum rm -rf /var/cache/yum && yum makecache | |||
</source> | |||
=== List all subscriptions === | |||
<source lang="console"> | |||
$ sudo subscription-manager list --all --available | more | |||
</source> | |||
=== Install downloaded RPM package === | === Install downloaded RPM package === | ||
<source lang="console"> | <source lang="console"> | ||
$ yum -y localinstall ~/Downloads/screen | $ sudo yum -y localinstall ~/Downloads/screen | ||
</source> | </source> | ||
Revision as of 11:14, 2 November 2021
Setting up from scratch on a VM at work
Web services
$ sudo yum install yum-utils
Create /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
Install nginx
$ sudo yum install nginx
Useful commands
Package management
Clean up cache for yum PM
$ sudo service rhsmcertd restart
$ sudo subscription-manager refresh
$ sudo yum clean all && yum rm -rf /var/cache/yum && yum makecache
List all subscriptions
$ sudo subscription-manager list --all --available | more
Install downloaded RPM package
$ sudo yum -y localinstall ~/Downloads/screen
Check if there are any disabled repositories
$ egrep -Hi '(^\[|^enabled)' /etc/yum.repos.d/*
/etc/yum.repos.d/epel.repo.rpmsave:[epel]
/etc/yum.repos.d/epel.repo.rpmsave:enabled=1
/etc/yum.repos.d/epel.repo.rpmsave:[epel-debuginfo]
/etc/yum.repos.d/epel.repo.rpmsave:enabled=0
/etc/yum.repos.d/epel.repo.rpmsave:[epel-source]
/etc/yum.repos.d/epel.repo.rpmsave:enabled=0
/etc/yum.repos.d/nginx.repo:[nginx-stable]
/etc/yum.repos.d/nginx.repo:enabled=1
/etc/yum.repos.d/nginx.repo:[nginx-mainline]
/etc/yum.repos.d/nginx.repo:enabled=1
...