GRV – A Tool for Viewing Git Repositories in Linux Terminal

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘GRV – A Tool for Viewing Git Repositories in Linux Terminal’,media: ‘https://www.tecmint.com/wp-content/uploads/2018/03/GRV-View-Git-Repositories-in-Linux-Terminal.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

systemd-analyze – Find System Boot-up Performance Statistics in Linux

Are you using systemd system and service manager, and your Linux system taking longer time to boot or you simple want to view the reports of your system boot-up performance? If yes, you have landed on the right place.

In this article, we will show you how to analyze a Linux system boot-up performance statistics using systemd-analyze, one of numerous utilities under systemd for system management.

Read Also: How to Control Systemd Services on Remote Linux Server

To get an overview of the system boot-up time, we can run systemd-analyze command without any arguments as follows. It will list information about how much time each service took to start, which includes time taken by kernel, initrd and userspace while booting.

# systemd-analyze
Startup finished in 884ms (kernel) + 3.861s (initrd) + 48.356s (userspace) = 53.102s


If you want to view a list of all running units, sorted by the time they took to initialize (highest time on top), the blame sub-command is used for this purpose. After running the command that follows, use [Enter] to view more services in the list and q to quit.

# systemd-analyze blame 

Find Out Time Each Unit Took to Start

 16.159s mariadb.service
12.178s libvirtd.service
10.298s tuned.service
9.836s postfix.service
8.704s lsws.service
7.352s lscpd.service
4.988s [email protected]
4.779s NetworkManager-wait-online.service
4.577s lvm2-monitor.service
4.439s ModemManager.service
4.413s polkit.service
4.280s dev-sda1.device
4.225s systemd-udev-settle.service
3.957s firewalld.service
3.227s rhel-dmesg.service
3.221s abrt-ccpp.service
3.142s rsyslog.service
3.053s avahi-daemon.service
3.042s pure-ftpd.service
2.249s gssproxy.service
2.212s NetworkManager.service
1.889s proc-fs-nfsd.mount
1.780s systemd-tmpfiles-setup-dev.service
1.451s sshd.service
1.267s rhel-readonly.service
1.035s sysstat.service
1.001s rpc-statd-notify.service
910ms systemd-logind.service
739ms kdump.service
738ms network.service
...

As you can see from the above output that each unit is sorted based on the time taken, you can simply find out which service is taking longer time while booting and analyze the issue.

Next, we can also view a tree of the time-critical chain for the default target or a list of specified units with the critical-chain sub-command as shown.

# systemd-analyze critical-chain 

Print time-critical Chain for Default Target

The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
multi-user.target @48.342s
??mariadb.service @31.560s +16.159s
??network.target @31.558s
??network.service @30.819s +738ms
??NetworkManager-wait-online.service @26.035s +4.779s
??NetworkManager.service @23.821s +2.212s
??network-pre.target @23.821s
??firewalld.service @19.863s +3.957s
??polkit.service @15.381s +4.413s
??basic.target @12.271s
??sockets.target @12.271s
??virtlockd.socket @12.270s
??sysinit.target @12.251s
??systemd-update-utmp.service @12.196s +54ms
??auditd.service @11.705s +486ms
??systemd-tmpfiles-setup.service @11.609s +93ms
??rhel-import-state.service @11.397s +211ms
??local-fs.target @11.363s
??run-user-0.mount @46.910s
??local-fs-pre.target @10.575s
??lvm2-monitor.service @5.996s +4.577s
??lvm2-lvmetad.service @7.376s
??lvm2-lvmetad.socket @5.987s
??-.slice
# systemd-analyze critical-chain ntp.service networking.service

Finally, let’s look at one more important sub-command that allows for producing graphical (svg format) detailing of system services that have been started, and at what time, highlighting their initialization time, as follows.

Make sure graphical display mode or x-windows is enabled in order to view the plot.

# systemd-analyze plot > boot_analysis.svg
# xviewer boot_analysis.svg 
Linux Boot Analysis

Linux Boot Analysis

All the above commands will print the boot-up performance statistics for the local machine. To view information from a remote host over ssh, use the -H flag and specify the [email protected] directive, as shown.

# systemd-analyze time -H [email protected]
# systemd-analyze blame -H [email protected]
# systemd-analyze critical-chain -H [email protected]

systemd-analyze can also be used to find other state and tracing information from the system and systemd (service manager) and more. For more information, see its man page.

# man systemd-analyze 

Read Also: How to Change Runlevels (targets) in SystemD

