Switching Default UEK kernel to Redhat Kernel on Oracle Linux 7

About the Unbreakable Enterprise Kernel (UEK)

In September 2010, Oracle announced the new Unbreakable Enterprise Kernel (UEK) for Oracle Linux as a recommended kernel for deployment with Oracle Linux 5.

Starting with Oracle Linux 5.5, Oracle give you could choose to use either the Red Hat Compatible Kernel or the UEK.

In Oracle Linux 5.6 and above, the UEK became the default kernel for Oracle Linux.

Switching Default UEK kernel to Redhat Kernel

Switching Default UEK kernel to Redhat Kernel on Oracle Linux 7

This article will describe how to Switching Default UEK kernel to Redhat Kernel on Oracle Linux 7 with the following steps :

1. Original Kernel for Oracle Linux 7 will likely as below :

# uname -a
Linux localhost.localdomain 3.8.13-55.1.6.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 x86_64 x86_64 x86_64 GNU/Linux

2. Grep the list of the available kernel in Oracle Linux 7. The sequence of entry will start with 0.

a) To display with command 1 :

# egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
Oracle Linux Server 7.1, with Linux 3.10.0-229.el7.x86_64
Oracle Linux Server 7.1, with Unbreakable Enterprise Kernel 3.8.13-55.1.6.el7uek.x86_64
Oracle Linux Server 7.1, with Linux 0-rescue-26ad0b77c2de4840ba8402282bdd9d17

b) To display with command 2 :

# grep '^menuentry' /boot/grub2/grub.cfg | cut -f 2 -d \'
Oracle Linux Server 7.1, with Linux 3.10.0-229.el7.x86_64
Oracle Linux Server 7.1, with Unbreakable Enterprise Kernel 3.8.13-55.1.6.el7uek.x86_64
Oracle Linux Server 7.1, with Linux 0-rescue-26ad0b77c2de4840ba8402282bdd9d17

3. Set entry 0 as the default kernel with this command :

# grub2-set-default 0
# grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.8.13-55.1.6.el7uek.x86_64
Found initrd image: /boot/initramfs-3.8.13-55.1.6.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-26ad0b77c2de4840ba8402282bdd9d17
Found initrd image: /boot/initramfs-0-rescue-26ad0b77c2de4840ba8402282bdd9d17.img
done

4. Reboot the server :

# init 6

5. After reboot, verify that Red Hat Compatible Kernel will become the default :

# uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 04:05:24 PST 2015 x86_64 x86_64 x86_64 GNU/Linux

I hope this article gives you some ideas and essential guidance on how to Switching Default UEK kernel to Redhat Kernel.

Note :
*Do not edit the GRUB 2 configuration file directly. On BIOS-based systems, the configuration file is /boot/grub2/grub.cfg. On UEFI-based systems, the configuration file is /boot/efi/EFI/redhat/grub.cfg.

*The grub2-mkconfig command generates the configuration file using the template scripts in /etc/grub.d and menu-configuration settings taken from the configuration file, /etc/default/grub.

Source

How to a Add and Remove User Account on RHEL 6/7, CentOS 6/7, Oracle Linux 6/7

This article will explain and share how to add and remove user account with useradd(add) and userdel (remove) from the command-line on linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7 server.

1. Adding a New User to an Linux System.

a) Get the useradd manual :

# man useradd
useradd - create a new user or update default new user information

b) To creates the new account and the /home/john home directory :

# useradd --home /home/ehowstuff ehowstuff

c) useraddd command does not set any valid password by default, and user cannot log in until a password is set.To set the password user the following command :

# passwd ehowstuff
Changing password for user ehowstuff.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

d) Verify the values in /etc/password :

# cat /etc/passwd | grep ehowstuff
ehowstuff:x:501:501::/home/ehowstuff:/bin/bash

e) Verify the values in /etc/group :

# cat /etc/group | grep ehowstuff
ehowstuff:x:501:

