e.g. reset root password
two machines in a cluster
1st step:
-> Activate "safe_to_bootstrap" parameter on first machine
# vi /var/lib/mysql/grastate.dat
safe_to_bootstrap: 1
2nd step on first/second machine:
# systemctl stop mariadb
3rd step:
-> Run database in safe mode on first machine
# /usr/bin/mysqld_safe --skip-grant-tables --wsrep-new-cluster "${@:2}" > /dev/null 2>&1 &
4th step:
-> Note the process id of mysql service
# ps -ef | grep mysql
5th step:
-> Connect mysql terminal then run following commands on first machine
# mysql -u root
use mysql;
update user SET PASSWORD=PASSWORD("password") WHERE USER='root';
flush privileges;
exit
6th step:
-> Try to connect with new password on first machine
# mysql -u root -ppassword
7th step:
-> kill the odd service on first machine
# kill -9 1111
8th step:
-> Start new cluster on first machine
# galera_new_cluster
9th step:
-> Start mariadb on second machine
$ systemctl start mariadb
Done...
Ref:
https://robbinespu.github.io/eng/2018/03/29/Reset_mariadb_root_password.html
https://blog.toonormal.com/2015/11/23/mariadb-cluster-install-notes/
Wednesday, 20 November 2019
Friday, 18 October 2019
e.g. preparing multiple virtual machines in local network
Hostnames: VM node-A, VM node-B, VM node-C
Adapter 1: Host-only Adapter (VirtualBox-Host-Only Ethernet Adapter)
Type -> Paravirtualized network adapter (virtio-net) - Deny Mode
Adapter 2: Bridged Adapter (Intel Ethernet Connection)
Type -> Paravirtualized network adapter (virtio-net) - Deny Mode
Test
Try to connect one of VMs such as "node-A" by SSH
Adapter 1: Host-only Adapter (VirtualBox-Host-Only Ethernet Adapter)
Type -> Paravirtualized network adapter (virtio-net) - Deny Mode
Adapter 2: Bridged Adapter (Intel Ethernet Connection)
Type -> Paravirtualized network adapter (virtio-net) - Deny Mode
Test
Try to connect one of VMs such as "node-A" by SSH
Labels:
linux,
oracle virtual box,
ssh,
virtual machine,
vm
Monday, 30 September 2019
How to solve git merge conflict?
e.g. git merge conflict issue
source: private branch
target: develop branch
1st step:
$ git clone http://blabla --branch private
2nd step:
$ cd <working folder>
3rd step:
$ git checkout private
-> if not specified branch by default while cloning branch
4th step:
$ git merge develop
Error occurred in here
Auto-merging my_new_file.yml
CONFLICT (content): Merge conflict in my_new_file.yml
Auto-merging my_new_file.yml
Automatic merge failed; fix conflicts and then commit the result.
5th step:
-> make necessary changes on my_new_file.yml
6th step:
$ git status
-> check the file
7th step:
$ git branch
-> check the branch before commit
8th step:
$ git add --all
9th step:
$ git commit -m "blabla"
10th step:
$ git push
source: private branch
target: develop branch
1st step:
$ git clone http://blabla --branch private
2nd step:
$ cd <working folder>
3rd step:
$ git checkout private
-> if not specified branch by default while cloning branch
4th step:
$ git merge develop
Error occurred in here
Auto-merging my_new_file.yml
CONFLICT (content): Merge conflict in my_new_file.yml
Auto-merging my_new_file.yml
Automatic merge failed; fix conflicts and then commit the result.
5th step:
-> make necessary changes on my_new_file.yml
6th step:
$ git status
-> check the file
7th step:
$ git branch
-> check the branch before commit
8th step:
$ git add --all
9th step:
$ git commit -m "blabla"
10th step:
$ git push
Labels:
git,
git bash,
git merge conflict
Tuesday, 27 August 2019
Ansible Commands Book
-> valid syntax of the playbook
$ ansible-playbook -i myhosts example.yml -v --syntax-check
$ ansible-playbook -i myhosts example.yml -v --syntax-check
$ time ansible-playbook -i myhosts example.yml -v
-> maintain output verbosity (-v, -vv, -vvv, -vvv)
$ time ansible-playbook -i myhosts example.yml -vvvv
-> list tags/tasks of the playbook
$ ansible-playbook -i myhosts example.yml --list-tags
$ ansible-playbook -i myhosts example.yml --list-tasks
-> run the playbook by getting vault password/sudo password from user
$ ansible-playbook -i myhosts example.yml --ask-vault-pass
$ ansible-playbook -i myhosts example.yml --ask-sudo-pass
-> run the playbook with sudo password
$ ansible-playbook -i myhosts example.yml -e "ansible_sudo_pass=alper"
(-e, --extra-vars)
$ ansible-playbook -i myhosts example.yml --list-tags
$ ansible-playbook -i myhosts example.yml --list-tasks
-> run the playbook by getting vault password/sudo password from user
$ ansible-playbook -i myhosts example.yml --ask-vault-pass
$ ansible-playbook -i myhosts example.yml --ask-sudo-pass
-> run the playbook with sudo password
$ ansible-playbook -i myhosts example.yml -e "ansible_sudo_pass=alper"
(-e, --extra-vars)
How to drop database/user on logical replicated database?
1st step
on 2nd node:
$ echo "DROP SUBSCRIPTION exampledb_node_2" | psql
on 1st node:
$ echo "DROP PUBLICATION exampledb_node_1" | psql
2nd step
on 1st node:
$ echo -e "DROP DATABASE exampledb \n" | psql
$ echo "DROP USER \"user-example\"" | psql
on 2nd node:
$ echo -e "DROP DATABASE exampledb \n" | psql
$ echo "DROP USER \"user-example\"" | psql
on 2nd node:
$ echo "DROP SUBSCRIPTION exampledb_node_2" | psql
on 1st node:
$ echo "DROP PUBLICATION exampledb_node_1" | psql
2nd step
on 1st node:
$ echo -e "DROP DATABASE exampledb \n" | psql
$ echo "DROP USER \"user-example\"" | psql
on 2nd node:
$ echo -e "DROP DATABASE exampledb \n" | psql
$ echo "DROP USER \"user-example\"" | psql
Labels:
database,
escape sequences,
linux,
postgresql
Saturday, 29 June 2019
Kubernetes label usage
e.g. namespace; kube-system
# kubectl get pods --all-namespaces --show-labels
# kubectl get pods -n kube-system --show-labels
-> List pods via labels
# kubectl get pods -n kube-system -l tier=control-plane
-> Describe pod/pods via labels
# kubectl describe pod -n kube-system -l component=kube-scheduler
# kubectl describe pod -n kube-system -l tier=control-plane
-> Get logs via labels
# kubectl get pods -n kube-system -l tier=control-plane
-> Describe pod/pods via labels
# kubectl describe pod -n kube-system -l component=kube-scheduler
# kubectl describe pod -n kube-system -l tier=control-plane
-> Get logs via labels
# kubectl logs -n kube-system -l component=kube-scheduler
# kubectl logs -n kube-system -l tier=control-plane
-> Delete pods via labels
# kubectl delete pods -n kube-system -l component=example
# kubectl delete pods -n kube-system -l 'component in (example,example2)'
# kubectl delete pods -n kube-system -l 'component notin (example3, example4)'
Labels:
kubernetes,
label,
linux
Sunday, 19 May 2019
Examples of "escape sequences" usage on echo command
To use interpretation of backslash escapes, just need to put "-e" parameters afterward echo command.
Info: "-e" means enable escape sequences
Examples of backslash escapes:
New line;
$ echo -e "Hello World\n"
-> Hello World
Form feed;
$ echo -e "Hello World\fWhat a lovely day\fI like this\f"
-> Hello World
What a lovely day
I like this
Carriage return;
$ echo -e "Hello World\rWorld"
-> World World
Horizontal tab;
$ echo -e "Hello World\tWhat a lovely day"
-> Hello World What a lovely day
Vertical tab;
$ echo -e "Hello World\vWhat a lovely day"
-> Hello World
What a lovely day
Null;
$ echo -e "Hello World\0 What a lovely day"
-> Hello World What a lovely day
Clear after all;
$ echo -e "Hello World\c What a lovely day"
-> Hello World
Escape character;
Info: "-e" means enable escape sequences
Examples of backslash escapes:
New line;
$ echo -e "Hello World\n"
-> Hello World
Form feed;
$ echo -e "Hello World\fWhat a lovely day\fI like this\f"
-> Hello World
What a lovely day
I like this
Carriage return;
$ echo -e "Hello World\rWorld"
-> World World
Horizontal tab;
$ echo -e "Hello World\tWhat a lovely day"
-> Hello World What a lovely day
Vertical tab;
$ echo -e "Hello World\vWhat a lovely day"
-> Hello World
What a lovely day
Null;
$ echo -e "Hello World\0 What a lovely day"
-> Hello World What a lovely day
Clear after all;
$ echo -e "Hello World\c What a lovely day"
-> Hello World
Escape character;
$ echo -e "Go to \\home directory"
-> Go to \home directory
$ echo -e "Go to \"home\" directory"
Unicode usage;
$ echo -e "This is turkish lira symbol-> \u20ba"
-> This is turkish lira symbol-> ₺
$ echo -e "Go to \"home\" directory"
-> Go to "home" directory
Unicode usage;
$ echo -e "This is turkish lira symbol-> \u20ba"
-> This is turkish lira symbol-> ₺
Labels:
echo,
escape char,
escape sequences,
linux
Friday, 22 February 2019
Linux Terminal Commands Book
* chage (manage user password settings)
* hostnamectl (show hostname settings)
* date (manage system date and time)
* rpm (means RedHat Package Manager)
* timedatectl (show timezone settings)
* tcpdump (analyze network packages)
* tar (compress the files for archiving)
* tree (see the files as tree format)
* wc (means word count)
* yum (manage RPM packages on RedHat distro)
* hostnamectl (show hostname settings)
* date (manage system date and time)
* rpm (means RedHat Package Manager)
* timedatectl (show timezone settings)
* tcpdump (analyze network packages)
* tar (compress the files for archiving)
* tree (see the files as tree format)
* wc (means word count)
* yum (manage RPM packages on RedHat distro)
Thursday, 3 January 2019
How to fix "connection refused" error?
Error
e.g.
The connection to the server 10.10.10.10:6443 was refused - did you specify the right host or port?
Solution
On kubernetes control nodes, try to "stop/start" docker service
# service docker restart
or
# systemctl restart docker
e.g.
The connection to the server 10.10.10.10:6443 was refused - did you specify the right host or port?
Solution
On kubernetes control nodes, try to "stop/start" docker service
# service docker restart
or
# systemctl restart docker
Labels:
centos,
docker,
kubernetes,
linux
Wednesday, 19 December 2018
What are the differences of su/ su -/ sudo / sudo su in linux system?
Info:
su means, switch user or substitute user
sudo means, super user do
to use sudo command, related user must be defined in sudoers file
$ su -
(switch user to root then executes all /etc/profile, .profile and .bashrc files by root)
$ su
(switch user to root user then executes only .bashrc file by root)
$ sudo su -
(switch user to root then executes all /etc/profile, .profile and .bashrc files by root if current user defined in sudoers file)
$ sudo su
(switch user to root then executes only .bashrc file by root if current user defined in sudoers file)
Ref: https://ozsoyler.blogspot.com/2016/09/how-to-gain-root-access-without_15.html
su means, switch user or substitute user
sudo means, super user do
to use sudo command, related user must be defined in sudoers file
$ su -
(switch user to root then executes all /etc/profile, .profile and .bashrc files by root)
$ su
(switch user to root user then executes only .bashrc file by root)
$ sudo su -
(switch user to root then executes all /etc/profile, .profile and .bashrc files by root if current user defined in sudoers file)
$ sudo su
(switch user to root then executes only .bashrc file by root if current user defined in sudoers file)
Ref: https://ozsoyler.blogspot.com/2016/09/how-to-gain-root-access-without_15.html
Thursday, 1 November 2018
How to change timezone?
-> Determine your timezone
# cd /usr/share/zoneinfo
# tzselect
e.g.
Europe/Istanbul
-> Remove current localtime soft link
# rm /etc/localtime
-> Define your localtime soft link as new
# ln -s /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
-> Check your latest timezone setting
# timedatectl
# cd /usr/share/zoneinfo
# tzselect
e.g.
Europe/Istanbul
-> Remove current localtime soft link
# rm /etc/localtime
-> Define your localtime soft link as new
# ln -s /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
-> Check your latest timezone setting
# timedatectl
Wednesday, 31 October 2018
How to connect into local VM via SSH?
* Set a new Port Forwarding Rule in Network Settings
Step 1: Settings -> Network -> Adapter 1 -> Advanced -> Adapter Type -> "Paravirtualized network adapter (virtio-net)" -> OK
Step 2: Settings -> Network -> Adapter 1 -> Advanced -> Keep it as "NAT" -> Click "Port Forwarding" -> Define a Rule -> OK
e.g.
Name Protocol Host Port Guest Port
SSH TCP 1022 22
SSH Connection Host/Port Settings:
Host: 127.0.0.1
Port: 1022
Step 1: Settings -> Network -> Adapter 1 -> Advanced -> Adapter Type -> "Paravirtualized network adapter (virtio-net)" -> OK
Step 2: Settings -> Network -> Adapter 1 -> Advanced -> Keep it as "NAT" -> Click "Port Forwarding" -> Define a Rule -> OK
e.g.
Name Protocol Host Port Guest Port
SSH TCP 1022 22
SSH Connection Host/Port Settings:
Host: 127.0.0.1
Port: 1022
Labels:
linux,
oracle virtual box,
ssh,
virtual machine,
vm
WSREP "Failed to open channel" solution
Error
ERROR WSREP "Failed to open channel 'my_mariadb_cluster'"
Detailed Error
WSREP: gcs/src/gcs.cpp:gcs_open():1458: Failed to open channel 'my_mariadb_cluster' at 'gcomm://10.10.10.10,10.10.10.11': -110 (Connection timed out)
Solution
On the first node: (e.g. node-1)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service
-> Make sure "safe_to_bootstrap" value is "1"
# cat /var/lib/mysql/grastate.dat
safe_to_bootstrap: 1
-> Run following command for starting cluster as new
# galera_new_cluster
-> mariadb service should be started automatically
# systemctl status mariadb.service
-> note wsrep_last_committed number by looking system table
# mysql -u root -p
> show status like 'wsrep_%';
-> note uuid number
# cat /var/lib/mysql/grastate.dat
On the second node: (e.g. node-2)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service
-> uuid and seqno (wsrep_last_committed) should be same with node-1
# vi /var/lib/mysql/grastate.dat
uuid: 0000
seqno: 100
-> start mariadb service
# systemctl start mariadb.service
ERROR WSREP "Failed to open channel 'my_mariadb_cluster'"
Detailed Error
WSREP: gcs/src/gcs.cpp:gcs_open():1458: Failed to open channel 'my_mariadb_cluster' at 'gcomm://10.10.10.10,10.10.10.11': -110 (Connection timed out)
Solution
On the first node: (e.g. node-1)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service
-> Make sure "safe_to_bootstrap" value is "1"
# cat /var/lib/mysql/grastate.dat
safe_to_bootstrap: 1
-> Run following command for starting cluster as new
# galera_new_cluster
-> mariadb service should be started automatically
# systemctl status mariadb.service
-> note wsrep_last_committed number by looking system table
# mysql -u root -p
> show status like 'wsrep_%';
-> note uuid number
# cat /var/lib/mysql/grastate.dat
On the second node: (e.g. node-2)
-> Stop mariadb service if it hangs
# systemctl stop mariadb.service
-> uuid and seqno (wsrep_last_committed) should be same with node-1
# vi /var/lib/mysql/grastate.dat
uuid: 0000
seqno: 100
-> start mariadb service
# systemctl start mariadb.service
Labels:
galera cluster,
mariadb,
WSREP
Monday, 8 October 2018
How to find/follow postgresql server logs?
-> Check log level from config file
# cat /var/lib/pgsql/data/postgresql.conf
e.g.
log_min_messages= 'ERROR' (default value)
(options; DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, and PANIC)
-> Determine log directory name (via postgres user)
$ psql
postgres=# show log_directory;
e.g. pg_log
-> Determine data directory name (via postgres user)
$ psql
postgres=# show data_directory;
e.g. /var/lib/pgsql/data
-> Determine log file name (via postgres user)
$ psql
postgres=# show log_filename;
e.g. postgresql-%a.log (%a will be "day" of the week)
e.g. postgresql-%a-%H.log (%H will be "hour" of the day)
-> Check log rotation age of the log files
postgres=# show log_rotation_age;
e.g. 1d (1d means one day)
* The database system generate log files daily
e.g. 1h (1h means one hour)
* The database system generate log files hourly
Eventually, the log path could be like this;
e.g.
# ls /var/lib/pgsql/data/pg_log/postgresql-Mon.log
# ls /var/lib/pgsql/data/pg_log/postgresql-Mon-07.log
-> To follow the logs by tail
e.g.
# tail -100f /var/lib/pgsql/data/pg_log/postgresql-Mon.log
# tail -100f /var/lib/pgsql/data/pg_log/postgresql-Mon-07.log
Ref: https://www.postgresql.org/docs/9.5/static/runtime-config-logging.html
# cat /var/lib/pgsql/data/postgresql.conf
e.g.
log_min_messages= 'ERROR' (default value)
(options; DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, and PANIC)
-> Determine log directory name (via postgres user)
$ psql
postgres=# show log_directory;
e.g. pg_log
-> Determine data directory name (via postgres user)
$ psql
postgres=# show data_directory;
e.g. /var/lib/pgsql/data
-> Determine log file name (via postgres user)
$ psql
postgres=# show log_filename;
e.g. postgresql-%a.log (%a will be "day" of the week)
e.g. postgresql-%a-%H.log (%H will be "hour" of the day)
-> Check log rotation age of the log files
postgres=# show log_rotation_age;
e.g. 1d (1d means one day)
* The database system generate log files daily
e.g. 1h (1h means one hour)
* The database system generate log files hourly
e.g.
# ls /var/lib/pgsql/data/pg_log/postgresql-Mon.log
# ls /var/lib/pgsql/data/pg_log/postgresql-Mon-07.log
-> To follow the logs by tail
e.g.
# tail -100f /var/lib/pgsql/data/pg_log/postgresql-Mon.log
# tail -100f /var/lib/pgsql/data/pg_log/postgresql-Mon-07.log
Ref: https://www.postgresql.org/docs/9.5/static/runtime-config-logging.html
Labels:
database,
log,
postgresql
Thursday, 4 October 2018
How to setup/configure/use mailx for Office365 account?
-> Update the OS
# yum -y update
or (y -> yes)
# yum update
-> Install mailx
# yum install -y mailx
-> Define soft link to use "email" the command
# ln -s /bin/mailx /bin/email
-> Prepare config file
# vi /etc/mail.rc
set smtp=outlook.office365.com
set smtp-auth-user=alper@alper.com
set smtp-auth-password=alper123
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
set smtp-use-starttls
set from="alper@alper.com(Alper Ozsoyler)"
-> Try to send an email to yourself
# echo "Your message is my message!" | email -v -s "Message Subject is Bla Bla" alper@alper.com
Ref: https://gist.github.com/ilkereroglu/aa6c868153d1c5d57cd8
# yum -y update
or (y -> yes)
# yum update
-> Install mailx
# yum install -y mailx
-> Define soft link to use "email" the command
# ln -s /bin/mailx /bin/email
-> Prepare config file
# vi /etc/mail.rc
set smtp=outlook.office365.com
set smtp-auth-user=alper@alper.com
set smtp-auth-password=alper123
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
set smtp-use-starttls
set from="alper@alper.com(Alper Ozsoyler)"
-> Try to send an email to yourself
# echo "Your message is my message!" | email -v -s "Message Subject is Bla Bla" alper@alper.com
Ref: https://gist.github.com/ilkereroglu/aa6c868153d1c5d57cd8
How to solve "restarting/pending pod repeatedly" problem?
-> Check the pods status
e.g.
# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS
kube-system coredns-78fcdf6894-6ggkk 0/1 Pending
kube-system coredns-78fcdf6894-tm52r 0/1 Pending
-> Check the deployments
# kubectl get deployment --all-namespaces
NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE
kube-system coredns 2 2 2 0
-> Needs to remove the deployments related to pod and service
e.g.
# kubectl delete deployment coredns -n kube-system
deployment.extensions "coredns" deleted
e.g.
# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS
kube-system coredns-78fcdf6894-6ggkk 0/1 Pending
kube-system coredns-78fcdf6894-tm52r 0/1 Pending
-> Check the deployments
# kubectl get deployment --all-namespaces
NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE
kube-system coredns 2 2 2 0
-> Needs to remove the deployments related to pod and service
e.g.
# kubectl delete deployment coredns -n kube-system
deployment.extensions "coredns" deleted
Labels:
deployment,
kubernetes,
linux,
pod
Tuesday, 2 October 2018
How to enable Hyper-V in Windows 10?
Press Windows key -> Type "Turn Windows features on or off" then click it -> Select "Hyper-V" check box then click "OK" -> Restart PC -> Done!
Labels:
hyper-v,
windows,
windows 10
Tuesday, 18 September 2018
How to install/configure/enable NTP service?
-> Install ntp service
# yum install ntp
-> Once NTP server pool zones are taking
e.g. check from https://www.pool.ntp.org/zone/europe
-> Add specific pool zones into config file if they are not existed
# vi /etc/ntp.conf
server 0.europe.pool.ntp.org
-> Enable service
# systemctl enable ntpd
-> Run service
# systemctl start ntpd
-> Lastly, check the service and the settings
# yum install ntp
e.g. check from https://www.pool.ntp.org/zone/europe
-> Add specific pool zones into config file if they are not existed
# vi /etc/ntp.conf
server 0.europe.pool.ntp.org
-> Enable service
# systemctl enable ntpd
-> Run service
# systemctl start ntpd
-> Lastly, check the service and the settings
# timedatectl
Thursday, 9 August 2018
How to check linux operating system info?
-> show kernel version and other info
# uname -a
-> show machine info
# hostnamectl
-> show specific release version
# rpm --query centos-release
# uname -a
-> show machine info
# hostnamectl
-> show specific release version
# rpm --query centos-release
How to check available yum packages?
e.g. install/update ansible by yum
-> Go to repo path
# cd /etc/yum.repos.d/
-> Add source paths into repo file to be able to install ansible
# vi epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
-> Search yum package
# yum search ansible
-> Check available yum package
# yum list available | grep ansible
-> Check available all yum packages with its duplicates
# yum list available --showduplicates | grep ansible
-> Install ansible
# yum install ansible
-> Download only yum package
# yum install ansible --downloadonly --downloaddir=/root
-> Check available yum packages for upgrade
# yum check-updates | grep ansible
-> Update ansible
# yum update ansible
-> Check yum history
# yum history list
-> Go to repo path
# cd /etc/yum.repos.d/
-> Add source paths into repo file to be able to install ansible
# vi epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
-> Search yum package
# yum search ansible
-> Check available yum package
# yum list available | grep ansible
-> Check available all yum packages with its duplicates
# yum list available --showduplicates | grep ansible
# yum install ansible
-> Download only yum package
# yum install ansible --downloadonly --downloaddir=/root
-> Check available yum packages for upgrade
# yum check-updates | grep ansible
-> Update ansible
# yum update ansible
-> Check yum history
# yum history list
Subscribe to:
Posts (Atom)