That’s it for now! If you have any questions or thought to share, use the feedback form below to reach us.

Learn Ethical Hacking Using Kali Linux From A to Z Course

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘Learn Ethical Hacking Using Kali Linux From A to Z Course’,media: ‘https://www.tecmint.com/wp-content/uploads/2018/03/Learn-Ethical-Hacking-with-Kali-Lin.jpg’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

Exodus – Safely Copy Linux Binaries From One Linux System to Another

Exodus is a simple yet useful program for easily and securely copying Linux ELF binaries from one system to another. For example, if you have htop (Linux Process Monitoring Tool) installed on your desktop machine, but not installed on your remote Linux server, exodus gives a way to copy/install the htop binary from the desktop machine to the remote server.

It bundles all of the binary’s dependencies, compiling a statically linked wrapper for the executable that invokes the relocated linker directly, and installing the bundle in the ~/.exodus/ directory, on the remote system.

You can see it in action here.

Exodus Htop Demo


Exodus really comes in handy in two critical cases: 1) if you do not have root access on a machine and/or 2) if the package you want to use is not available for the Linux distribution you are running on another machine.

Install Exodus in Linux Systems


You can install exodus using Python PIP package manager, as follows. The command below will perform a user specific installation (only for the account you have logged on with).

$ sudo apt install python-pip [Install PIP On Debian/Ubuntu]
$ sudo yum install epel-release python-pip [Install PIP On CentOS/RHEL]
$ sudo dnf install python-pip [Install PIP On Fedora]
$ pip install --user exodus-bundler [Install Exodus in Linux] 

Next, add the directory ~/.local/bin/ to your PATH variable in your ~/.bashrc file, in order to run the exodus executable like any other system command.

export PATH="~/.local/bin/:${PATH}"
Add Exodus Path in Bashrc

Add Exodus Path in Bashrc

Save and close the file. Then open another terminal window to start using exodus.

Note: It is also highly recommended that you install gcc and one of either musl libc or diet libc (C libraries used to compile small statically linked launchers for the bundled applications), on the machine where you’ll be packaging binaries.

Use Exodus to Copy Local Binary To a Remote Linux System

Once you have installed exodus, you can copy a local binary (htop tool) to a remote machine by simply running the following command.

$ exodus htop | ssh [email protected]
Exodus Copy Htop Binaries to Remote Linux

Exodus Copy Htop Binaries to Remote Linux

Then login to the remote machine, and add the directory /home/tecmint/.exodus/bin to your PATH in your ~/.bashrc file, in order to run the htop like any other system command.

export PATH="~/.exodus/bin:${PATH}"
Add Exodus Path in Remote Linux Bashrc

Add Exodus Path in Remote Linux Bashrc

Save and close the file, then source it as follows, for the changes to take effect.

$ source ~/.bashrc

Now you should be able to run htop on your remote Linux machine.

$ htop

If you have two or more binaries with the same name (for example, more than one version of htop installed on your system, one /usr/bin/htop and another /usr/local/bin/htop), you can copy and install them in parallel with the -r flag, it enables for assigning of aliases for each binary on the remote machine.

The following command will install the two htop versions in parallel with /usr/bin/grep called htop-1 and /usr/local/bin/htop called htop-2 as shown.

$ exodus -r htop-1 -r htop-2 /usr/bin/htop /usr/local/bin/htop | ssh [email protected]

Attention: Exodus has a number of limitations and it may fail to work with non-ELF binaries, incompatible CPU architectures, incompatible Glibc and kernel versions, driver dependent libraries, pro-grammatically loaded libraries and non-library dependencies.

For more information, see the exodus help page.

$ exodus -h 

Exodus Github repository: https://github.com/intoli/exodus

Conclusion

Exodus is simple yet powerful tool for copying binaries from one Linux machine to another remote Linux system. Try it out and give us your feedback via the comment form below.

How to Setup iSCSI Server (Target) and Client (Initiator) on Debian 9

In the data center world, large capacity Storage Area Networks (SAN) have become the minimum standard. As cloud providers and virtualization also continue to make massive impacts in the technology world, the need for even more SAN storage space has become evident.

Most SAN hardware is comprised of a minimalistic controller (or set of controllers) and a large collection of high capacity drives all configured to support high amounts of data availability and integrity.

Many of these specialized products are made by big name vendors such as Netapp, Dell Equalogic, HP Storageworks, or EMC and have price tags attached to them that only the largest of enterprises can afford.