f) Verify email user created for id ehowstuff :

# ls /var/spool/mail | grep ehowstuff
ehowstuff

More useradd options :

-c, –comment COMMENT
Add a value, such as a full name, to the GECOS field.

-g, –gid GROUP
Specify the primary group for the user account.

-G, –groups GROUPS
Specify a list if supplementary groups for the user account.

-a, –append
Used with the -G option to append the user to the supplemental groups mentioned without removing the user from other groups.

-d, –home HOME_DIR
Specify a new home directory to a new location. Must be used with the -d option.

-m, –move-home
Move a user home directory to a new location. Must be used with the -d option.

-s, –shell SHELL
Specify a new login shell for the user account.

-L, –lock
Lock a user account.

-U, –unlock
Unlock a user account.

2. Deleting a User from an Linux System.

a) Get userdel manual :

# man userdel
userdel - delete a user account and related files

b) userdel username removes the user from /etc/passwd, but leaves the home directory intact by default. Proper command to remove the user’s account, user’s home directory and mail spool as part of the deletion process :

# userdel --remove ehowstuff

or

# userdel -r ehowstuff

Warning :
When a user is removed with userdel without the -r option specified, the system will have files that are owned by an unassigned user ID number. This can also happen when files created by a deleted user exist outside their home directory. This situation can lead to information leakage and other security issues.

 

How to Install and Configure TigerVNC Server on CentOS 7.1 / RHEL 7.1 / Oracle Linux 7

The following article explain how to Install and configure TigerVNC Server on CentOS 7.1 or Red Hat Enterprise Linux (RHEL 7.1) or Oracle Linux 7. TigerVNC (Tiger Virtual Network Computing) is a remote access utility that allows you to control other computers that running graphical desktop sharing in separate sessions in parallel. It is works on the client-server principle: a server shares its output (vncserver) and a client (vncviewer) connects to the server. TigerVNC in RHEL 7 or CentOS 7 or Oracle Linux 7 uses the systemd system management daemon for its configuration. The /etc/sysconfig/vncserver configuration file has been replaced by /etc/systemd/system/vncserver@.service.

Install and Configure TigerVNC Server on Linux

1. Install tigervnc-server

# yum install tigervnc-server -y

2. Copy this file to /etc/systemd/system/vncserver@:.service :

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

3. Edit and vncserver parameters appropriately

# vi /etc/systemd/system/vncserver@:1.service

Replace with actual user hat exist on the linux (e.g ehowstuff)

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l ehowstuff -c "/usr/bin/vncserver %i"
PIDFile=/home/ehowstuff/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

4. Run `systemctl daemon-reload` to make the changes take effect immediately :

# systemctl daemon-reload

5. Set the password for the user or users defined in the configuration file. Note that you need to switch from root to USER first.

# su - ehowstuff
$ vncpasswd
Password:
Verify:

6. To start the service, specify the display number directly in the command :

# systemctl start vncserver@:1.service

7. Enable the service to start automatically at system start

# systemctl enable vncserver@:1.service

8. Add firewall rules to allow the VNC connection :

# firewall-cmd --permanent --zone=public --add-port 5901/tcp
# systemctl restart firewalld.service

9. Run VNC viewer :
Configure TigerVNC Server

How to Configure Static IP Address on RHEL 7.0/CentOS 7.0/Oracle Linux 7

This article will describe the procedure to configure static Ip address on RHEL 7/CentOS 7/Oracle Linux 7 minimal installation. Network interface configuration files control the software interfaces for individual network devices. As the system boots, it uses these files to determine what interfaces to bring up and how to configure them. These files are usually named ifcfg-name. Since the release of RHEL 7, redhat come with the new naming scheme for the network devices. In RHEL7/CentOS7/Oracle Linux 7, the default network interface name is based on firmware, topology, and location information. In this procedure, the network interface name is ifcfg-ens160.

