Wednesday, September 14, 2016

How to enable EPEL Repo

EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

Why we use EPEL repository?

  • Provides lots of open source packages to install via Yum.
  • Epel repo is 100% open source and free to use.
  • It does not provide any core duplicate packages and no compatibility issues.
  • All epel packages are maintained by Fedora repo.

How To Enable EPEL Repository in RHEL/CentOS 7/6/5?

First, you need to download the file using Wget and then install it using RPM on your system to enable the EPEL repository.
Repo Link - https://dl.fedoraproject.org/pub/epel/

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


How Do I Verify EPEL Repo?

# yum repolist

Sample Output

Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* epel: ftp.cuhk.edu.hk
* extras: centos.aol.in
* rpmforge: be.mirror.eurid.eu
* updates: centos.aol.in
Reducing CentOS-5 Testing to included packages only
Finished
1469 packages excluded due to repository priority protections
repo id                           repo name                                                      status
base                              CentOS-5 - Base                                               2,718+7
epel Extra Packages for Enterprise Linux 5 - i386 4,320+1,408
extras                            CentOS-5 - Extras                                              229+53
rpmforge                          Red Hat Enterprise 5 - RPMforge.net - dag                      11,251
repolist: 19,075

How Do I Use EPEL Repo?


# yum --enablerepo=epel info zabbix

Let’s install Zabbix package using epel repo option –enablerepo=epel switch.

# yum --enablerepo=epel install zabbix

Source : Tecmint

Can we install Docker in Linux older versions?

Docker requires a 64-bit installation regardless of your Red Hat version. Docker requires that your kernel must be 3.10 at minimum, which Red Hat 7 runs.

Docker is supported on the following versions of RHEL:

Red Hat Enterprise Linux 7 (64-bit)
Red Hat Enterprise Linux 6.5 (64-bit) or later



The Red Hat provided, maintained, and supported version of Docker is only available on RHEL 7.

Red Hat does not recommend running any version of Docker on any RHEL 6 releases. Docker feature developments are tied to RHEL7 infrastructure components for kernel, devicemapper (thin provisioning, direct lvm), sVirt and systemd.

Red Hat Enterprise Linux 6.5 Installation

You will need 64 bit RHEL 6.5 or later, with a RHEL 6 kernel version 2.6.32-431 or higher as this has specific kernel fixes to allow Docker to work.

Docker is available for RHEL6.5 on EPEL. Please note that this package is part of Extra Packages for Enterprise Linux (EPEL), a community effort to create and maintain additional packages for the RHEL distribution.

How Linux commands works?

Commands are essentially user space applications that mostly use system library (libc) to talk to kernel. Libc has system call wrappers to talk to kernel.

Here are the things that happens when you type a command and hit enter :

1> Shell checks if the command issues is a builtin. Builtins are commands that shell provides and are implemented within the shell code itself. For example, cd is a shell builtin. It just executes chdir() to $HOME within shell code.

2> If the command issued is not a shell builtin, it is searched in the standard paths as speciefied by $PATH. If it is found, shell creates a new child using fork(), and execs the command in the child using execve() system call. Shell waits for all the children it has forked. Shell also manages the terminal association for the fore ground process.

3> If the command is not found in the path and no relative or full path is specified when the command was issued, then shell will return an error.

SOURCE : QUORA

How to display welcome message if user has logged in from a particular IP (or host)?

1. Edit /etc/ssh/sshd_config and change "PrintLastLog" to "no". Save file and restart sshd

2. If you want to display this message for a specific user edit (or create) ~user/.bash_profile and add these lines at the end of the file:

==========cut here==========
REMOTE_IP=`echo $SSH_CONNECTION | cut -f1 -d " "`
if [ $REMOTE_IP == '10.5.226.172' ] ;
then echo "So, it's you again..." ;
else echo "Hi, stranger...";
fi
==========cut here==========

3. If you want this for all users, the same snippet goes to /etc/profile of in a new file in /etc/profile.d

Sunday, September 11, 2016

How to update a single package in ubuntu/kubuntu

In order to update a single package using the CLI: you need to add the option '--only-upgrade install'

sudo apt-get --only-upgrade install <packagename>

e.g., sudo apt-get --only-upgrade install ack

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Skipping **ack**, it is not installed and only upgrades are requested.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Upgrade firefox in Ubuntu/Kubuntu

Step1: Adding Firefox PPA key

Copy paste this code in your terminal
   
sudo add-apt-repository ppa:mozillateam/firefox-next

Step 2: Update

→ To finish indexing the repository

→ Please don’t close the terminal window before completing the update process.
   
sudo apt-get update

Step 3: Installing/updating Firefox

sudo apt-get install firefox

Friday, September 9, 2016

apt-get basic options

apt-get - Package management (like yum) via apt-get runs hand-in-hand with the /etc/apt/sources.list file.

dpkg - is a tool to install, build, remove and manage Debian packages(like rpm).

List packages - apt-cache pkgnames
Search for a package - apt-cache search vsftpd
Find all packages starting with ‘vsftpd‘-   -apt-cache pkgnames vsftpd
Check Package Information - apt-cache show netcat


Update System Packages -  sudo apt-get update
he ‘update‘ command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.


Upgrade Software Packages - sudo apt-get upgrade

The ‘upgrade‘ command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.

More: http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/