Realistically, these devices are nothing more than large hard disk arrays with a controller providing the space of those hard disks out to networked clients. Many technologies have existed over the years that provide this functionality or similar functionality at a substantially cheaper price point.


The Debian GNU/Linux distribution provides packages that allow a Debian system to serve the purpose of an enterprise level SAN storage device at a mere fraction of the cost! This allows everyone from basic home users or large data-centers to obtain the benefits of SAN storage without having to spend a fortune on a vendor proprietary solution.

This article will look at how a Debian 9 (Stretch) system can be setup to serve out disk space using a system known as Internet Small Computer Systems Interface or iSCSI for short. iSCSI is an Internet Protocol (IP) based standard for providing block (hard drive) storage to other systems. iSCSI works in a client server model but uses different names to distinguish the client from the server.

In iSCSI terminology, the server that is serving out the ‘disk space‘ is known as an iSCSITarget‘ and the system that is requesting/utilizing the disk space is known as the iSCSI ‘Initiator‘. So in other words, an ‘Initiator‘ requests block storage from a ‘Target‘.

Environment Setup

This guide will walk through a basic setup involving a simple iSCSI server (target) and client (initiator) both running Debian 9 (Stretch).

Debian iSCSI Target: 192.168.56.101/24
Storage: Contains two extra hard drives to be used as the storage in the iSCSI setup
Debian iSCSI Initiator: 192.168.56.102/24

The network can be viewed as below:

Debian iSCSI Network Diagram

Debian iSCSI Network Diagram

Debian iSCSI Target Configuration

In the iSCSI world, the target is considered the host that contains the storage devices to be used by the initiator.

In this article the server with the IP of 192.168.56.101 is being used as the target. All configurations will be done on that host for this section.

The first step is the installation of the necessary packages to allow the Debian system to serve out iSCSI targets. This software package is known as Target Framework (TGT).

The other item that is being used for this guide is the Logical Volume Management (LVM) tools as Logical Volumes (LVs) will be used as the storage backing for the iSCSI target.

Both packages can be installed with the following commands.

# apt-get update
# apt-get install tgt lvm2

Once the packages are installed, LVM will be used to prepare the hard disks on the target for use as an iSCSI LUN. The first command is used to prepare the disks for inclusion in a LVM setup. Be sure to modify the command as needed for different scenarios!

# lsblk (Only used to confirm disks to be used in the LVM setup)
# pvcreate /dev/sd{b,c}
Confirm and Create LVM Setup

Confirm and Create LVM Setup

Once the disks have been prepared with the above ‘pvcreate‘ command, it is time to create a volume group out of these particular disks. The volume group is required in order to create the Logical Volumes that will act as the iSCSI storage later.

To create a volume group, the ‘vgcreate‘ command is needed.

# vgcreate tecmint_iscsi /dev/sd{b,c}
# vgs (Only needed to confirm the creation of the volume group)
Create Volume Group in Debian

Create Volume Group in Debian

Notice in the output above that the system responds that the Volume Group was created but it is always a good idea to double check as seen above with the ‘vgs‘ command. The capacity of this volume group is only 9.99GB. While this is a particularly small volume group, the process would be the same for disks of larger capacity!

The next step is the creation of the logical volume that will act as the disk to the iSCSI client (initiator). For this example the entirety of the the volume group will be used but isn’t necessary.

The logical volume will be created using the ‘lvcreate‘ command.

# lvcreate -l 100%FREE tecmint_lun1 tecmint_iscsi
# lvs (Simply used to confirm the creation of the logical volume)
Create Logical Volume in Debian

Create Logical Volume in Debian

The above ‘lvcreate‘ command might be a little confusing at first glance but the break down is as such:

  • lvcreate – Command used to create the logical volume.
  • -l 100%FREE – Create the logical volume using all of the volume group’s free space.
  • -n tecmint_lun1 – The name of the logical volume to be created.
  • tecmint_iscsi – The name of the volume group to create the logical volume within.

Once the logical volume has been created, it’s time to create the actual LUN (Logical Unit Number). The LUN will be the storage device that the initiator will connect to and use later.

Creating a LUN is very simple and requires only a few steps. The first step will be the creation of the configuration file. This file will reside in the ‘/etc/tgt/conf.d‘ directory and for this article it will be called ‘TecMint_iscsi.conf‘.

To create this file use a text editor.

# nano /etc/tgt/conf.d/TecMint_iscsi.conf

Within this file, all the necessary configuration information for this LUN will be configured. There are a lot of options that can be placed in this file but for now a basic LUN with mutual Challenge Handshake Authentication Protocol (CHAP) will be configured.