1. Original ip configuration :

# cat /etc/sysconfig/network-scripts/ifcfg-ens160
HWADDR=00:02:22:G4:EE:FF
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=34796933-af4b-4a41-8287-6e57ac131234
ONBOOT=no

2. Please change BOOTPROTO to static or none, ONBOOT statement is set on YES and don’t change HWADDR and UUID values provided by default. Please add IPADDR, NETMASK, GATEWAY and DNS1 line as below :

HWADDR=00:02:22:G4:EE:FF
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=34796933-af4b-4a41-8287-6e57ac131234
ONBOOT=yes
IPADDR=192.168.0.70
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=8.8.8.8

3. Restart network interface to take effect :

# systemctl restart network

or

# service network restart
Restarting network (via systemctl):                        [  OK  ]

4. Run ifconfig to display the ip address. If your ifconfig command is not found, please follow this instruction to install it.(How to Install ifconfig and netstat on RHEL 7.0/CentOS 7.0):

# ifconfig
ens160: flags=4163  mtu 1500
        inet 192.168.0.70  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:feba:3efe  prefixlen 64  scopeid 0x20
        ether 00:0c:29:ba:3e:fe  txqueuelen 1000  (Ethernet)
        RX packets 20775  bytes 1455662 (1.3 MiB)
        RX errors 0  dropped 40  overruns 0  frame 0
        TX packets 1289  bytes 179594 (175.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 8  bytes 656 (656.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 656 (656.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

How to Install VMware Tools on RHEL 7/CentOS 7

VMware ToolsVMware Tools is one of important components for virtual machine (VM) in order get excellent performance. It is a group of utilities that help to enhances the overall performance of the virtual machine’s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on RHEL 7, CentOS 7 and Oracle Linux 7.

How to Install VMware Tools ?

Option 1 (Recommended by VMware) – VMware support of open-vm-tools

open-vm-tools is an open source implementation of VMware Tools from third parties and contains utilities that enhances virtualization management, administration and functions of the virtual machine in VMware environments. The ultimate goal is to enable the operating system vendors and/or communities and virtual appliance vendors to bundle VMware Tools into their product releases.

# yum install open-vm-tools
Option 2 :

1. Install prerequisites :

# yum install perl gcc make kernel-headers kernel-devel -y

2. Attach the vmware tools sofware from vSphere client.

3. Mount the vmware tools package into /mnt :

# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only

4. Copy vmware tool packagae into /tmp :

# cd /mnt
# ls
manifest.txt     VMwareTools-9.4.0-1280544.tar.gz  vmware-tools-upgrader-64
run_upgrader.sh  vmware-tools-upgrader-32
# cp -p VMwareTools-9.4.0-1280544.tar.gz /tmp

5. Go to /tmp directory and extract the vmware tools package :

# cd /tmp
# tar xzvf VMwareTools-9.4.0-1280544.tar.gz

6. Go to extracted folder, vmware-tools-distrib :

# cd vmware-tools-distrib
# ls
bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl

7. Run vmware-install.pl to start installation :

# ./vmware-install.pl

Example:

# ./vmware-install.pl
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

The installation of VMware Tools 9.4.0 build-1280544 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

Initializing...


Making sure services for VMware Tools are stopped.

Stopping vmware-tools (via systemctl):                     [  OK  ]


The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.

The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [no]

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[no]

VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can be

enabled/disabled by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no]

No X install found.

Creating a new initrd boot image for the kernel.
Starting vmware-tools (via systemctl):                     [  OK  ]
The configuration of VMware Tools 9.4.0 build-1280544 for Linux for this
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

8. Once successfully installed, make sure you umount back the /mnt :

# umount /mnt

 

How to Disable SELinux on RHEL 7/CentOS 7/Oracle Linux 7

Security-Enhanced Linux (SELinux) is an implementation of security policies for operating systems that provides a mechanism to support and help control access in the linux kernel. On Red Hat Enterprise Linux 7 (RHEL 7), CentOS 7 and Oracle Linux 7 (OL7), SELinux services were installed by default. The following tutorial will show you the basic steps to permanently disable SELinux on RHEL 7, CentOS 7 and OL7.

1. Check SELinux status :

[root@centos7 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

2. Open selinux configuration file :

[root@centos7 ~]# vi /etc/sysconfig/selinux

3. Change “SELINUX=enforcing” to “SELINUX=disabled” and save the configuration file :

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

4. Reboot the server to take effect :

[root@centos7 ~]# reboot

5. After reboot, you can verify the status of SELinux. Issue “sestatus” command to verify that SELinux permanently disabled:

[root@centos7 ~]# sestatus
SELinux status:                 disabled

How to Install and Use Traceroute in Linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7

Traceroute command is a network diagnostic tool for displaying the route packets take to network host or destination. It shows how long each hop will takes and how many hops that the packet requires to reach the specify destination. In linux, traceroute command is used while in windows and dos environment, they used tracert command. In this post i will show you how to install and how to use traceroute command to diagnose your IP network related issues. This steps has been tested on RHEL 6/7, CentOS 6/7 and Oracle Linux 6/7.

1. If your linux VPS or dedicated server does not installed with traceroute, it will return this warning :

# traceroute www.google.com
-bash: traceroute: command not found

Or you can verify the traceroute install or not by issue which command :

# which traceroute
/usr/bin/which: no traceroute in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

2. To install traceroute, run the following command :

# yum install traceroute -y

3. Verify the command install or not :

# which traceroute
/bin/traceroute

4. How to use traceroute command :

a. Find the network path from my centos6 server to google.com :

# traceroute [options]

Example :

# traceroute www.google.com
traceroute to www.google.com (58.27.108.153), 30 hops max, 60 byte packets
 1  192.168.2.1 (192.168.2.1)  9.233 ms  9.020 ms  8.857 ms
 2  219.93.218.177 (219.93.218.177)  20.717 ms  20.529 ms  27.526 ms
 3  60.49.55.93 (60.49.55.93)  57.368 ms  57.446 ms  57.187 ms
 4  10.55.32.58 (10.55.32.58)  76.846 ms 10.55.32.56 (10.55.32.56)  66.418 ms  66.906 ms
 5  58.27.105.125 (58.27.105.125)  75.779 ms  65.556 ms  65.592 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

1 is the internet gateway on the network this traceroute was done (ADSL modem local IP)
2 is the ISP the origin computer is connected to.

My PPPoE modem WAN IP details :
1

b. Find the network path from my centos6 server to google.com and do not resolve IP addresses to their domain names :

# traceroute www.google.com -n

c. Find the network path from my centos6 server to google.com and set the number of seconds to wait for response to a probe to 0.1 seconds (Default is 5.0) :

# traceroute www.google.com -w 0.1

d. Find the network path from my centos6 server to google.com and set the number of probes per each hop to 5 (Default is 3) :

# traceroute www.google.com -q 5

5. Display basic command line options help for more usage :

# traceroute --help
Usage:
  traceroute [ -46dFITnreAUV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w waittime ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] host [ packetlen ]
Options:
  -4                          Use IPv4
  -6                          Use IPv6
  -d  --debug                 Enable socket level debugging
  -F  --dont-fragment         Do not fragment packets
  -f first_ttl  --first=first_ttl
                              Start from the first_ttl hop (instead from 1)
  -g gate,...  --gateway=gate,...
                              Route packets through the specified gateway
                              (maximum 8 for IPv4 and 127 for IPv6)
  -I  --icmp                  Use ICMP ECHO for tracerouting
  -T  --tcp                   Use TCP SYN for tracerouting
  -i device  --interface=device
                              Specify a network interface to operate with
  -m max_ttl  --max-hops=max_ttl
                              Set the max number of hops (max TTL to be
                              reached). Default is 30
  -N squeries  --sim-queries=squeries
                              Set the number of probes to be tried
                              simultaneously (default is 16)
  -n                          Do not resolve IP addresses to their domain names
  -p port  --port=port        Set the destination port to use. It is either
                              initial udp port value for "default" method
                              (incremented by each probe, default is 33434), or
                              initial seq for "icmp" (incremented as well,
                              default from 1), or some constant destination
                              port for other methods (with default of 80 for
                              "tcp", 53 for "udp", etc.)
  -t tos  --tos=tos           Set the TOS (IPv4 type of service) or TC (IPv6
                              traffic class) value for outgoing packets
  -l flow_label  --flowlabel=flow_label
                              Use specified flow_label for IPv6 packets
  -w waittime  --wait=waittime
                              Set the number of seconds to wait for response to
                              a probe (default is 5.0). Non-integer (float
                              point) values allowed too
  -q nqueries  --queries=nqueries
                              Set the number of probes per each hop. Default is
                              3
  -r                          Bypass the normal routing and send directly to a
                              host on an attached network
  -s src_addr  --source=src_addr
                              Use source src_addr for outgoing packets
  -z sendwait  --sendwait=sendwait
                              Minimal time interval between probes (default 0).
                              If the value is more than 10, then it specifies a
                              number in milliseconds, else it is a number of
                              seconds (float point values allowed too)
  -e  --extensions            Show ICMP extensions (if present), including MPLS
  -A  --as-path-lookups       Perform AS path lookups in routing registries and
                              print results directly after the corresponding
                              addresses
  -M name  --module=name      Use specified module (either builtin or external)
                              for traceroute operations. Most methods have
                              their shortcuts (`-I' means `-M icmp' etc.)
  -O OPTS,...  --options=OPTS,...
                              Use module-specific option OPTS for the
                              traceroute module. Several OPTS allowed,
                              separated by comma. If OPTS is "help", print info
                              about available options
  --sport=num                 Use source port num for outgoing packets. Implies
                              `-N 1'
  -U  --udp                   Use UDP to particular port for tracerouting
                              (instead of increasing the port per each probe),
                              default port is 53
  -UL                         Use UDPLITE for tracerouting (default dest port
                              is 53)
  -P prot  --protocol=prot    Use raw packet of protocol prot for tracerouting
  --mtu                       Discover MTU along the path being traced. Implies
                              `-F -N 1'
  --back                      Guess the number of hops in the backward path and
                              print if it differs
  -V  --version               Print version info and exit
  --help                      Read this help and exit

Arguments:
+     host          The host to traceroute to
      packetlen     The full packet length (default is the length of an IP
                    header plus 40). Can be ignored or increased to a minimal
                    allowed value

How to Install wget on Linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7

Wget is a free network utility to download files from the Web using http and ftp, the two most widely used Internet protocols. Wget utility is available for free and licensed is under GNU GPL License. However, it’s also supports https protocol as well as retrieval through HTTP proxies. This article will describe how to install wget on linux RHEL 6/7, CentOS 6/7 and Oracle Linux 6/7.

Symptom:
When you try to download something from linux server, you get this error message.

# wget http://pkgs.repoforge.org/yum/yum-2.4.2-0.4.el5.rf.noarch.rpm
-bash: wget: command not found

Findings:
Looks like you don’t have wget installed on your linux server

Solution:
Please install wget using yum command as below.

# yum install wget -y

How to download single file without change the file name :

# wget http://pkgs.repoforge.org/yum/yum-2.4.2-0.4.el5.rf.noarch.rpm

How to download file using wget with different name ?

# wget -O wget-filename.zip http://pkgs.repoforge.org/yum/yum-2.4.2-0.4.el5.rf.noarch.rpm

I hope this article gives you some ideas and essential guidance on how to install wget on Linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7.