The LUN’s definition will exist between two ‘target‘ statements. For more parameters that can go in the target statement, review the manual page for the ‘targets.conf‘ file by issuing ‘man 5 targets.conf‘.

<target iqn.2018-02.tecmint.com:lun1>
# Provided device as an iSCSI target
backing-store /dev/mapper/tecmint_iscsi-tecmint_lun1
initiator-address 192.168.56.102
incominguser tecmint-iscsi-user password
outgoinguser debian-iscsi-target secretpass
</target>

There’s a lot going on above. A quick explanation may be helpful to most.

  • The first line begins the particular iSCSI LUN configuration. In this case the LUN labeled ‘iqn.2018-02.tecmint.com:lun1‘. The ‘iqn‘ part indicates that this will be an iSCSI qualified name. The ‘2018-02‘ is an arbitrarily chosen date combination. ‘tecmint.com‘ is the domain that this particular LUN belongs. Finally, the ‘lun1‘ is used as the name for this particular target.
  • The second line above illustrates a comment. Comments can exist in the target configuration files and must be prefaced with a ‘#‘ symbol.
  • The third line is where the actual storage space that will be used by the initiator exists. In this case the storage backing will be the logical volume that was created earlier in the guide.
  • The fourth line is the IP address that is expected from the initiator. While this isn’t a required configuration item, it can help increase security.
  • The fifth line is the incoming username/password. Much like the initiator address above, this parameter isn’t required either but can help to secure the LUN. Since this guide is also covering iSCSI mutual CHAP, this parameter is required. This line indicates the username and password that the target will expect from the initiator in order to connect to this LUN.
  • The sixth line is the username/password that the target will provide to the initiator to allow for mutual CHAP authentication to take place. Normally this parameter is not required but this article is covering mutual CHAP authentication so this parameter is required.
  • The final line is the closing statement for the target definition. Pay attention to the closing slash in front of the keyword target!

Once the appropriate configurations for the LUN have been typed out, save the changes and exit the text editor. If using nano, hit ctrl+o to save and then hit ctrl+x to exit nano.

Create LUN Configuration File

Create LUN Configuration File

Once the configuration file has been created, the tgt service should be restarted so tgt is aware of the new targets and the associated configuration.

This can be done with one of the following commands and is dependent on the init system in use.

# service tgt restart (For sysv init systems)
# systemctl restart tgt (For systemd init systems)

Once tgt has been restarted, it is important to check to ensure that the iSCSI target is being made available according to the configuration file created.

This can be accomplished with the ‘tgtadm‘ command.

# tgtadm --mode target --op show (This will show all targets)
Show All iSCSI Targets

Show All iSCSI Targets

This concludes the configuration of the target. The next section will work through the configuration of the initiator.

Debian iSCSI Initiator Configuration

The next step in using the previously configured iSCSI target is the configuration of the iSCSI initiator.

A different Debian 9 system will be used as the initiator in this article but any system that can utilize the iSCSI protocol can connect to the previously configured target; this could include hypervisors like XenServer/ESXi or other distributions like Red Hat, Debian, or Ubuntu.

The first step in this process for this Debian initiator is the installation of the proper packages for iSCSI.

# apt-get update
# apt-get install open-iscsi

Once apt has finished the configuration of the open-iscsi packages, the iSCSI initiator configuration can begin. The first step will be to communicate with the target to get the initial configuration information for the target prepared.

# iscsiadm -m discovery -t st -p 192.168.56.101

When this command runs, it will respond back with the name of the lun configured earlier for this particular host. The above command will also generate two files for the newly discovered LUN information.

Connect iSCSI Target Server

Connect iSCSI Target Server

Now the file created for this node will need to have the CHAP information configured in order for this iSCSI target to actually be accessible by the initiator.

Technically this information could be setup for the entire system as a whole but in the event that a host connects to different LUNs with different credentials, placing those credentials in the specific node configuration file can mitigate any issues.

The node configuration file will exist in the directory ‘/etc/iscsi/nodes/‘ and will have a directory per LUN available. In the case of this article (note that paths will change if names/IP addresses are changed).

# /etc/iscsi/nodes/iqn.2018-02.tecmint.com\:lun1/192.168.56.101\,3260\,1/default

To work with this file, any text editor can be used.

# nano /etc/iscsi/nodes/iqn.2018-02.tecmint.com\:lun1/192.168.56.101\,3260\,1/default

Within this file there will be several already configured options for the respective target that were determine during the ‘iscsiadm‘ command run earlier.

Since this particular Debian target/initiator setup is using mutual CHAP, some more options need to be changed and added to this file and then a login to the iSCSI target performed.

The changes to this file are:

node.session.auth.authmethod = CHAP #Enable CHAP Authentication
node.session.auth.username = tecmint-iscsi-user #Target to Initiator authentication
node.session.auth.password = password #Target to Initiator authentication
node.session.auth.username_in = debian-iscsi-target #Initiator to Target authentication
node.session.auth.password_in = secretpass #Initiator to Target authentication

The above options will allow this target to authenticate to the initiator as well as allow the initiator to authenticate to the target.

There is another option in this particular file that may need to be changed depending on the administrator’s preferences and that is the ‘node.startup‘ parameter.

If following this guide, the ‘node.startup‘ option will be set to ‘manual‘ at this point. This may not be desired. If the administrator wishes to have the iSCSI target connected when the system starts up, change ‘manual‘ to ‘automatic‘ as such:

node.startup = automatic

Once the above changes have been made, save the file and exit. At this point the open-iscsi initiator service needs to be restarted in order to read these new changes and connect to the iSCSI target.

This can be accomplished with one of the following commands depending on the init system in use.

# service open-iscsi restart (For sysv init systems)
# systemctl restart open-iscsi (For systemd init systems)
Restart Open Iscsi Initiator

Restart Open Iscsi Initiator

Notice in the green box above that the iSCSI initiator was able to log into the target. To further confirm that the iSCSI target is indeed available to the initiator, we can check the system for extra disk drives that are available using the ‘lsblk‘ command and checking the output for extra drives.

# lsblk
Check iSCSI Target Disk

Check iSCSI Target Disk

The other command that can be used on the initiator to confirm a connection to the target is ‘iscsiadm‘ as such:

# iscsiadm -m session
Confirm Connection to ISCSI Target

Confirm Connection to ISCSI Target

The final place to confirm a connection would be on the target itself using the ‘tgtadm‘ command to list any iSCSI connections.

# tgtadm --mode conn --op show --tid 1
List iSCSI Connections

List iSCSI Connections

From this point, the newly attached iSCSI device can be used similar to any normally attached disk! Partitioning, filesystem creation, mounting, and/or persistent mounting can all able be handled normally.

One big caution to be aware of with iSCSI devices is if the iSCSI target contains important filesystems that are needed as the initiator is booting, make sure to use the ‘_netdev‘ entry in the ‘/etc/fstab‘ file to ensure that the iSCSI device is connected before the system continues booting!

How to Install Particular Package Version in CentOS and Ubuntu

Usually, when you install a package in CentOS and Ubuntu, the package management software selects the latest package version from the repository, by default. However, sometimes, for one reason or the other, you may want to install a specific package version on your Linux system.

In this article, we will explain how to install a particular or specific package version in CentOS and Ubuntu using Yum and APT front-end package managers, respectively.

Install Specific Package Version in CentOS/RHEL/Fedora

First, you need to check for all the available versions of a package, whether installed or not. Normally, yum ignores specific versions of a package and will always try to install the latest version available.

Secondly, when you try to find info about a package, yum only shows the latest version of that package in the output of info, list or search sub-commands; but using the --showduplicates switch, you can display all package versions present in the repository.

# yum --showduplicates list nginx
List All Package Versions in CentOS

List All Package Versions in CentOS


From the above command output, the naming format for packages are:

package_name.architecture version_number–build_number repository

The build_number represents minor changes made by the package maintainer, not by the program author, such as additional documentation, changes to configuration files, or bug fixes and more.

Once you have identified the specific version of a package (for example nginx-1.10.3-1.el7.ngx), install it as follows. Note that the name format will have to change here, to the full RPM desired, package_name-version_number as shown in the following command.

# yum install nginx-1.10.3

Alternatively, if you want to use a version with certain updates, specify the build_number (package_name-version_number-build_number) as shown.

# yum install nginx-1.10.3-1.el7.ngx
Install Particular Package Version in CentOS

Install Particular Package Version in CentOS

Considering the above situation, a newer version of the packages is already installed on the system. Therefore, you need to remove the installed package version, if you want to install an older version from the available packages as shown.

# yum remove nginx

Once you have removed the installed package, you can then install the specific version you desire as explained above.

Install Specific Package Version in Ubuntu and Debian

First check the version of the package installed on your system plus all available packages in the repository, using the apt-cache command below.

$ apt-cache policy firefox
Check Installed Package Version in Ubuntu

Check Installed Package Version in Ubuntu

To install a specific package version, use the following command with syntax below.

$ sudo apt install firefox=45.0.2+build1-0ubuntu1
Install Specific Package Version in Ubuntu

Install Specific Package Version in Ubuntu

If a newer version of a package is already installed on your Ubuntu system, you can remove it and then install the version you want.

$ sudo apt remove firefox
$ sudo apt install firefox=45.0.2+build1-0ubuntu1

That’s all! For more information, refer to the yum, apt, apt-cache man pages. If you have any queries, use the comment form below to get to us.

How to Enable and Disable Root Login in Ubuntu

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘How to Enable and Disable Root Login in Ubuntu’,media: ‘https://www.tecmint.com/wp-content/uploads/2012/10/Enable-Root-Login-in-Ubuntu.jpg’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

8 Best Tools to Access Remote Linux Desktop

Accessing a remote desktop computer is made possible by the remote desktop protocol (RDP), a proprietary protocol developed by Microsoft. It gives a user a graphical interface to connect to another/remote computer over a network connection. FreeRDP is a free implementation of the RDP.

RDP works in a client/server model, where the remote computer must have RDP server software installed and running, and a user employs RDP client software to connect to it, to manage the remote desktop computer.

In this article, we will share a list software for accessing a remote Linux desktop: the list starts off with VNC applications.

VNC (Virtual Network Computing) is a server-client protocol which allows user accounts to remotely connect and control a distant system by using the resources provided by the Graphical User Interface (GUI).

1. TigerVNC


TigerVNC is a free, open source, high-performance, platform-neutral VNC implementation. It is a client/server application that allows users to launch and interact with graphical applications on remote machines.

Unlike other VNC servers such as VNC X or Vino that connect directly to the runtime desktop, tigervnc-vncserver uses a different mechanism that configures a standalone virtual desktop for each user.

It is capable of running 3D and video applications, and it attempts to maintain consistent user interface and re-use components, where possible, across the various platforms that it supports. In addition, it offers security through a number of extensions that implement advanced authentication methods and TLS encryption.

Learn How to Install and Configure VNC Server in CentOS 7

2. RealVNC

RealVNC offers cross-platform, simple and secure remote access software. It develops VNC screen sharing technologies with products such as VNC Connect and VNC Viewer. VNC connect gives you the ability to access remote computers, provide remote support, administer unattended systems, share access to centralized resources and much more.

You can get VNC connect for free for home use, which is limited to five remote computers and three users. However, for any professional and enterprise use, requires a subscription fee.

3. TeamViewer

Teamviewer is a popular, powerful, secure and cross-platform remote access and control software that can connect to multiple devices simultaneously. It is free for personal use and there is a premium version for businesses users.

It is an all-in-one application for remote support used for remote desktop sharing, online meetings and file transfer between devices connected over the Internet. It supports more than 30 languages around the world.

4. Remmina

Remmina is a free and open-source, fully featured and powerful remote desktop client for Linux and other Unix-like systems. It is written in GTK+3 and intended for system administrators and travelers, who need to remotely access and work with many computers.

It is efficient, reliable and supports multiple network protocols such as RDP, VNC, NX, XDMCP and SSH. It also offers an integrated and consistent look and feel.

Remmina allows users to maintain a list of connection profiles, organized by groups, supports quick connections by users directly putting in the server address and it provides a tabbed interface, optionally managed by groups plus many more features.

5. NoMachine

NoMachine is a free, cross platform and high quality remote desktop software. It offers you a secure personal server. Nomachine allows you to access all your files, watch videos, play audio, edit documents, play games and move them around.

It has an interface that lets you concentrate on your work and is designed to work in a fast manner as if you are seated right in front of your remote computer. In addition, it has remarkable network transparency.

6. Apache Guacamole

Apache Guacamole is a free and open source client-less remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH. It requires no plugins or client software; simply use an HTML5 web application such as a web browser.

This means that, use of your computers is not tied to any one device or location. Furthermore, if you want to employ it for business use, you can get dedicated commercial support via third-party companies.

7. XRDP

XRDP is a free and open source, simple remote desktop protocol server based on FreeRDP and rdesktop. It uses the remote desktop protocol to present a GUI to the user. It can be used to access Linux desktops in conjunction with x11vnc.

It greatly, integrates with LikwiseOPEN thus enabling you to login to a Ubuntu server via RDP using active directory username/password. Although, XRDP is good project, it needs a number of fixes such as taking over an existing desktop session, running on Red Hat-based Linux distributions and more. The developers also need to improve its documentation.

8. FreeNX

FreeNX is an open source, fast and versatile remote access system. It is a secure (SSH based) client /server system, and it’s core libraries are provided by NoMachine.

Unfortunately, at the time of this writing, the link to the FreeNX website did not work, but we have provided links to the distro-specific web pages:

  1. Debian: https://wiki.debian.org/freenx
  2. CentOS: https://wiki.centos.org/HowTos/FreeNX
  3. Ubuntu: https://help.ubuntu.com/community/FreeNX
  4. Arch Linux: https://wiki.archlinux.org/index.php/FreeNX

That’s all! In this article, we reviewed eight best tools to access remote Linux desktops. Feel free to share your thoughts with us via the comment form below.

How to Install NetBeans IDE 8.2 in Debian, Ubuntu and Linux Mint

The NetBeans is an open source and award-winning IDE (integrated development environment) application for Windows, Linux, Solaris and Mac. The NetBeans IDE provides a much powerful Java application framework platform that allows programmers to easily develop Java based web applications, mobile applications and desktops. It is one of the best IDEs for C/C++ programming, and also it provides vital tools for PHP programmers.

The IDE is the only first editor, that provides support for many languages like PHP, C/C++, XML, HTML, Groovy, Grails, Ajax, Javadoc, JavaFX, and JSP, Ruby and Ruby on Rails.

The editor is feature-rich and provides an extensive range of tools, templates and samples; and it’s highly extensible using community developed plugins, thus making it well suited for software development.

This article guides you on how to install the latest version of NetBeans IDE 8.2 in Debian, Ubuntu and Linux Mint distributions.

Requirements:

  1. A Desktop machine with minimum 2GB of RAM.
  2. The Java SE Development Kit (JDK) 8 is required to install NetBeans IDE (NetBeans 8.2 does not run on JDK9).


Read Also: How to Install NetBeans IDE in CentOS, RHEL and Fedora

Install Java JDK 8 in Debian, Ubuntu and Linux Mint

1. To install Java 8 JDK version, first add following webupd8team/java PPA to your system and update the repository package database as shown.

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update

2. Once PPA has been added and updated, now search for the packages with name oracle-java8 and install it as shown.

$ apt-cache search oracle-java8
$ sudo apt-get install oracle-java8-installer

If you have more than one Java installed on your system, you can install oracle-java8-set-default package to set Java 8 as default as shown.

$ sudo apt-get install oracle-java8-set-default

Please note that the same webupd8team/java PPA also offers older and newer versions of Java packages like Java 7 and Java 9.

Install NetBeans IDE in Debian, Ubuntu and Linux Mint

3. Now oen a browser, navigate to NetBeans IDE download page and download the latest NetBeans IDE installer script for your installed Linux distribution.

Alternatively, you can also download NetBeans IDE installer script in your system via wget utility, by issuing the below command.

$ wget -c http://download.netbeans.org/netbeans/8.2/final/bundles/netbeans-8.2-linux.sh

4. After the download completes, navigate to the directory where the NetBeans IDE installer has been downloaded and issue the below command to make the installer script executable and start installing it.

$ chmod +x netbeans-8.2-linux.sh $ ./netbeans-8.2-linux.sh

5. After running the installer script above, the installer “Welcome page” will show up as follows, click Next to continue (or customize your installation by clicking on Customize) to follow the installation wizard.

Netbeans Installer

Netbeans Installer

6. Then read and accept the terms in the license agreement, and click on Next to continue.

License NetBeans IDE

License NetBeans IDE

7. Next, select the NetBeans IDE 8.2 installation folder from the following interface, then click Next to continue.

NetBeans IDE Installation Folder

NetBeans IDE Installation Folder

8. Also select the GlassFish server installation folder from the following interface, then click Next to proceed.

GlassFish Installation Folder

GlassFish Installation Folder

9. Next enable auto updates updates for installed plugins via the check box in the following screen which shows the installation summary, and click Install to install the NetBeans IDE and runtimes.

Enable NetBeans IDE Updates

Enable NetBeans IDE Updates

10. When the installation is complete, click on Finish and restart machine to enjoy NetBeans IDE.

NetBeans IDE Installation Completes

NetBeans IDE Installation Completes

NetBeans IDE in Ubuntu

NetBeans IDE in Ubuntu

Congratulations! You’ve successfully installed the latest version of NetBeans IDE 8.2 in your Debian/Ubuntu Linux based system. If you have queries use the comment form below to ask any questions or share your thoughts with us.

How to Install NetBeans IDE in CentOS, RHEL and Fedora

In this article, we will cover the installation process of the latest version of NetBeans IDE 8.2 in CentOS, Red Hat and Fedora based Linux distributions.

NetBeans IDE (Integrated Development Environment) is a free and open source, cross platform IDE that works on Linux, Windows and Mac OSX, and is now the official IDE for Java 8.

It offers remarkable support for latest Java technologies, supports multiple languages, allows for fast and smart code editing. It also helps users to easily and efficiently manage their projects, with powerful editors, code analyzers, and converters plus so much more.

It is intended for developing Java desktop, mobile, and web applications, and HTML5 applications with HTML, JavaScript, and CSS. NetBeans IDE is also among the best IDEs for C/C++ programming, and also it provides vital tools for PHP programmers.

NetBeans IDE 8.2 Features:

  • ECMAScript 6 and Experimental ECMAScript 7 support.
  • Oracle JET (JavaScript Extension Toolkit) support enhancements.
  • PHP 7 and Docker support.
  • Support for Node.js 4.0 and newer.
  • Offers editor multicarets.
  • Provides pinnable watches.
  • Comes with SQL profiling improvements.
  • C/C++ enhancements.

Requirements:

  1. A Desktop machine with minimum 2GB of RAM.
  2. The Java SE Development Kit (JDK) 8 is required to install NetBeans IDE (NetBeans 8.2 does not run on JDK9).


Read Also: How to Install NetBeans IDE in Debian, Ubuntu and Linux Mint

Install Java JDK 8 in CentOS, RHEL and Fedora

1. To install Java 8 JDK in your Desktop machine, open a browser and navigate to Java SE official download page and grab the latest .rpm binary package in your system.

For reference, we have provided the rpm file-name, please select the below mentioned file only.

jdk-8u161-linux-i586.rpm [On 32-bit]
jdk-8u161-linux-x64.rpm [On 64-bit]

Alternatively, you may use wget utility to download Java 8 RPM package by issuing the below commands

-------- For 32-bit OS -------- # wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-i586.rpm
-------- For 64-bit OS --------
# wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.rpm

2. After Java .rpm file download completes, navigate to the directory where Java package has been downloaded and install Java 8 JDK by issuing the below command. Answer with “y” (yes) when prompted in order to accept the package installation process made by system installer.

# yum install jdk-8u161-linux-i586.rpm [On 32-bit]
# yum install jdk-8u161-linux-x64.rpm [On 64-bit]

Install NetBeans IDE in CentOS, RHEL and Fedora

3. Now oen a browser, navigate to NetBeans IDE download page and download the latest NetBeans IDE installer script for your installed Linux distribution.

Alternatively, you can also download NetBeans IDE installer script in your system via wget utility, by issuing the below command.

# wget -c http://download.netbeans.org/netbeans/8.2/final/bundles/netbeans-8.2-linux.sh

4. After the download completes, navigate to the directory where the NetBeans IDE installer has been downloaded and issue the below command to make the installer script executable and start installing it.

# chmod +x netbeans-8.2-linux.sh # ./netbeans-8.2-linux.sh

5. After running the installer script above, the installer “Welcome page” will show up as follows, click Next to continue (or customize your installation by clicking on Customize) to follow the installation wizard.

Netbeans Installer

Netbeans Installer

6. Then read and accept the terms in the license agreement, and click on Next to continue.

License NetBeans IDE

License NetBeans IDE

7. Next, select the NetBeans IDE 8.2 installation folder from the following interface, then click Next to continue.

NetBeans IDE Installation Folder

NetBeans IDE Installation Folder

8. Also select the GlassFish server installation folder from the following interface, then click Next to proceed.

GlassFish Installation Folder

GlassFish Installation Folder

9. Next enable auto updates updates for installed plugins via the check box in the following screen which shows the installation summary, and click Install to install the NetBeans IDE and runtimes.

Enable NetBeans IDE Updates

Enable NetBeans IDE Updates

10. When the installation is complete, click on Finish and restart machine to enjoy NetBeans IDE.

NetBeans IDE Installation Completes

NetBeans IDE Installation Completes

NetBeans IDE 8.2

NetBeans IDE 8.2

Congratulations! You’ve successfully installed the latest version of NetBeans IDE 8.2 in your Red Hat Linux based system. If you have queries use the comment form below to ask any questions or share your thoughts with us.