<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Linux Juggernaut</title>
	<atom:link href="https://www.linuxnix.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.linuxnix.com</link>
	<description>roles on..!</description>
	<lastBuildDate>Wed, 19 May 2021 03:35:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.17</generator>

<image>
	<url>https://www.linuxnix.com/wp-content/uploads/2011/05/cropped-Untitleddrawing3-32x32.png</url>
	<title>The Linux Juggernaut</title>
	<link>https://www.linuxnix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Google Cloud basics: Activate Cloud Shell</title>
		<link>https://www.linuxnix.com/google-cloud-basics-activate-cloud-shell/</link>
					<comments>https://www.linuxnix.com/google-cloud-basics-activate-cloud-shell/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Wed, 19 May 2021 03:35:16 +0000</pubDate>
				<category><![CDATA[Basics]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=9204</guid>

					<description><![CDATA[<p>Introduction Google CLoud like it&#8217;s popular contemporary cloud vendors offers a means to manage cloud resources via the command line. The folks at GCP refer to this command line interface as cloud shell and it uses the gcloud sdk. One of the benefits of using cloud shell is that it can be launched directly from [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/google-cloud-basics-activate-cloud-shell/">Google Cloud basics: Activate Cloud Shell</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter size-large"><img width="599" height="172" src="https://www.linuxnix.com/wp-content/uploads/2021/05/google-cloud-activate-cloud-shell.jpg" alt="" class="wp-image-9210" /></figure></div>



<h2>Introduction</h2>



<p>Google CLoud like it&#8217;s popular contemporary cloud vendors offers a means to manage cloud resources via the command line. The folks at GCP refer to this command line interface as cloud shell and it uses the gcloud sdk. One of the benefits of using cloud shell is that it can be launched directly from the Google Cloud console. In this post, we&#8217;ll demonstrate how to familiarize yourself with cloud shell while explaining some Google Cloud terminology along the way.</p>



<h3>Activate Cloud Shell</h3>



<p>Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources. In the Cloud Console, in the top right tool bar, click the Activate Cloud Shell button and click Continue when prompted. It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID.</p>



<h3>What is a project?</h3>



<p>Any Google Cloud resources that you allocate and use must belong to a project. You can think of a project as the organizing entity for what you&#8217;re building. A project is made up of the settings, permissions, and other metadata that describe your applications. Resources within a single project can work together easily.</p>



<p>gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion. You can list the active account name with the following command (Click authorize when prompted):</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT</strong></pre>



<p>You can list the project ID with this command:</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud config list project
[core]
project = labenv-gcp-03-2092e8d44a01</strong>
<strong>Your active configuration is: [cloudshell-18628]
sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$</strong></pre>



<p>After Cloud Shell is activated, you can use the command line to invoke the Cloud SDK gcloud tool or other tools available on the virtual machine instance.</p>



<h3>Understanding regions and zones</h3>



<p>Certain Google Compute Engine resources live in regions or zones. A region is a specific geographical location where you can run your resources. Each region has one or more zones. For example, the us-central1 region denotes a region in the Central United States that has zones us-central1-a, us-central1-b, us-central1-c, and us-central1-f. Resources that live in a zone are referred to as zonal resources. Virtual machine instances and persistent disks live in a zone. If you want to attach a persistent disk to a virtual machine instance, both resources must be in the same zone. Similarly, if you want to assign a static IP address to an instance, the instance must be in the same region as the static IP address.</p>



<p>To see what your default region and zone settings are, run the following commands:</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud config get-value compute/zone
Your active configuration is: [cloudshell-18628]
(unset)
sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud config get-value compute/region
Your active configuration is: [cloudshell-18628]
(unset)
sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$</strong></pre>



<p>The above output shows that we do not have a region or zone property set for our current session. We could set a region and zone to work with as per our requirement. Although when we use cloud shell a default region and zone are set for the user in the session. these values can be viewed with the gcloud compute project-info describe &#8211;project command. For example,</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud compute project-info describe --project labenv-gcp-03-2092e8d44a01</strong>
<strong>commonInstanceMetadata:
fingerprint: b54dlCjfE88=
items:key: ssh-keys
value: sahil-linuxnix-01-050d4178878c:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqAcF/dvrEVlATCL48HX6Wianye
AxfMCsp+2wqzu38CrHmGEUKg155QWLEETMqY4DLyn3S6K1Ux8r33RwRKvX3WEjG0sql2dS9rq+vcD7ov/gSDbLoIgMBVnoMpNXaX
DmAlR2qcHdasY90WhU6Ay27bLi38hS+FRvyf+mlgwf7VADpdy5mdx00WphSqu6c3VfO2ELMrrky3ac/nzRTCGbmIOv/fZIpuxTj/
oXGagio0One9AQaQ4AztlMiVb31A8Rs6Ji1ix6FG6h+J7gluaFKhOLGpUYhZrOSgHfTlIVe8/d4OYD7V9DdNXV1sDIApofbW4yaw
KrLZ6Na68vcF/dd
sahil-linuxnix-01-050d4178878c@labenv.net</strong>
<strong>key: enable-oslogin
value: 'true'key: google-compute-default-zone
value: us-central1-a</strong>
<strong>key: google-compute-default-region
value: us-central1
kind: compute#metadata
creationTimestamp: '2021-05-16T21:03:21.407-07:00'
defaultNetworkTier: PREMIUM
defaultServiceAccount: 23656931543-compute@developer.gserviceaccount.com
id: '7559563518447212006'
kind: compute#project
name: labenv-gcp-03-2092e8d44a01
-------------------------------------output truncated for brevity</strong></pre>



<p>The above output shows that our default region is us-central1 and default zone is us-central1-a. If you are unaware of your project id you can retrieve it from the gcloud config list porject command.</p>



<h3>Exploring gcloud commands</h3>



<p>The gcloud tool offers simple usage guidelines that are available by adding the -h flag (for help) onto the end of any gcloud command. Run the following command:</p>



<p><strong>gcloud -h<br></strong></p>



<p>You can access more verbose help by appending the &#8211;help flag onto a command or running the gcloud help command. For example, to get detailed options on the gcloud config coomand, type</p>



<p><strong>gcloud config &#8211;help</strong></p>



<p><br>Note: Press ENTER or the spacebar to scroll through the help content. To exit the content, type Q.</p>



<p>View the list of configurations in your environment:</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud config list
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 30
[core]
account = sahil-linuxnix-01-050d4178878c@labenv.net
disable_usage_reporting = True
project = labenv-gcp-03-2092e8d44a01
[metrics]
environment = devshell</strong>
<strong>Your active configuration is: [cloudshell-18628]
sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$</strong></pre>



<p>To see all properties and their settings:</p>



<p><strong>gcloud config list &#8211;all</strong></p>



<p>If you are using cloud shell for the first time or do not use it frequently then the values of most of these properties will be unset.</p>



<p>List your components:</p>



<pre class="wp-block-preformatted"><strong>sahil-linuxnix_01_050d4178878c@cloudshell:~ (labenv-gcp-03-2092e8d44a01)$ gcloud components list</strong>
<strong>┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Components │
├──────────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬──────────┤
│ Status │ Name │ ID │ Size │
├──────────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
│ Update Available │ BigQuery Command Line Tool │ bq │ &lt; 1 MiB │
│ Update Available │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 60.4 MiB │
│ Update Available │ Cloud SDK Core Libraries │ core │ 18.4 MiB │
│ Update Available │ Cloud Storage Command Line Tool │ gsutil │ 3.9 MiB │
│ Deprecated │ Kind │ kind │ │
│ Not Installed │ Appctl │ appctl │ 21.0 MiB │
│ Not Installed │ Cloud Firestore Emulator │ cloud-firestore-emulator │ 40.5 MiB │
│ Not Installed │ Cloud SQL Proxy │ cloud_sql_proxy │ 7.6 MiB │
│ Not Installed │ Cloud Spanner Emulator │ cloud-spanner-emulator │ 21.8 MiB │
│ Not Installed │ Emulator Reverse Proxy │ emulator-reverse-proxy │ 14.5 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ 1.8 MiB │
│ Not Installed │ Kustomize │ kustomize │ 25.9 MiB │
│ Not Installed │ Nomos CLI │ nomos │ 22.9 MiB │
│ Not Installed │ anthos-auth │ anthos-auth │ 16.8 MiB │
│ Not Installed │ config-connector │ config-connector │ 44.3 MiB │
│ Not Installed │ kubectl │ kubectl │ &lt; 1 MiB │
│ Not Installed │ kubectl-oidc │ kubectl-oidc │ 16.8 MiB │
│ Not Installed │ pkg │ pkg │ │
│ Installed │ App Engine Go Extensions │ app-engine-go │ 4.9 MiB │
│ Installed │ Cloud Bigtable Command Line Tool │ cbt │ 7.7 MiB │
│ Installed │ Cloud Bigtable Emulator │ bigtable │ 6.6 MiB │
│ Installed │ Cloud Datalab Command Line Tool │ datalab │ &lt; 1 MiB │
│ Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 18.4 MiB │
│ Installed │ Google Cloud Build Local Builder │ cloud-build-local │ 6.3 MiB │
│ Installed │ Minikube │ minikube │ 50.4 MiB │
│ Installed │ On-Demand Scanning API extraction helper │ local-extract │ 13.6 MiB │
│ Installed │ Skaffold │ skaffold │ 16.7 MiB │
│ Installed │ gcloud Alpha Commands │ alpha │ &lt; 1 MiB │
│ Installed │ gcloud Beta Commands │ beta │ &lt; 1 MiB │
│ Installed │ gcloud app Java Extensions │ app-engine-java │ 53.1 MiB │
│ Installed │ gcloud app Python Extensions │ app-engine-python │ 6.1 MiB │
│ Installed │ gcloud app Python Extensions (Extra Libraries) │ app-engine-python-extras │ 27.1 MiB │
│ Installed │ kpt │ kpt │ 11.7 MiB │
└──────────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴──────────┘</strong></pre>



<p>This command displays the gcloud components that are ready for you to use in your current environment. Not all components would be installed by default.</p>



<p></p>



<h2>Conclusion</h2>



<p>We hope that you found this introductory article to google cloud shell useful. In the next post, we will see how we could provision a virtual machine using only the google cloud shell and the gcloud sdk.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/google-cloud-basics-activate-cloud-shell/">Google Cloud basics: Activate Cloud Shell</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/google-cloud-basics-activate-cloud-shell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create persistent swap partition on Azure Linux VM</title>
		<link>https://www.linuxnix.com/create-persistent-swap-partition-on-azure-linux-vm/</link>
					<comments>https://www.linuxnix.com/create-persistent-swap-partition-on-azure-linux-vm/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Tue, 18 May 2021 09:10:40 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[Cloud/Virtulization]]></category>
		<category><![CDATA[Devops]]></category>
		<category><![CDATA[swap]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=9196</guid>

					<description><![CDATA[<p>Introduction Swap space is storage on a disk device that is used when the system&#8217;s RAM (physcial memory) is full. When a Linux system runs out of RAM, inactive memory pages are moved from the RAM to the swap space. Swap space can take the form of either a dedicated swap partition or a swap [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/create-persistent-swap-partition-on-azure-linux-vm/">Create persistent swap partition on Azure Linux VM</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter size-large"><img width="511" height="170" src="https://www.linuxnix.com/wp-content/uploads/2021/05/Create-persistent-swap-partition-on-Azure-Linux-VM.jpg" alt="" class="wp-image-9200" /></figure></div>



<h4>Introduction</h4>



<p>Swap space is storage on a disk device that is used when the system&#8217;s RAM (physcial memory) is full. When a Linux system runs out of RAM, inactive memory pages are moved from the RAM to the swap space. Swap space can take the form of either a dedicated swap partition or a swap file. It is recommended that the swap space should reside on a dedicated partition and a swap file should be used as a last resort. This article is not a deep dive on swap space in Linux but we did want to refresh the concept of it. In this post, we will explain how we could create swap space on a Linux VM on Azure cloud that would persist across a reboot.</p>



<p>The swap partition created using the standard methods may not persist after a machine reboot, for a Linux virtual machine hosted in Microsoft Azure environment. Microsoft Azure, however, provides the option to create a swap partition on the VM, using the /dev/sdb partition and WAAGENT service. The WAAGENT service is an Azure Linux agent for Microsoft Azure environment and will be present in Azure Linux virtual machines by default on each VM. The /dev/sdb partition is an ephemeral partition i.e. the data stored in this partition will be lost after each machine reboot. So we can make use of this partition as our swap partition.</p>



<p>To enable swap space in Azure linux VM, you need to do edit the configruation file for the waagent service located at /etc/waagent.conf and update the following entries:</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container">
<h6>#Create and use swapfile on resource disk.</h6>



<pre class="wp-block-preformatted"><strong>ResourceDisk.EnableSwap=n</strong></pre>



<h6>#Size of the swapfile.</h6>



<pre class="wp-block-preformatted"><strong>ResourceDisk.SwapSizeMB=0</strong></pre>
</div></div>



<p>Change the ResourceDisk.EnableSwap=y and ResourceDisk.SwapSizeMB=5120, the value 5120 = 5GB. This will create a /swapfile in the resource disk that will persist across a reboot.<br>By default, the resource disk in an Azure Virtual Machine will be /mnt/resource(/dev/sdb) and the same will be mentioned in the waagent.conf file as well as shown in the below output.</p>



<pre class="wp-block-preformatted"><strong>[sahil@linuxnix ~]$ grep ResourceDisk.MountPoint /etc/waagent.conf<br>ResourceDisk.MountPoint=/mnt/resource</strong></pre>



<p>Therefore, the full path of our swapfile will be /mnt/resource/swapfile.</p>



<p>Given below are the updated entries for EnableSwap and SwapsizeMB parameters that we mentioned earlier.</p>



<p>#Create and use swapfile on resource disk.</p>



<pre class="wp-block-preformatted"><strong>ResourceDisk.EnableSwap=y</strong></pre>



<p>#Size of the swapfile.</p>



<pre class="wp-block-preformatted"><strong>ResourceDisk.SwapSizeMB=5120</strong></pre>



<p>After the change is made, we need to restart the waagent service. For RHEL based systems, we would use the following command to do so:</p>



<pre class="wp-block-preformatted"><strong>sudo service waagent restart</strong></pre>



<p>After restarting the service, our swap parition should be mounted on the server as shown below.</p>



<pre class="wp-block-preformatted"><strong>[sahil@linuxnix ~]$ free -g
      total used free shared buff/cache available
Mem:    27   13   12      0       1        13
Swap:   4    0    4
[sahil@linuxnix ~]$</strong></pre>



<p></p>



<h4>Conclusion<br></h4>



<p>We hope that you found this post to be useful and we look forward to your suggestions and feedback.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/create-persistent-swap-partition-on-azure-linux-vm/">Create persistent swap partition on Azure Linux VM</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/create-persistent-swap-partition-on-azure-linux-vm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>DNF, YUM and RPM package manager comparison</title>
		<link>https://www.linuxnix.com/dnf-yum-and-rpm-package-manager-comparison/</link>
					<comments>https://www.linuxnix.com/dnf-yum-and-rpm-package-manager-comparison/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Mon, 17 May 2021 04:43:11 +0000</pubDate>
				<category><![CDATA[Basics]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=6649</guid>

					<description><![CDATA[<p>Introduction We have been using the yum or rpm package management tools for a while for managing packages in Redhat, Centos and other distributions which have been forked from RHEL. Yum has been the default package manager since Redhat Enterprise Linux 5 onwards. Before yum, RHEL systems had been using the up2date software management program. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/dnf-yum-and-rpm-package-manager-comparison/">DNF, YUM and RPM package manager comparison</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-6656 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/title-1.jpg" alt="" width="476" height="161"></h4>
<h4>Introduction</h4>
<p>We have been using the yum or rpm package management tools for a while for managing packages in Redhat, Centos and other distributions which have been forked from RHEL.<br />
Yum has been the default package manager since Redhat Enterprise Linux 5 onwards. Before yum, RHEL systems had been using the up2date software management program.<br />
The DNF package manager was introduced in Fedora 18 and became the default package manager for the Fedora distribution for operating system version Fedora 22 onwards and is intended to be a replacement for yum.</p>
<p>In this article, we will compare these package managers to provide some perspective as to when and why you should consider using one over the other.</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td>Sno</td>
<td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DNF</td>
<td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; YUM</td>
<td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RPM</td>
</tr>
<tr>
<td>1</td>
<td>Written in C and Python</td>
<td>Written in python</td>
<td>Written in C and Perl</td>
</tr>
<tr>
<td>2</td>
<td>DNFs uses libsolv for dependency resolution which was created and maintained by SUSE</td>
<td>YUM uses public API for dependency resolution</td>
<td>RPM does not provide dependency resolution</td>
</tr>
<tr>
<td>3</td>
<td>Dependency resolution is fast and easy making installation of groups of packages very simple</td>
<td>Dependency resolution is slower as compared to dnf but is still fairly straightforward</td>
<td>Due to lack of dependency resolution installation of software applications having multiple dependency requirements is very tedious</td>
</tr>
<tr>
<td></td>
<td>Does not require dependent packages to be available locally</td>
<td>Does not require dependent packages to be available locally</td>
<td>Since rpm cannot resolve dependencies on its own, it needs all dependent packages for a package to be available locally on the system in the same folder as that of the concerned package</td>
</tr>
<tr>
<td>4</td>
<td>DNF supports more extension</td>
<td>YUM support only Python for extension</td>
<td>RPM functionality can be extended somewhat using C</td>
</tr>
<tr>
<td>5</td>
<td>Multiple packages can be installed with a single command</td>
<td>Multiple packages can be installed with a single command</td>
<td>Can be used to install multiple .rpm package files in a single command provided there are no dependency issues</td>
</tr>
<tr>
<td>6</td>
<td>DNF has a well-documented API making adding new features easy</td>
<td>Building new features in yum is not as straightforward</td>
<td>Both yum and dnf use rpm under the hood for underlying package management operations</td>
</tr>
<tr>
<td></td>
<td>Can connect to online or remote repositories to search for packages</td>
<td>Can connect to online or remote repositories to search for packages</td>
<td>Rpm tool cannot connect to online repositories</td>
</tr>
<tr>
<td>7</td>
<td>DNF uses lower memory reduction and less automatic synchronization of metadata with repositories</td>
<td>YUM uses high memory reduction and automatic synchronization of metadata with repositories</td>
<td>Not applicable since rpm does not provide the ability to connect to online repositories</td>
</tr>
<tr>
<td>8</td>
<td>DNF allows all installed packages to be updated with a single command: dnf update</td>
<td>YUM allows all installed packages to be updated with a single command: yum update</td>
<td>RPM does not provide this feature. To update a .rpm package using RPM, the updated .rpm file for the concerned package must be available locally on the system. To update the package, use rpm -Uvh &lt;.rpm file name&gt;</td>
</tr>
<tr>
<td>9</td>
<td>If a package has unmet dependencies during a dnf update action, that package will not be updated.</td>
<td>With yum it is possible to update to a package that has unmet dependencies using the &#8211;skip-broken option</td>
<td>A package update using rpm will fail if any package dependency has not been met</td>
</tr>
<tr>
<td>10</td>
<td>If enabled repository does not respond, dnf will skip it and continue the transaction with the available repos</td>
<td>YUM will not proceed if a repository is unavailable</td>
<td>NA</td>
</tr>
<tr>
<td>11</td>
<td>dnf update and dnf upgrade are equivalent</td>
<td>yum upgrade Is the same as the yum update command with the &#8211;obsoletes flag set</td>
<td>NA</td>
</tr>
<tr>
<td>12</td>
<td>Dependencies are not upgraded on package installation</td>
<td>It is possible to upgrade dependencies during package installation while using yum</td>
<td>RPM requires that a compatible version of the dependent package be available on the system. It will install an updated dependent package provided there are no compatibility issues</td>
</tr>
<tr>
<td>13</td>
<td>Clean on remove: When removing a package, dnf will automatically remove any dependent packages that were not explicitly installed by the user.</td>
<td>Yum will not remove dependencies during package removal</td>
<td>Rpm will not remove dependencies during package removal</td>
</tr>
<tr>
<td>14</td>
<td>kernel packages are not protected by dnf meaning you can remove all kernel packages, including the running package</td>
<td>Yum will not allow this behavior</td>
<td>Rpm will error out if you try to remove the kernel package since other packages are dependent on it</td>
</tr>
<tr>
<td>15</td>
<td>DNF uses separate libraries for interacting with repositories and dependency resolution</td>
<td>Yum does not use separate libraries for such functions</td>
<td>NA</td>
</tr>
<tr>
<td>16</td>
<td>Allows parallel operations</td>
<td>Does not allow parallel operations</td>
<td>Allows parallel operations</td>
</tr>
<tr>
<td>17</td>
<td>Can work with both python versions 2 and 3</td>
<td>Compatible with python version 2 only</td>
<td>Does not rely on python</td>
</tr>
<tr>
<td>18</td>
<td>Default package manager for Fedora</td>
<td>Default package manager for most Redhat based distributions</td>
<td>Installed by default on almost all Redhat based distributions</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h4>Conclusion</h4>
<p>In this article, we compared the different features of the three package management software. We hope that this information helps you understand and determine why one or more of the three package managers would be best suited for which scenarios.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/dnf-yum-and-rpm-package-manager-comparison/">DNF, YUM and RPM package manager comparison</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/dnf-yum-and-rpm-package-manager-comparison/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introduction to the aptitude package manager for Ubuntu</title>
		<link>https://www.linuxnix.com/introduction-to-the-aptitude-package-manager-for-ubuntu/</link>
					<comments>https://www.linuxnix.com/introduction-to-the-aptitude-package-manager-for-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Fri, 26 Mar 2021 05:00:56 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[aptitude]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=6679</guid>

					<description><![CDATA[<p>Introduction In our ongoing series of articles covering various software management tools, we have already covered, dpkg,apt-get and apt. In this article, we&#8217;ll cover the aptitude tool for package management on our Ubuntu 16.04 system. The aptitude command is a very useful, text-based utility for managing packages on your server.&#160; Some administrators use it as [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/introduction-to-the-aptitude-package-manager-for-ubuntu/">Introduction to the aptitude package manager for Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-6687 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/aptitude-title.jpg" alt="" width="564" height="251"></h4>
<h4>Introduction</h4>
<p>In our ongoing series of articles covering various software management tools, we have already covered, dpkg,apt-get and apt. In this article, we&#8217;ll cover the aptitude tool for package management on our Ubuntu 16.04 system. The aptitude command is a very useful, text-based utility for managing packages on your server.&nbsp; Some administrators use it as an alternative to apt.&nbsp; The aptitude package management software provides a command line utility named aptitude but a powerful text user interface as well. The TUI displays a list of software packages and allows the user to interactively pick packages to install or remove. The aptitude text user interface is based on the curses computer terminal library, with which it provides an interface that incorporates some elements commonly seen in graphical user interfaces (GUIs).</p>
<p>Given below are some of the useful features of aptitude:</p>
<ul>
<li>a mutt-like syntax for matching packages in a flexible manner</li>
<li>mark packages as “automatically installed” or “manually installed” so that packages can be auto-removed when no longer required</li>
<li>colorful preview of actions about to be taken</li>
<li>dselect-like persistence of user actions</li>
<li>the ability to retrieve and display the Debian changelog of most packages</li>
<li>AptCLI-like (= apt-get + apt-cache) command line mode</li>
<li>Score-based and (usually) smarter dependency resolver than apt-get</li>
</ul>
<p>&nbsp;</p>
<p><strong>Installing aptitude:</strong><br />
The aptitude software is not installed on the system by default.<br />
We can install it by using the following command:</p>
<pre><strong>root@linuxnix:~# apt install aptitude</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>libblas-common libblas3 liblinear3 liblua5.2-0 libxslt1.1 linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws</strong>
<strong>linux-image-4.4.0-1032-aws lua-lpeg ndiff python-bs4 python-chardet python-html5lib python-lxml python-pkg-resources python-six</strong>
<strong>zsh-common</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>The following additional packages will be installed:</strong>
<strong>aptitude-common libboost-iostreams1.58.0 libcgi-fast-perl libcgi-pm-perl libclass-accessor-perl libcwidget3v5</strong>
<strong>libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhttp-date-perl libhttp-message-perl</strong>
<strong>libio-html-perl libio-string-perl liblwp-mediatypes-perl libparse-debianchangelog-perl libsigc++-2.0-0v5 libsub-name-perl</strong>
<strong>libtimedate-perl liburi-perl libxapian22v5</strong>
<strong>Suggested packages:</strong>
<strong>apt-xapian-index aptitude-doc-en | aptitude-doc debtags tasksel libcwidget-dev libdata-dump-perl libhtml-template-perl</strong>
<strong>libxml-simple-perl libwww-perl xapian-tools</strong>
<strong>The following NEW packages will be installed:</strong>
<strong>aptitude aptitude-common libboost-iostreams1.58.0 libcgi-fast-perl libcgi-pm-perl libclass-accessor-perl libcwidget3v5</strong>
<strong>libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhttp-date-perl libhttp-message-perl</strong>
<strong>libio-html-perl libio-string-perl liblwp-mediatypes-perl libparse-debianchangelog-perl libsigc++-2.0-0v5 libsub-name-perl</strong>
<strong>libtimedate-perl liburi-perl libxapian22v5</strong>
<strong>0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 3,647 kB of archives.</strong>
<strong>After this operation, 14.7 MB of additional disk space will be used.</strong>
<strong>Do you want to continue? [Y/n] Y</strong>
<strong>--------------------------------------------------------------output truncated for brevity</strong></pre>
<p>&nbsp;</p>
<h4>Aptitude command line interface examples</h4>
<p>The aptitude command line interface provides most of the features as that of the apt package manager.</p>
<p><strong>Example 1: Search for a package</strong><br />
To search for a package we use the aptitude search command followed by the package name.<br />
Let&#8217;s search for the byobu package.</p>
<pre><strong>root@linuxnix:~# aptitude search byobu</strong>
<strong>i byobu - text window manager, shell multiplexer, integrated DevOps environmen</strong>
<strong>v byobu-extras -</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>The i on the leftmost corner of the output indicates an installed package and the v indicates a virtual package.<br />
We will explain the other possible alternatives that could exist aside from i and v when we explain the aptitude text user interface.</p>
<p>&nbsp;</p>
<p><strong>Example 2: Retrieve information about a package</strong><br />
To query information about a package use the aptitude show command followed by the package name.</p>
<pre><strong>root@linuxnix:~# aptitude show byobu</strong>
<strong>Package: byobu</strong>
<strong>State: installed</strong>
<strong>Automatically installed: no</strong>
<strong>Version: 5.106-0ubuntu1</strong>
<strong>Priority: optional</strong>
<strong>Section: misc</strong>
<strong>Maintainer: Dustin Kirkland &lt;kirkland@ubuntu.com&gt;</strong>
<strong>Architecture: all</strong>
<strong>Uncompressed Size: 654 k</strong>
<strong>Depends: debconf (&gt;= 0.5) | debconf-2.0, gettext-base, python3 | python, python3-newt | python-newt, tmux (&gt;= 1.5) | screen, gawk</strong>
<strong>Recommends: pastebinit, screen, tmux (&gt;= 1.5), run-one</strong>
<strong>Suggests: apport, ccze, gnome-terminal, gnupg, lsb-release, po-debconf, ttf-ubuntu-font-family (&gt;= 0.80-0ubuntu1~medium),</strong>
<strong>update-notifier-common, vim, wireless-tools</strong>
<strong>Breaks: bikeshed (&lt; 1.64), byobu-extras (&lt; 2.17), screen-profiles (&lt; 2.0), screen-profiles-extras (&lt; 2.0)</strong>
<strong>Replaces: bikeshed (&lt; 1.64), byobu-extras (&lt; 2.17), screen-profiles (&lt; 2.0), screen-profiles-extras (&lt; 2.0)</strong>
<strong>Enhances: screen</strong>
<strong>Provides: byobu-extras, screen-profiles, screen-profiles-extras</strong>
<strong>Description: text window manager, shell multiplexer, integrated DevOps environment</strong>
<strong>Byobu is Ubuntu's powerful text-based window manager, shell multiplexer, and integrated DevOps environment.</strong>
<strong>Using Byobu, you can quickly create and move between different windows over a single SSH connection or TTY terminal, split each of</strong>
<strong>those windows into multiple panes, monitor dozens of important statistics about your system, detach and reattach to sessions later</strong>
<strong>while your programs continue to run in the background.</strong>
<strong>Homepage: http://byobu.org</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 3: Install a package</strong><br />
We use the aptitude install command followed by the package name to install a new package using aptitude.<br />
Let&#8217;s install the nmap package.</p>
<pre><strong>root@linuxnix:~# aptitude install nmap</strong>
<strong>The following NEW packages will be installed:</strong>
<strong>nmap</strong>
<strong>0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 0 B/4,638 kB of archives. After unpacking 21.3 MB will be used.</strong>
<strong>Selecting previously unselected package nmap.</strong>
<strong>(Reading database ... 109863 files and directories currently installed.)</strong>
<strong>Preparing to unpack .../nmap_7.01-2ubuntu2_amd64.deb ...</strong>
<strong>Unpacking nmap (7.01-2ubuntu2) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong>
<strong>Setting up nmap (7.01-2ubuntu2) ...</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 4: Remove a package</strong><br />
We use the aptitude remove command followed by the package name to install a new package using aptitude.<br />
Let&#8217;s remove the nmap package that we installed in the previous example.</p>
<pre><strong>root@linuxnix:~# aptitude remove nmap</strong>
<strong>The following packages will be REMOVED:</strong>
<strong>nmap</strong>
<strong>0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.</strong>
<strong>Need to get 0 B of archives. After unpacking 21.3 MB will be freed.</strong>
<strong>(Reading database ... 110643 files and directories currently installed.)</strong>
<strong>Removing nmap (7.01-2ubuntu2) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 5: Update the system</strong></p>
<p>The safest way to upgrade is to use the action “safe-upgrade”.<br />
The new action will upgrade a package only if it does not impact other packages.<br />
If it is necessary to add or remove a dependency package during the upgrade, safe-upgrade won’t upgrade.</p>
<pre><strong>root@linuxnix:~# aptitude safe-upgrade</strong>
<strong>No packages will be installed, upgraded, or removed.</strong>
<strong>0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 0 B of archives. After unpacking 0 B will be used.</strong></pre>
<p>Since the system I&#8217;m working on is a newly built EC2 instance, the safe-upgrade command returned without installing or updating any packages.</p>
<p>&nbsp;</p>
<p><strong>Example 6: Full system upgrade</strong></p>
<p>If you want to force the upgrade anyway, the action “full-upgrade” can be used.<br />
With this command, aptitude will upgrade to the latest version of a package even if it is necessary to add or remove dependencies.</p>
<pre><strong>root@linuxnix:~# aptitude full-upgrade</strong>
<strong>No packages will be installed, upgraded, or removed.</strong>
<strong>0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 0 B of archives. After unpacking 0 B will be used.</strong></pre>
<p>&nbsp;</p>
<h4>Aptitude text user interface examples</h4>
<p>To launch the aptitude text user interface, type aptitude on the command line and press enter.<br />
The below window-based menu should appear on the screen.</p>
<p><img class="size-full wp-image-6682 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/1-1.png" alt="" width="798" height="371" srcset="https://www.linuxnix.com/wp-content/uploads/2017/12/1-1.png 798w, https://www.linuxnix.com/wp-content/uploads/2017/12/1-1-768x357.png 768w" sizes="(max-width: 798px) 100vw, 798px" /></p>
<p>To have access to the various menu options, you will have to press Ctrl+T and use the use arrow keys to navigate through the menu.</p>
<p>&nbsp;</p>
<p><strong>Installing packages</strong></p>
<p>From the aptitude home screen, bring the cursor on the &#8220;Not installed packages&#8221; line and press enter.<br />
This will now expand out to the categories of packages available to be installed.<br />
For the purpose of this demonstration, I&#8217;d like to install the anacron utility.<br />
So I bring my cursor to the admin package group and then press enter to expand it.<br />
From there I expand the main category of packages and bring the cursor to the anacron package.</p>
<p><img class="size-full wp-image-6683 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/5-1.png" alt="" width="1272" height="459" srcset="https://www.linuxnix.com/wp-content/uploads/2017/12/5-1.png 1272w, https://www.linuxnix.com/wp-content/uploads/2017/12/5-1-1024x370.png 1024w, https://www.linuxnix.com/wp-content/uploads/2017/12/5-1-768x277.png 768w, https://www.linuxnix.com/wp-content/uploads/2017/12/5-1-1080x390.png 1080w" sizes="(max-width: 1272px) 100vw, 1272px" /></p>
<p>Once I have my cursor on this package name, I&#8217;d need to press the + keyboard key to select it for installation.</p>
<p>Press the g key twice to install the package.</p>
<p>&nbsp;</p>
<p><strong>Removing packages</strong><br />
From the aptitude home screen, bring the cursor on the &#8220;Installed packages&#8221; line and press enter.<br />
This will now expand out to the categories of packages installed on the system</p>
<p>We&#8217;ll remove the anacron package that we installed in the previous example.</p>
<p><img class="size-full wp-image-6684 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/8.png" alt="" width="1295" height="451" srcset="https://www.linuxnix.com/wp-content/uploads/2017/12/8.png 1295w, https://www.linuxnix.com/wp-content/uploads/2017/12/8-1024x357.png 1024w, https://www.linuxnix.com/wp-content/uploads/2017/12/8-768x267.png 768w, https://www.linuxnix.com/wp-content/uploads/2017/12/8-1080x376.png 1080w" sizes="(max-width: 1295px) 100vw, 1295px" /><br />
Once I&#8217;ve selected the package that I need to remove, press the &#8211; keyboard key.</p>
<p>This marks the package to be removed.</p>
<p><img class="alignnone size-full wp-image-6685" src="https://www.linuxnix.com/wp-content/uploads/2017/12/9.png" alt="" width="1265" height="295" srcset="https://www.linuxnix.com/wp-content/uploads/2017/12/9.png 1265w, https://www.linuxnix.com/wp-content/uploads/2017/12/9-1024x239.png 1024w, https://www.linuxnix.com/wp-content/uploads/2017/12/9-768x179.png 768w, https://www.linuxnix.com/wp-content/uploads/2017/12/9-1080x252.png 1080w" sizes="(max-width: 1265px) 100vw, 1265px" /><br />
Now, press the g keyboard key twice to remove the package.</p>
<p>At that prompt, pressing the enter key again will take you back to the aptitude main menu.</p>
<p>Press q to quit and exit from the aptitude menu. You will be prompted if you really wish to quit. Select yes here to come out of the menu.</p>
<p>&nbsp;</p>
<h4>Conclusion</h4>
<p>This was the final article in our exploration of package managers for Debian based operating systems.<br />
We hope you&#8217;ve found this article and the rest of the articles in the series helpful and we look forward towards your feedback.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/introduction-to-the-aptitude-package-manager-for-ubuntu/">Introduction to the aptitude package manager for Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/introduction-to-the-aptitude-package-manager-for-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>zypper package management tool examples for managing packages on SUSE Linux</title>
		<link>https://www.linuxnix.com/zypper-package-management-tool-examples-for-managing-packages-on-suse-linux/</link>
					<comments>https://www.linuxnix.com/zypper-package-management-tool-examples-for-managing-packages-on-suse-linux/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Fri, 26 Mar 2021 05:00:51 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[suse]]></category>
		<category><![CDATA[zypper]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=6705</guid>

					<description><![CDATA[<p>Introduction The zypper package management tool performs the same function for SUSE Linux as yum and apt perform for RedHat and Debian based systems respectively. SUSE (Software and System Entwicklung (Germany) meaning Software and System Development, in English) Linux runs on top of the open-source Linux kernel. The SUSE Linux distribution is available in two [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/zypper-package-management-tool-examples-for-managing-packages-on-suse-linux/">zypper package management tool examples for managing packages on SUSE Linux</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-6708 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/zypper-title.jpg" alt="" width="536" height="209"></h4>
<h4><strong>Introduction</strong></h4>
<p>The zypper package management tool performs the same function for SUSE Linux as yum and apt perform for RedHat and Debian based systems respectively. SUSE (Software and System Entwicklung (Germany) meaning Software and System Development, in English) Linux runs on top of the open-source Linux kernel. The SUSE Linux distribution is available in two variants, a community-driven project named OpenSUSE and a commercial version named SUSE Linux Enterprise. Zypper and YaST are the two command line tools used for package management in OpenSUSE and SUSE Enterprise Linux platforms. Both tools work on top of RPM. Zypper uses the libzypp library which provides the ZYpp package manager. ZYpp is a Linux software management engine and open source project originally sponsored by Novell and provides a powerful dependency resolver and a convenient package management API.</p>
<p>In this article, we will show you how to use the zypper package management tool to search for, install and remove packages along with a few other uses. We will be using the SUSE Enterprise Linux version 12 for the examples demonstrated in this article.</p>
<p>&nbsp;</p>
<p><strong>Example 1: Search for a Specific Package</strong><br />
To search for a package from a repository we use the zypper search command followed by the package name we want to search for. To demonstrate, let&#8217;s search for the package name git.</p>
<pre><strong>linuxnix:~ # zypper search git</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>

<strong>S | Name | Summary | Type</strong>
<strong>--+----------+-----------------------------------------------------+-----------</strong>
<strong>| git | Fast, scalable, distributed revision control system | srcpackage</strong>
<strong>| git-core | Core git tools | package</strong>
<strong>linuxnix:~ #</strong>
</pre>
<p>This gives us the two search results that zypper was able to find matching our search criterion.<br />
Note that you can use wildcards while searching for packages using zypper.</p>
<p>&nbsp;</p>
<p><strong>Example 2: Install a package</strong><br />
We use the zypper install command followed by the package name to install a package. Let&#8217;s install the git-core package to demonstrate.</p>
<pre><strong>linuxnix:~ # zypper install git-core</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Resolving package dependencies...</strong>

<strong>The following 2 NEW packages are going to be installed:</strong>
<strong>git-core perl-Error</strong>
<strong>2 new packages to install.</strong>
<strong>Overall download size: 4.4 MiB. Already cached: 0 B. After the operation, additional 29.6 MiB will be used.</strong>
<strong>Continue? [y/n/...? shows all options] (y): y</strong>
<strong>Retrieving package perl-Error-0.17021-1.18.noarch (1/2), 28.3 KiB ( 49.8 KiB unpacked)</strong>
<strong>Retrieving package git-core-2.12.3-26.1.x86_64 (2/2), 4.4 MiB ( 29.5 MiB unpacked)</strong>
<strong>Checking for file conflicts: .........................................................................................................................................................................[done]</strong>
<strong>(1/2) Installing: perl-Error-0.17021-1.18.noarch .....................................................................................................................................................[done]</strong>
<strong>(2/2) Installing: git-core-2.12.3-26.1.x86_64 ........................................................................................................................................................[done]</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 3: Uninstall a package</strong><br />
To uninstall or erase a package, we use the zypper remove command followed by the package name. Let&#8217;s uninstall the git-core package we installed in the previous example.</p>
<pre><strong>linuxnix:~ # zypper remove git-core</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Resolving package dependencies...</strong>

<strong>The following package is going to be REMOVED:</strong>
<strong>git-core</strong>

<strong>1 package to remove.</strong>
<strong>After the operation, 29.5 MiB will be freed.</strong>
<strong>Continue? [y/n/...? shows all options] (y): y</strong>
<strong>(1/1) Removing git-core-2.12.3-26.1.x86_64 ...........................................................................................................................................................[done]</strong>
<strong>linuxnix:~ #</strong></pre>
<p>Observe that zypper remove command did not remove that dependencies that were installed during the zypper install command.</p>
<p>&nbsp;</p>
<p><strong>Example 4: Query information about a package</strong><br />
To view available information about a package, we use the zypper info command followed by the package name.&nbsp;Let&#8217;s query information about that git-core package.</p>
<pre><strong>linuxnix:~ # zypper info git-core</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Information for package git-core:</strong>
<strong>---------------------------------</strong>
<strong>Repository : SLES12-SP3-12.3-0</strong>
<strong>Name : git-core</strong>
<strong>Version : 2.12.3-26.1</strong>
<strong>Arch : x86_64</strong>
<strong>Vendor : SUSE LLC &lt;https://www.suse.com/&gt;</strong>
<strong>Support Level : Level 3</strong>
<strong>Installed Size : 29.5 MiB</strong>
<strong>Installed : No</strong>
<strong>Status : not installed</strong>
<strong>Source package : git-2.12.3-26.1.src</strong>
<strong>Summary : Core git tools</strong>
<strong>Description :</strong>
<strong>Git is a fast, scalable, distributed revision control system with an</strong>
<strong>unusually rich command set that provides both high-level operations and</strong>
<strong>full access to internals.</strong>
<strong>These are the core tools with minimal dependencies.</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 5: Check for available updates</strong><br />
To list packages available for update, use the zypper list-updates command.</p>
<pre><strong>linuxnix:~ # zypper list-updates</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>No updates found.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>Since I&#8217;m using the latest version of the OS available, zypper didn&#8217;t find any updates available.</p>
<p>&nbsp;</p>
<p><strong>Example 6: Update a single package</strong><br />
To update a package, we use the zypper update command followed by the package name.&nbsp;Let&#8217;s try this out on the openssh package.</p>
<pre><strong>linuxnix:~ # zypper update openssh</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>No update candidate for 'openssh-7.2p2-69.1.x86_64'. The highest available version is already installed.</strong>
<strong>Resolving package dependencies...</strong>

<strong>Nothing to do.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 7: Update entire system</strong><br />
To update all packages on the system, use the zypper update command.</p>
<pre><strong>linuxnix:~ # zypper update</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Nothing to do.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 8: Update distribution</strong><br />
The zypper dup command will upgrade your system from the current SUSE Linux version to the latest version available through the repositories you are connected to.</p>
<pre><strong>linuxnix:~ # zypper dup</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Computing distribution upgrade...</strong>
<strong>Nothing to do.</strong></pre>
<p>Since I&#8217;m using the latest version, there was nothing for zypper to update when I ran the command.</p>
<p>&nbsp;</p>
<p><strong>Example 9: Non-interactive package management commands</strong><br />
When we install or remove a package using zypper, we get prompted for confirmation. To skip this prompt and let zypper assume the reply as yes, we can use the &#8211;non-interactive option with the zypper command. Let&#8217;s demonstrate this usage by installing and removing the git-core package while also using the &#8211;non-interactive flag.</p>
<pre><strong>linuxnix:~ # zypper --non-interactive install git-core</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Resolving package dependencies...</strong>

<strong>The following NEW package is going to be installed:</strong>
<strong>git-core</strong>

<strong>1 new package to install.</strong>
<strong>Overall download size: 4.4 MiB. Already cached: 0 B. After the operation, additional 29.5 MiB will be used.</strong>
<strong>Continue? [y/n/...? shows all options] (y): y</strong>
<strong>Retrieving package git-core-2.12.3-26.1.x86_64 (1/1), 4.4 MiB ( 29.5 MiB unpacked)</strong>
<strong>Checking for file conflicts: .........................................................................................................................................................................[done]</strong>
<strong>(1/1) Installing: git-core-2.12.3-26.1.x86_64 ........................................................................................................................................................[done]</strong>
<strong>linuxnix:~ #</strong>
<strong>linuxnix:~ # zypper --non-interactive remove git-core</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>Resolving package dependencies...</strong>
<strong>The following package is going to be REMOVED:</strong>
<strong>git-core</strong>

<strong>1 package to remove.</strong>
<strong>After the operation, 29.5 MiB will be freed.</strong>
<strong>Continue? [y/n/...? shows all options] (y): y</strong>
<strong>(1/1) Removing git-core-2.12.3-26.1.x86_64 ...........................................................................................................................................................[done]</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 10: List repositories</strong><br />
To list available repositories being used by zypper to search for packages, we use the zypper lr command.<br />
Here&#8217;s an example:</p>
<pre><strong>linuxnix:~ # zypper lr</strong>
<strong>Repository priorities are without effect. All enabled repositories share the same priority.</strong>

<strong># | Alias | Name | Enabled | GPG Check | Refresh</strong>
<strong>--+-------------------+-------------------+---------+-----------+--------</strong>
<strong>1 | SLES12-SP3-12.3-0 | SLES12-SP3-12.3-0 | Yes | (r ) Yes | No</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 11: Refresh a repository</strong><br />
We should periodically refresh our system repository cache to ensure that all the latest updates made to the repositories are available to the system.<br />
To do this we use the zypper refresh command as shown below.</p>
<pre><strong>linuxnix:~ # zypper refresh</strong>
<strong>Repository 'SLES12-SP3-12.3-0' is up to date.</strong>
<strong>All repositories have been refreshed.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 12: Clear zypper cache</strong><br />
If you wish to clean zypper cache, use the following command:</p>
<pre><strong>linuxnix:~ # zypper clean</strong>
<strong>All repositories have been cleaned up.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 13: Install patches</strong><br />
You can also use zypper to install patches on your system.<br />
First, view all available patches using patches option as shown below:</p>
<pre><strong>linuxnix:~ # zypper patches</strong>
<strong>Loading repository data...</strong>
<strong>Reading installed packages...</strong>
<strong>No needed patches found.</strong>
<strong>linuxnix:~ #</strong></pre>
<p>If any patches were available, we could install a specific patch displayed in the output of the above command using the following command syntax:</p>
<pre><strong>zypper patch &lt;patch name&gt;</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 14: View history</strong><br />
Zypper does not have a history sub-command like yum does but instead it stores its history in a plain text file /var/log/zypp/history which we can read. Let&#8217;s take a look at a snippet of the file.</p>
<pre><strong>linuxnix:~ # cat /var/log/zypp/history | grep -Ev '^#' | tail</strong>
<strong>2017-12-26 02:24:47|install|gnome-shell-extensions-common-lang|3.20.1-24.19.45|noarch||SLES12-SP3-12.3-0|c2edecff042b04bd673446d7fcf52aab3196c5a501401180198831523ab29d2c|</strong>
<strong>2017-12-26 02:24:49|install|gdm|3.10.0.1-52.5|x86_64||SLES12-SP3-12.3-0|eb9e4f92fe51b95319b51cdb7b1b85f35b13ed7ae1382ed8f20649acb76aba93|</strong>
<strong>2017-12-26 02:24:49|install|patterns-sle-gnome-basic|12-5.8|x86_64||SLES12-SP3-12.3-0|bb49e41309d45cdd7a8251da72974315391ba533fb20d1c82862790d02eebbcf|</strong>
<strong>2017-12-26 02:24:49|install|gdm-lang|3.10.0.1-52.5|noarch||SLES12-SP3-12.3-0|999fa1d87c3db372e247cd0df4625d90076ea4f07d2c71470683eca411782048|</strong>
<strong>2017-12-26 02:27:16|radd |SLES12-SP3-12.3-0|cd:///?devices=/dev/disk/by-id/ata-VMware_Virtual_SATA_CDRW_Drive_01000000000000000001|</strong>
<strong>2017-12-26 21:18:00|command|root@linuxnix|'zypper' 'install' 'git-core'|</strong>
<strong>2017-12-26 21:18:01|install|perl-Error|0.17021-1.18|noarch||SLES12-SP3-12.3-0|3790538ea2d409479f39a9c1f3677c724da4ce213cda7da10f60958e81da87ef|</strong>
<strong>2017-12-26 21:18:04|install|git-core|2.12.3-26.1|x86_64|root@linuxnix|SLES12-SP3-12.3-0|91851797d1fe372d3af00271f27974aba7b1e28255c53aed4fb493f4bdf3f409|</strong>
<strong>2017-12-26 21:18:58|command|root@linuxnix|'zypper' 'remove' 'git-core'|</strong>
<strong>2017-12-26 21:18:58|remove |git-core|2.12.3-26.1|x86_64|root@linuxnix|</strong></pre>
<p>&nbsp;</p>
<h4>Conclusion</h4>
<p>This concludes our coverage of the zypper package management tool where we demonstrated how to use zypper to install, remove, update, search for and obtain information about packages. We also showed you how to view the history of package management operations performed using zypper.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/zypper-package-management-tool-examples-for-managing-packages-on-suse-linux/">zypper package management tool examples for managing packages on SUSE Linux</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/zypper-package-management-tool-examples-for-managing-packages-on-suse-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>APT-CACHE and APT-GET commands for package management in Ubuntu</title>
		<link>https://www.linuxnix.com/apt-cache-and-apt-get-commands-for-package-management-in-ubuntu/</link>
					<comments>https://www.linuxnix.com/apt-cache-and-apt-get-commands-for-package-management-in-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Thu, 25 Mar 2021 09:30:47 +0000</pubDate>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[apt-cache]]></category>
		<category><![CDATA[apt-get]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=6639</guid>

					<description><![CDATA[<p>Introduction In an earlier article, we demonstrated how you could use the dpkg package manager to install, remove and query information about software packages in the Ubuntu OS. In this article, we will show you how to use apt-cache to search for and query information about packages available in online and local repositories and we [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/apt-cache-and-apt-get-commands-for-package-management-in-ubuntu/">APT-CACHE and APT-GET commands for package management in Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-6641 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/APT-CACHE-and-APT-GET-commands-for-package-management-in-Ubuntu.jpg" alt="" width="555" height="255"></h4>
<h4>Introduction</h4>
<p>In an earlier article, we demonstrated how you could use the dpkg package manager to install, remove and query information about software packages in the Ubuntu OS.<br />
In this article, we will show you how to use apt-cache to search for and query information about packages available in online and local repositories and we will also show you how to use apt-get to install and uninstall packages.</p>
<p>Essentially apt-cache is the tool we use to query the apt software cache to obtain information about packages and apt-get is the tool we use for installing packages and modifying the state of packages installed on the system.</p>
<p>All the examples demonstrated in this article were performed on an Ubuntu 16.04 system.</p>
<p>&nbsp;</p>
<h5>APT-CACHE examples</h5>
<p>&nbsp;</p>
<p><strong>Example 1: List all available packages</strong><br />
To list all packages available to be installed, we use the apt-cache pkgnames command as shown below</p>
<pre><strong>root@linuxnix:~# apt-cache pkgnames</strong>
<strong>libdatrie-doc</strong>
<strong>libfstrcmp0-dbg</strong>
<strong>librime-data-sampheng</strong>
<strong>python-pyao-dbg</strong>
<strong>fonts-georgewilliams</strong>
<strong>python3-aptdaemon.test</strong>
<strong>libcollada2gltfconvert-dev</strong>
<strong>python3-doc8</strong>
<strong>r-bioc-hypergraph</strong>
<strong>angrydd</strong>
<strong>fonts-linuxlibertine</strong>
<strong>---------output truncated for brevity</strong></pre>
<p>Note that this command only shows the package names and no other information about the package.</p>
<p><strong>Example 2: Search for a package</strong><br />
To search for a package use the apt-cache search command followed by the package name.<br />
Let&#8217;s search for the nano text editor.</p>
<pre><strong>root@linuxnix:~# apt-cache search nano</strong>
<strong>nano - small, friendly text editor inspired by Pico</strong>
<strong>alpine-pico - Simple text editor from Alpine, a text-based email client</strong>
<strong>gwave - waveform viewer eg for spice simulators</strong>
<strong>kiki-the-nano-bot - 3D puzzle game, mixing Sokoban and Kula-World</strong>
<strong>kiki-the-nano-bot-data - Kiki the nano bot - game data</strong>
<strong>libaudio-moosic-perl - Moosic client library for Perl</strong>
<strong>--------------------------------------output truncated for brevity</strong></pre>
<p>The apt-cache search command prints the package name along with a short one-line description of the package.<br />
This command performs a fuzzy match as it matches for the string being searched in the package names as well as package description.<br />
Therefore, we get a lot of results and most of them are not entirely accurate.</p>
<p><strong>Example 3: Query information about a package</strong><br />
To obtain information about a package we use the apt-cache show command followed by the package name.<br />
Let&#8217;s view available information for the nano package.</p>
<pre><strong>root@linuxnix:~# apt-cache show nano</strong>
<strong>Package: nano</strong>
<strong>Architecture: amd64</strong>
<strong>Version: 2.5.3-2ubuntu2</strong>
<strong>Priority: standard</strong>
<strong>Section: editors</strong>
<strong>Origin: Ubuntu</strong>
<strong>Maintainer: Ubuntu Developers &lt;ubuntu-devel-discuss@lists.ubuntu.com&gt;</strong>
<strong>Original-Maintainer: Jordi Mallach &lt;jordi@debian.org&gt;</strong>
<strong>Bugs: https://bugs.launchpad.net/ubuntu/+filebug</strong>
<strong>Installed-Size: 684</strong>
<strong>Provides: editor</strong>
<strong>Depends: libc6 (&gt;= 2.14), libncursesw5 (&gt;= 6), libtinfo5 (&gt;= 6)</strong>
<strong>Suggests: spell</strong>
<strong>Conflicts: pico</strong>
<strong>Replaces: pico</strong>
<strong>Filename: pool/main/n/nano/nano_2.5.3-2ubuntu2_amd64.deb</strong>
<strong>Size: 190566</strong>
<strong>MD5sum: e31024f60c11f615be8c3abf86af8cd9</strong>
<strong>SHA1: b2044c27b55e81306128822027d0277ae03a5487</strong>
<strong>SHA256: 1c0ce9033e272743d4037a063c46b011f73efbbd38932bc3a351d5bc471d1a5e</strong>
<strong>Homepage: http://www.nano-editor.org/</strong>
<strong>Description-en: small, friendly text editor inspired by Pico</strong>
<strong>GNU nano is an easy-to-use text editor originally designed as a replacement</strong>
<strong>for Pico, the ncurses-based editor from the non-free mailer package Pine</strong>
<strong>(itself now available under the Apache License as Alpine).</strong>
<strong>.</strong>
<strong>However, nano also implements many features missing in pico, including:</strong>
<strong>- feature toggles;</strong>
<strong>- interactive search and replace (with regular expression support);</strong>
<strong>- go to line (and column) command;</strong>
<strong>- auto-indentation and color syntax-highlighting;</strong>
<strong>- filename tab-completion and support for multiple buffers;</strong>
<strong>- full internationalization support.</strong>
<strong>Description-md5: b7e1d8c3d831118724cfe8ea3996b595</strong>
<strong>Task: standard, ubuntu-touch-core, ubuntu-touch</strong>
<strong>Supported: 5y</strong>

<strong>Package: nano</strong>
<strong>Priority: standard</strong>
<strong>Section: editors</strong>
<strong>Installed-Size: 684</strong>
<strong>Maintainer: Ubuntu Developers &lt;ubuntu-devel-discuss@lists.ubuntu.com&gt;</strong>
<strong>Original-Maintainer: Jordi Mallach &lt;jordi@debian.org&gt;</strong>
<strong>Architecture: amd64</strong>
<strong>Version: 2.5.3-2</strong>
<strong>Replaces: pico</strong>
<strong>Provides: editor</strong>
<strong>Depends: libc6 (&gt;= 2.14), libncursesw5 (&gt;= 6), libtinfo5 (&gt;= 6)</strong>
<strong>Suggests: spell</strong>
<strong>Conflicts: pico</strong>
<strong>Filename: pool/main/n/nano/nano_2.5.3-2_amd64.deb</strong>
<strong>Size: 190920</strong>
<strong>MD5sum: bd757bcdb6ffced902490ca2803c8e15</strong>
<strong>SHA1: 5baa89fa02ef15f26ce09fdbfd1d0be61349b7d7</strong>
<strong>SHA256: 2a61014111de157e6ce05f9e970563719872d5908f8bef43b3576228b2e0af0a</strong>
<strong>Description-en: small, friendly text editor inspired by Pico</strong>
<strong>GNU nano is an easy-to-use text editor originally designed as a replacement</strong>
<strong>for Pico, the ncurses-based editor from the non-free mailer package Pine</strong>
<strong>(itself now available under the Apache License as Alpine).</strong>
<strong>.</strong>
<strong>However, nano also implements many features missing in pico, including:</strong>
<strong>- feature toggles;</strong>
<strong>- interactive search and replace (with regular expression support);</strong>
<strong>- go to line (and column) command;</strong>
<strong>- auto-indentation and color syntax-highlighting;</strong>
<strong>- filename tab-completion and support for multiple buffers;</strong>
<strong>- full internationalization support.</strong>
<strong>Description-md5: b7e1d8c3d831118724cfe8ea3996b595</strong>
<strong>Homepage: http://www.nano-editor.org/</strong>
<strong>Bugs: https://bugs.launchpad.net/ubuntu/+filebug</strong>
<strong>Origin: Ubuntu</strong>
<strong>Supported: 5y</strong>
<strong>Task: standard, ubuntu-touch-core, ubuntu-touch</strong></pre>
<p>This shows a lot of useful information about the package like the available versions, the .deb package file name, dependencies and conflicts and also a package description.</p>
<p><strong>Example 4: Get cache statistics</strong><br />
To check the total number of packages available, we the apt-cache stats command.</p>
<pre><strong>root@linuxnix:~# apt-cache stats</strong>
<strong>Total package names: 70538 (1,411 k)</strong>
<strong>Total package structures: 70546 (3,104 k)</strong>
<strong>Normal packages: 55326</strong>
<strong>Pure virtual packages: 1146</strong>
<strong>Single virtual packages: 4764</strong>
<strong>Mixed virtual packages: 474</strong>
<strong>Missing: 8836</strong>
<strong>Total distinct versions: 62726 (5,018 k)</strong>
<strong>Total distinct descriptions: 118584 (2,846 k)</strong>
<strong>Total dependencies: 369801/98006 (8,964 k)</strong>
<strong>Total ver/file relations: 1482 (35.6 k)</strong>
<strong>Total Desc/File relations: 53048 (1,273 k)</strong>
<strong>Total Provides mappings: 12818 (308 k)</strong>
<strong>Total globbed strings: 157526 (3,489 k)</strong>
<strong>Total slack space: 16.4 k</strong>
<strong>Total space accounted for: 26.9 M</strong>
<strong>Total buckets in PkgHashTable: 50503</strong>
<strong>Unused: 12488</strong>
<strong>Used: 38015</strong>
<strong>Utilization: 75.2728%</strong>
<strong>Average entries: 1.85574</strong>
<strong>Longest: 8</strong>
<strong>Shortest: 1</strong>
<strong>Total buckets in GrpHashTable: 50503</strong>
<strong>Unused: 12488</strong>
<strong>Used: 38015</strong>
<strong>Utilization: 75.2728%</strong>
<strong>Average entries: 1.85553</strong>
<strong>Longest: 8</strong>
<strong>Shortest: 1</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>&nbsp;</p>
<h5>APT-GET examples</h5>
<p>&nbsp;</p>
<p><strong>Example 5: Update ubuntu package lists</strong><br />
The apt-get update command downloads the package lists from the repositories and &#8220;updates&#8221; them to get information on the newest versions of packages and their dependencies.<br />
This command is used to re-synchronize the package index files from their sources.<br />
The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list<br />
Let&#8217;s execute it.</p>
<pre><strong>root@linuxnix:~# apt-get update</strong>
<strong>Hit:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease</strong>
<strong>Hit:2 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease</strong>
<strong>Hit:3 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease</strong>
<strong>Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]</strong>
<strong>Fetched 102 kB in 1s (77.1 kB/s)</strong>
<strong>Reading package lists... Done</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 6: Update the operating system</strong><br />
The apt-get upgrade command is used to upgrade all the currently installed software packages on the system.<br />
the apt-get upgrade command does not remove any currently installed package.</p>
<pre><strong>root@linuxnix:~# apt-get upgrade</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>Calculating upgrade... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws linux-image-4.4.0-1032-aws</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>If you want to upgrade, unconcerned about whether software packages will be added or removed to fulfill dependencies, use the apt-get dist-upgrade command.</p>
<pre><strong>root@linuxnix:~# apt-get dist-upgrade</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>Calculating upgrade... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws linux-image-4.4.0-1032-aws</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>The system that I&#8217;m working on has already been updated with the latest available package updates and that&#8217;s why the upgrade commands completed with zero package updates.</p>
<p><strong>Example 7: Install a package</strong><br />
To install a package we use the apt-get install command followed by the package name.<br />
For demonstration purpose, let&#8217;s install the nmap package.</p>
<pre><strong>root@linuxnix:~# apt-get install nmap</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws linux-image-4.4.0-1032-aws</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>The following additional packages will be installed:</strong>
<strong>libblas-common libblas3 liblinear3 liblua5.2-0 libxslt1.1 lua-lpeg ndiff python-bs4 python-chardet python-html5lib python-lxml</strong>
<strong>python-pkg-resources python-six</strong>
<strong>Suggested packages:</strong>
<strong>liblinear-tools liblinear-dev python-genshi python-lxml-dbg python-lxml-doc python-setuptools</strong>
<strong>The following NEW packages will be installed:</strong>
<strong>libblas-common libblas3 liblinear3 liblua5.2-0 libxslt1.1 lua-lpeg ndiff nmap python-bs4 python-chardet python-html5lib</strong>
<strong>python-lxml python-pkg-resources python-six</strong>
<strong>0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 6,312 kB of archives.</strong>
<strong>After this operation, 28.1 MB of additional disk space will be used.</strong>
<strong>Do you want to continue? [Y/n] y</strong>
<strong>------------------------------output truncated for brevity</strong></pre>
<p>When we type in apt-get install, the apt-get tool first goes through the package lists to find out which repository has the package we are trying to install.<br />
It then gathers information about the package dependencies in the steps step.<br />
Once the required package information is available, the package and any dependencies are downloaded from the appropriate repository and installed on the system.</p>
<p><strong>Example 8: Install packages using wildcards</strong><br />
We can use * wildcard to install packages that match a given package name.<br />
In the below example we attempt to install all packages that have the name git.</p>
<pre><strong>root@linuxnix:~# apt-get install git*</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>Note, selecting 'git-sh' for glob 'git*'</strong>
<strong>Note, selecting 'gitolite' for glob 'git*'</strong>
<strong>Note, selecting 'git-ftp' for glob 'git*'</strong>
<strong>Note, selecting 'git-big-picture' for glob 'git*'</strong>
<strong>Note, selecting 'git-gui' for glob 'git*'</strong>
<strong>Note, selecting 'gitlab-shell' for glob 'git*'</strong>
<strong>Note, selecting 'git-hub' for glob 'git*'</strong>
<strong>------------------------------output truncated for brevity</strong></pre>
<p><strong>Example 9: Install multiple packages in a single command</strong><br />
To install more than one package in a single apt-get install command just specify the additional package names separated by whitespace.<br />
For example:</p>
<pre><strong>apt-get install &lt;package1&gt; &lt;package2&gt;</strong></pre>
<p><strong>Example 10: Install a specific version of a package</strong><br />
To install a specific version of a package, use the syntax apt-get install &lt;package name&gt;=&lt;required version&gt;.<br />
You may obtain the available versions of a package using the apt-cache show &lt;package name&gt; command.<br />
In the below example, we try to install a specific version of the nano package.</p>
<pre><strong>root@linuxnix:~# apt-get install nano=2.5.3-2</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws linux-image-4.4.0-1032-aws</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>Suggested packages:</strong>
<strong>spell</strong>
<strong>The following packages will be DOWNGRADED:</strong>
<strong>nano</strong>
<strong>0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.</strong>
<strong>Need to get 191 kB of archives.</strong>
<strong>After this operation, 0 B of additional disk space will be used.</strong>
<strong>Do you want to continue? [Y/n]</strong></pre>
<p>Since a higher version of the package was already installed, apt-get would&#8217;ve performed a downgrade of the package if we had gone ahead with the install.</p>
<p><strong>Example 11: Remove a package</strong><br />
To remove a package we use the apt-get remove command followed by the package name.<br />
Let&#8217;s remove the nmap package that we had installed earlier.</p>
<pre><strong>root@linuxnix:~# apt-get remove nmap</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>The following packages were automatically installed and are no longer required:</strong>
<strong>libblas-common libblas3 liblinear3 liblua5.2-0 libxslt1.1 linux-aws-headers-4.4.0-1032 linux-headers-4.4.0-1032-aws</strong>
<strong>linux-image-4.4.0-1032-aws lua-lpeg ndiff python-bs4 python-chardet python-html5lib python-lxml python-pkg-resources python-six</strong>
<strong>Use 'apt autoremove' to remove them.</strong>
<strong>The following packages will be REMOVED:</strong>
<strong>nmap</strong>
<strong>0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.</strong>
<strong>After this operation, 21.3 MB disk space will be freed.</strong>
<strong>Do you want to continue? [Y/n] y</strong>
<strong>(Reading database ... 108793 files and directories currently installed.)</strong>
<strong>Removing nmap (7.01-2ubuntu2) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong></pre>
<p><strong>Example 12: Download a package without installation</strong><br />
To download a package without installing use the apt-get download command followed by the package name.<br />
We&#8217;ll download the nmap package to demonstrate.</p>
<pre><strong>root@linuxnix:~# apt-get download nmap</strong>
<strong>Get:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 nmap amd64 7.01-2ubuntu2 [4,638 kB]</strong>
<strong>Fetched 4,638 kB in 0s (43.7 MB/s)</strong></pre>
<p>This downloads the package in the current working directory.</p>
<pre><strong>root@linuxnix:~# ls</strong>
<strong>nmap_7.01-2ubuntu2_amd64.deb</strong></pre>
<p>Note that this does not download the package dependencies.</p>
<p><strong>Example 13: View the changelog for a package</strong><br />
The developers mention changes and updates made to a package throughout its history in the package changelog.<br />
To view the changelog for a package we use the apt-get changelog command followed by the package name.</p>
<pre><strong>root@linuxnix:~# apt-get changelog nmap</strong>
<strong>Get:1 http://changelogs.ubuntu.com nmap 7.01-2ubuntu2 Changelog [27.8 kB]</strong>
<strong>Fetched 27.8 kB in 0s (35.4 kB/s)</strong>
<strong>nmap (7.01-2ubuntu2) xenial; urgency=medium</strong>
<strong>* Revert the last change; no changes left.</strong>
<strong>-- Matthias Klose &lt;doko@ubuntu.com&gt; Thu, 31 Mar 2016 13:36:38 +0200</strong>
<strong>nmap (7.01-2ubuntu1) xenial; urgency=medium</strong>
<strong>* Configure --without-liblua for a first build.</strong>
<strong>-- Matthias Klose &lt;doko@ubuntu.com&gt; Mon, 22 Feb 2016 16:48:47 +0100</strong></pre>
<p><strong>Example 14: Check for broken dependencies</strong><br />
The apt-get check command checks for any dependency issues prevalent in the system.</p>
<pre><strong>root@linuxnix:~# apt-get check</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 15: Clean the apt-get cache directory</strong><br />
When we install packages using apt-get, the utility keeps a local copy of the .deb file for the packages being installed in the /var/cache/apt/archives.<br />
The size of this directory could become significant over time and therefore it makes sense to periodically clean this directory.<br />
The apt-get autoclean command performs this task for us.</p>
<p>Given below is a practical demonstration</p>
<pre><strong>root@linuxnix:~# apt-get autoclean</strong>
<strong>Reading package lists... Done</strong>
<strong>Building dependency tree</strong>
<strong>Reading state information... Done</strong>
<strong>root@linuxnix:~#</strong></pre>
<h4></h4>
<h4>Conclusion</h4>
<p>In this article, we demonstrated the most frequently used features and options of the apt-cache and apt-get utilities.<br />
In our next article, we&#8217;ll explain how to use the apt utility which is a combination of the features provided by apt-cache and apt-get.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/apt-cache-and-apt-get-commands-for-package-management-in-ubuntu/">APT-CACHE and APT-GET commands for package management in Ubuntu</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/apt-cache-and-apt-get-commands-for-package-management-in-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>12 DPKG command examples</title>
		<link>https://www.linuxnix.com/12-dpkg-command-examples/</link>
					<comments>https://www.linuxnix.com/12-dpkg-command-examples/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Thu, 25 Mar 2021 09:30:39 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[dpkg]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=6635</guid>

					<description><![CDATA[<p>Introduction The package manager for Debian and distros derived from Debian is called dpkg or Debian package. As users, we can use dpkg directly or use higher level programs like apt(advanced package management tool) which gives us a few more features. Utilities such as dpkg-deb and dpkg-query use dpkg as a front-end to perform some [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/12-dpkg-command-examples/">12 DPKG command examples</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-6637 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2017/12/12-dpkg-command-examples.jpg" alt="" width="554" height="248"></h4>
<h4>Introduction</h4>
<p>The package manager for Debian and distros derived from Debian is called dpkg or Debian package.<br />
As users, we can use dpkg directly or use higher level programs like apt(advanced package management tool) which gives us a few more features.<br />
Utilities such as dpkg-deb and dpkg-query use dpkg as a front-end to perform some actions.</p>
<p>In this article, we will demonstrate how you can use the dpkg package manager to list, install, uninstall and query package on an Ubuntu 16.04 system.</p>
<p><strong>Example 1: Display dpkg version</strong><br />
To display the version of the dpkg package manager installed on your system use the dpkg command with the &#8211;version option.</p>
<pre><strong>root@linuxnix:~# dpkg --version</strong>
<strong>Debian 'dpkg' package management program version 1.18.4 (amd64).</strong>
<strong>This is free software; see the GNU General Public License version 2 or</strong>
<strong>later for copying conditions. There is NO warranty.</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>&nbsp;</p>
<p><strong>Example 2: List all installed packages</strong><br />
Using the dpkg command with the -l option lists all packages currently installed on the system.</p>
<pre><strong>root@linuxnix:~# dpkg -l</strong>
<strong>Desired=Unknown/Install/Remove/Purge/Hold</strong>
<strong>| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend</strong>
<strong>|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)</strong>
<strong>||/ Name Version Architecture Description</strong>
<strong>+++-==================================-=======================================</strong>
<strong>ii accountsservice 0.6.40-2ubuntu11.1 amd64 query and manipulate user account information</strong>
<strong>ii adduser 3.113+nmu3ubuntu4 all add and remove users and groups</strong>
<strong>ii apparmor 2.10.95-0ubuntu2 amd64 user-space parser utility for AppArmor</strong>
<strong>ii apt 1.2.12~ubuntu16.04.1 amd64 commandline package manager</strong>
<strong>ii apt-transport-https 1.2.12~ubuntu16.04.1 amd64 https download transport for APT</strong>
<strong>-----------------------------------------------------------output truncated for brevity</strong></pre>
<p>As you may observe from the above output, the dpkg -l command displays the package name, it&#8217;s version, the system architecture the package is intended to work on along with a brief description of the package.</p>
<p><strong>Example 3: Check if a particular package is installed</strong><br />
To check if a given package is installed on the system we use the dpkg -l command followed by the package name.<br />
For example, to check if the wget package has been installed on the system, we would use the following command:</p>
<pre><strong>root@linuxnix:~# dpkg -l wget</strong>
<strong>Desired=Unknown/Install/Remove/Purge/Hold</strong>
<strong>| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend</strong>
<strong>|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)</strong>
<strong>||/ Name Version Architecture Description</strong>
<strong>+++-============================================-===========================-</strong>
<strong>ii wget 1.17.1-1ubuntu1.1 amd64 retrieves files from the web</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 4: Display files installed by a package</strong><br />
To display files copied on a system as part of a package installation, use the dpkg command with the -L option followed by the package name.</p>
<pre><strong>root@linuxnix:~# dpkg -L wget</strong>
<strong>/.</strong>
<strong>/etc</strong>
<strong>/etc/wgetrc</strong>
<strong>/usr</strong>
<strong>/usr/bin</strong>
<strong>/usr/bin/wget</strong>
<strong>/usr/share</strong>
<strong>/usr/share/info</strong>
<strong>/usr/share/info/wget.info.gz</strong>
<strong>/usr/share/doc</strong>
<strong>/usr/share/doc/wget</strong>
<strong>/usr/share/doc/wget/MAILING-LIST</strong>
<strong>/usr/share/doc/wget/NEWS.gz</strong>
<strong>/usr/share/doc/wget/AUTHORS</strong>
<strong>/usr/share/doc/wget/copyright</strong>
<strong>/usr/share/doc/wget/changelog.Debian.gz</strong>
<strong>/usr/share/doc/wget/README</strong>
<strong>/usr/share/man</strong>
<strong>/usr/share/man/man1</strong>
<strong>/usr/share/man/man1/wget.1.gz</strong></pre>
<p><strong>Example 5: Display files contained in a .deb package file</strong><br />
In our previous example, we showed you how you could view files that had been installed by a package.<br />
To view files that are part of a .deb package file and would be moved to various locations on the system after we installed the package, use the dpkg command with the -c option followed by the package name.</p>
<pre><strong>root@linuxnix:~# dpkg -c nano_2.7.4-1_amd64.deb </strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./bin/</strong>
<strong>-rwxr-xr-x root/root 225320 2017-01-11 07:40 ./bin/nano</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./etc/</strong>
<strong>-rw-r--r-- root/root 8769 2017-01-11 07:40 ./etc/nanorc</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./usr/</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./usr/share/</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./usr/share/doc/</strong>
<strong>drwxr-xr-x root/root 0 2017-01-11 07:40 ./usr/share/doc/nano/</strong>
<strong>-rw-r--r-- root/root 2372 2016-12-31 22:11 ./usr/share/doc/nano/AUTHORS</strong>
<strong>---------------------------------------output truncated for brevity</strong></pre>
<p><strong>Example 7: Install a package</strong><br />
To install a dpkg package on the system, use the dpkg command with -i option followed by the package name.</p>
<pre><strong>root@linuxnix:~# dpkg -i nano_2.7.4-1_amd64.deb</strong>
<strong>(Reading database ... 62478 files and directories currently installed.)</strong>
<strong>Preparing to unpack nano_2.7.4-1_amd64.deb ...</strong>
<strong>Unpacking nano (2.7.4-1) over (2.5.3-2) ...</strong>
<strong>Setting up nano (2.7.4-1) ...</strong>
<strong>Installing new version of config file /etc/nanorc ...</strong>
<strong>Processing triggers for install-info (6.1.0.dfsg.1-5) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 8: Remove a package</strong><br />
To uninstall a package use the dpkg command with the -r option followed by the package name.</p>
<pre><strong>root@linuxnix:~# dpkg -r nano</strong>
<strong>(Reading database ... 62514 files and directories currently installed.)</strong>
<strong>Removing nano (2.7.4-1) ...</strong>
<strong>update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong>
<strong>Processing triggers for install-info (6.1.0.dfsg.1-5) ...</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>Note that while uninstalling the package we only needed to specify the package name and not the entire .deb file name.</p>
<p><strong>Example 9: Purge a package</strong><br />
Purging a package implies that we remove the binaries installed by the package while still maintaining it&#8217;s configuration file.<br />
We use the -P option with the dpkg command to purge a package.<br />
Let&#8217;s demonstrate it by purging the nano package.</p>
<pre><strong>root@linuxnix:~# dpkg -P nano</strong>
<strong>(Reading database ... 62514 files and directories currently installed.)</strong>
<strong>Removing nano (2.7.4-1) ...</strong>
<strong>update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode</strong>
<strong>Purging configuration files for nano (2.7.4-1) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong>
<strong>Processing triggers for install-info (6.1.0.dfsg.1-5) ...</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 10: Display information about a package</strong><br />
To query information about a package, use the -s option with the dpkg command.<br />
In the below example, we query some information about the wget package.</p>
<pre><strong>root@linuxnix:~# dpkg -s wget</strong>
<strong>Package: wget</strong>
<strong>Status: install ok installed</strong>
<strong>Priority: important</strong>
<strong>Section: web</strong>
<strong>Installed-Size: 880</strong>
<strong>Maintainer: Ubuntu Developers &lt;ubuntu-devel-discuss@lists.ubuntu.com&gt;</strong>
<strong>Architecture: amd64</strong>
<strong>Multi-Arch: foreign</strong>
<strong>Version: 1.17.1-1ubuntu1.1</strong>
<strong>Depends: libc6 (&gt;= 2.17), libidn11 (&gt;= 1.13), libpcre3, libssl1.0.0 (&gt;= 1.0.1), libuuid1 (&gt;= 2.16), zlib1g (&gt;= 1:1.1.4)</strong>
<strong>Recommends: ca-certificates</strong>
<strong>Conflicts: wget-ssl</strong>
<strong>Conffiles:</strong>
<strong>/etc/wgetrc c43064699caf6109f4b3da0405c06ebb</strong>
<strong>Description: retrieves files from the web</strong>
<strong>Wget is a network utility to retrieve files from the web</strong>
<strong>using HTTP(S) and FTP, the two most widely used internet</strong>
<strong>protocols. It works non-interactively, so it will work in</strong>
<strong>the background, after having logged off. The program supports</strong>
<strong>recursive retrieval of web-authoring pages as well as FTP</strong>
<strong>sites -- you can use Wget to make mirrors of archives and</strong>
<strong>home pages or to travel the web like a WWW robot.</strong>
<strong>.</strong>
<strong>Wget works particularly well with slow or unstable connections</strong>
<strong>by continuing to retrieve a document until the document is fully</strong>
<strong>downloaded. Re-getting files from where it left off works on</strong>
<strong>servers (both HTTP and FTP) that support it. Both HTTP and FTP</strong>
<strong>retrievals can be time stamped, so Wget can see if the remote</strong>
<strong>file has changed since the last retrieval and automatically</strong>
<strong>retrieve the new version if it has.</strong>
<strong>.</strong>
<strong>Wget supports proxy servers; this can lighten the network load,</strong>
<strong>speed up retrieval, and provide access behind firewalls.</strong>
<strong>Homepage: https://www.gnu.org/software/wget/</strong>
<strong>Original-Maintainer: Noël Köthe &lt;noel@debian.org&gt;</strong>
<strong>root@linuxnix:~#</strong></pre>
<p><strong>Example 11: Check which package owns a file</strong><br />
To check which package a file belongs to, we use the -S option with the dpkg command followed by the file name.<br />
For example, let&#8217;s check which package provides the ssh command.</p>
<pre><strong>root@linuxnix:~# dpkg -S /usr/bin/ssh</strong>
<strong>openssh-client: /usr/bin/ssh</strong>
<strong>root@linuxnix:~#</strong></pre>
<p>As you may observe from the above output, the ssh command is provided by the openssh-client package.</p>
<p><strong>Example 12: Install all packages in a directory</strong><br />
We can recursively install all .deb package files in a directory by using the -R option in combination with the -i option while invoking the dpkg command.<br />
In the below example, I&#8217;ve used the dpkg command to recursively install all .deb package files available in the /root directory.</p>
<pre><strong>root@linuxnix:~# dpkg -R -i /root</strong>
<strong>Selecting previously unselected package nano.</strong>
<strong>(Reading database ... 62414 files and directories currently installed.)</strong>
<strong>Preparing to unpack /root/nano_2.7.4-1_amd64.deb ...</strong>
<strong>Unpacking nano (2.7.4-1) ...</strong>
<strong>Setting up nano (2.7.4-1) ...</strong>
<strong>update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode</strong>
<strong>update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode</strong>
<strong>Processing triggers for install-info (6.1.0.dfsg.1-5) ...</strong>
<strong>Processing triggers for man-db (2.7.5-1) ...</strong>
<strong>root@linuxnix:~#</strong></pre>
<h4>Conclusion</h4>
<p>In this article, we covered the most frequently used features of the dpkg package manager.<br />
Continuing with our ongoing series of articles based on various package managers, we will be covering apt in our next article.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/12-dpkg-command-examples/">12 DPKG command examples</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/12-dpkg-command-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Monitoring a Remote Centos 6 server with Nagios core</title>
		<link>https://www.linuxnix.com/monitoring-a-remote-centos-6-server-with-nagios-core/</link>
					<comments>https://www.linuxnix.com/monitoring-a-remote-centos-6-server-with-nagios-core/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 05:55:45 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nrpe]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=7976</guid>

					<description><![CDATA[<p>Introduction In our earlier articles on nagios we explained in detail how to install nagios core on the centos 6 system and configure it. In this article we will explain step by step how to monitor a remote machine with nagios core. Prerequisites: We will be installing the packages required for configuring nagios on a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/monitoring-a-remote-centos-6-server-with-nagios-core/">Monitoring a Remote Centos 6 server with Nagios core</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-7977 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2018/10/nagios-client-title.jpg" alt="" width="583" height="217"></h4>
<h4>Introduction</h4>
<p>In our earlier articles on nagios we explained in detail how to install nagios core on the centos 6 system and configure it. In this article we will explain step by step how to monitor a remote machine with nagios core.</p>
<p><strong>Prerequisites:</strong><br />
We will be installing the packages required for configuring nagios on a client machine using the EPEL repository therefore it must be enabled on the system. Please go through our&nbsp;<a href="https://www.linuxnix.com/how-to-install-and-enable-epel-repo-in-rhel-centos-oracle-scentific-linux/">article</a> on how to enable the EPEL repository if you are unfamiliar about how to do so.</p>
<p><strong>Install NRPE and nagios plugins</strong><br />
Now we will install the nrpe package along with nagios plugins using yum.</p>
<pre><strong>[ssuri@nagios-client:~] $ sudo yum install nrpe nagios-plugins-all</strong>
<strong>Loaded plugins: rhnplugin, security</strong>
<strong>This system is receiving updates from RHN Classic or RHN Satellite.</strong>
<strong>Setting up Install Process</strong>
<strong>------------------------------------output truncated for brevity</strong>
<strong>Installed:</strong>
<strong>nagios-plugins-all.x86_64 0:2.2.1-4git.el6 </strong>

<strong>Dependency Installed:</strong>
<strong>fping.x86_64 0:2.4b2-10.el6 lgtonmc.x86_64 0:9.2.1.2-1 lm_sensors.x86_64 0:3.1.1-17.el6 </strong>
<strong>nagios-plugins.x86_64 0:2.2.1-4git.el6 nagios-plugins-breeze.x86_64 0:2.2.1-4git.el6 nagios-plugins-by_ssh.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-cluster.x86_64 0:2.2.1-4git.el6 nagios-plugins-dhcp.x86_64 0:2.2.1-4git.el6 nagios-plugins-dig.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-disk.x86_64 0:2.2.1-4git.el6 nagios-plugins-disk_smb.x86_64 0:2.2.1-4git.el6 nagios-plugins-dns.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-dummy.x86_64 0:2.2.1-4git.el6 nagios-plugins-file_age.x86_64 0:2.2.1-4git.el6 nagios-plugins-flexlm.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-fping.x86_64 0:2.2.1-4git.el6 nagios-plugins-game.x86_64 0:2.2.1-4git.el6 nagios-plugins-hpjd.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-http.x86_64 0:2.2.1-4git.el6 nagios-plugins-icmp.x86_64 0:2.2.1-4git.el6 nagios-plugins-ide_smart.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-ircd.x86_64 0:2.2.1-4git.el6 nagios-plugins-ldap.x86_64 0:2.2.1-4git.el6 nagios-plugins-load.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-log.x86_64 0:2.2.1-4git.el6 nagios-plugins-mailq.x86_64 0:2.2.1-4git.el6 nagios-plugins-mrtg.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-mrtgtraf.x86_64 0:2.2.1-4git.el6 nagios-plugins-mysql.x86_64 0:2.2.1-4git.el6 nagios-plugins-nagios.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-nt.x86_64 0:2.2.1-4git.el6 nagios-plugins-ntp.x86_64 0:2.2.1-4git.el6 nagios-plugins-ntp-perl.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-nwstat.x86_64 0:2.2.1-4git.el6 nagios-plugins-oracle.x86_64 0:2.2.1-4git.el6 nagios-plugins-overcr.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-perl.x86_64 0:2.2.1-4git.el6 nagios-plugins-pgsql.x86_64 0:2.2.1-4git.el6 nagios-plugins-ping.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-procs.x86_64 0:2.2.1-4git.el6 nagios-plugins-real.x86_64 0:2.2.1-4git.el6 nagios-plugins-rpc.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-sensors.x86_64 0:2.2.1-4git.el6 nagios-plugins-smtp.x86_64 0:2.2.1-4git.el6 nagios-plugins-snmp.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-ssh.x86_64 0:2.2.1-4git.el6 nagios-plugins-swap.x86_64 0:2.2.1-4git.el6 nagios-plugins-tcp.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-time.x86_64 0:2.2.1-4git.el6 nagios-plugins-ups.x86_64 0:2.2.1-4git.el6 nagios-plugins-users.x86_64 0:2.2.1-4git.el6 </strong>
<strong>nagios-plugins-wave.x86_64 0:2.2.1-4git.el6 qstat.x86_64 0:2.11-9.20080912svn311.el6</strong></pre>
<p><strong>Modify nrpe.cfg file:</strong><br />
Now that we have installed nrpe we need to tell nrpe the IP address of our nagios server so that nrpe allows active checks from it. For this we modify the allowed_hosts directive in the nrpe.cfg file which is generally located at the path /etc/nagios/nrpe.cfg.</p>
<pre><strong>[ssuri@nagios-client:~] $ grep allowed_hosts /etc/nagios/nrpe.cfg</strong>
<strong>allowed_hosts=127.0.0.1, 192.168.87.134</strong>
<strong>[ssuri@nagios-client:~] $</strong></pre>
<p>Restart NRPE to put the change made in the nrpe.cfg file into effect and also enable the service to start on reboot.</p>
<pre><strong>sudo systemctl start nrpe.service</strong>
<strong>sudo systemctl enable nrpe.service</strong></pre>
<p><strong>Create a configuration file for the client on the nagios core server:</strong></p>
<p>On our Nagios server, we will create a new configuration file for the remote host on which we installed nrpe and nagios plugins. We are creating our host configuration file in the directory /nagiosap/objects/servers. You could create configuration files for the remote hosts that you would like to monitor in a directory of your choice. Just be sure to mention it in the nagios.cfg file so that nagios is aware of the locations. Add in the following host definition, replacing the host_name value with your remote hostname, the alias value with a description of the host and the address value with the private IP address of the remote host.</p>
<p>We&#8217;ve named the file as nagios-client.cfg and added the below content in the file.</p>
<pre><strong>define host {</strong>
<strong>use linux-server</strong>
<strong>host_name nagios-client</strong>
<strong>alias nagios-client Lab server</strong>
<strong>address 10.22.128.28</strong>
<strong>contact_groups admins</strong>
<strong>max_check_attempts 5</strong>
<strong>check_period 24x7</strong>
<strong>notification_interval 30</strong>
<strong>notification_period 24x7</strong>
<strong>}</strong></pre>
<p>What we defined above is referred to as a host definition. With the configuration file above, Nagios will only monitor if the host is up or down. In order to monitor any service on the remote host we need to add service definitions. We&#8217;ve added service definitions for the ping and SSH service in our host configuration file.</p>
<pre><strong>define service {</strong>
<strong>use generic-service</strong>
<strong>host_name nagios-client</strong>
<strong>service_description PING</strong>
<strong>check_command check_ping!100.0,20%!500.0,60%</strong>
<strong>}</strong>

<strong>define service {</strong>
<strong>use generic-service</strong>
<strong>host_name nagios-client</strong>
<strong>service_description SSH</strong>
<strong>check_command check_ssh</strong>
<strong>notifications_enabled 0</strong>
<strong>}</strong></pre>
<p>The value of check_command determines what will be monitored, including status threshold values.&nbsp; We will discus host and service definitions in greater detail in a separate article.</p>
<p>After this reload the nagios service.</p>
<pre><strong>sudo systemctl reload nagios.service</strong></pre>
<p>Now we should be able to see the newly added node in nagios web interface.</p>
<h4>
Conclusion</h4>
<p>This concludes our discussion on how to add a host to be monitored by nagios. Please note that what we&#8217;ve shown here is a very basic client configuration setup. We would be discussing remote host monitoring in greater detail in future articles.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/monitoring-a-remote-centos-6-server-with-nagios-core/">Monitoring a Remote Centos 6 server with Nagios core</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/monitoring-a-remote-centos-6-server-with-nagios-core/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installing Nagios on Centos 7 part 3 (Nagios configuration)</title>
		<link>https://www.linuxnix.com/installing-nagios-on-centos-7-part-3-nagios-configuration/</link>
					<comments>https://www.linuxnix.com/installing-nagios-on-centos-7-part-3-nagios-configuration/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 05:55:40 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Monitoring]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=7973</guid>

					<description><![CDATA[<p>Introduction In our previous two articles we&#8217;ve explained how to install Nagios core on a Centos 7 system and how to install Nagios plugin and the Nagios Remote Plugin Executor. In this article we will explain how to configure Nagios so that we can have the web interface up and running. Note that this needs [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/installing-nagios-on-centos-7-part-3-nagios-configuration/">Installing Nagios on Centos 7 part 3 (Nagios configuration)</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><img class="size-full wp-image-7974 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2018/10/nagios-config-title.jpg" alt="" width="482" height="250"></h4>
<h4>Introduction</h4>
<p>In our previous two articles we&#8217;ve explained how to install Nagios core on a Centos 7 system and how to install Nagios plugin and the Nagios Remote Plugin Executor. In this article we will explain how to configure Nagios so that we can have the web interface up and running. Note that this needs to be done only once on the Nagios server. You may make amendments as deemed necessary.</p>
<p><strong>Update the Nagios main configuration file:</strong><br />
The nagios.cfg file is the heart of your nagios core configuration. The location of this file may vary depending on where you installed nagios. The general location of the file is /usr/local/nagios/etc/nagios.cfg This file contains information about the location of other configuration files and template files which nagios will read in order to determine which assets are to be monitored and which services on those assets are to be monitored. We can define the location to these configuration files using the cfg_file directive. By default Nagios already has most of the configuration files set up and ready to use as shown below:</p>
<pre><strong>[ssuri@linuxnix:/usr/local/nagios/etc] $ grep -E '^cfg_file' nagios.cfg</strong>
<strong>cfg_file=/usr/local/nagios/etc/objects/commands.cfg</strong>
<strong>cfg_file=/usr/local/nagios/etc/objects/contacts.cfg</strong>
<strong>cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg</strong>
<strong>cfg_file=/usr/local/nagios/etc/objects/templates.cfg</strong>
<strong>cfg_file=/nagiosap/objects/hostgroups/linux.cfg</strong>
<strong>cfg_file=/usr/local/nagios/etc/objects/localhost.cfg</strong></pre>
<p>We will talk about the purpose of these configuration files in greater detail in later articles. You could also define a directory location and tell nagios to read all files ending with .cfg extension within that directory.</p>
<p><strong>Add an email address in contacts.cfg file</strong><br />
Now we will specify an email address to which nagios can forward alert related emails. This information is defined in the /usr/local/nagios/etc/objects/contacts.cfg file by default under the email directive.</p>
<pre><strong>[ssuri@linuxnix:~] $ grep email /usr/local/nagios/etc/objects/contacts.cfg</strong>
<strong>email sahil.suri@example.com ; &lt;&lt;***** CHANGE THIS TO YOUR EMAIL ADDRESS ******</strong></pre>
<p>We will talk about configuring email addresses for multiple users and groups in detail in a separate article.</p>
<p><strong>Add configuration for check_nrpe command in commands.cfg file</strong><br />
The NRPE plugin that we installed earlier provides a plugin or command named check_nrpe. We use this command on the nagios core server to run active checks on remote client machines. But in order to use this command it must be defined in the commands.cfg file located at the path /usr/local/nagios/etc/objects/. Given below is the required command definition that needs to be added.</p>
<pre><strong>define command{</strong>
<strong>command_name check_nrpe</strong>
<strong>command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$</strong>
<strong>}</strong></pre>
<p><strong>Apache configuration</strong><br />
Use the htpasswd command to create an admin user, called &#8220;nagiosadmin&#8221;, that will be used to access the Nagios web interface.</p>
<pre><strong>htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin</strong></pre>
<p>If you create a user that is not named &#8220;nagiosadmin&#8221;, you will need to edit /usr/local/nagios/etc/cgi.cfg and change all the &#8220;nagiosadmin&#8221; references to the user you created.</p>
<p>Now we need to edit the nagios configuration file for apache located at /etc/httpd/conf.d/nagios.conf.<br />
In this file comment the following lines:</p>
<pre><strong>Order allow,deny</strong>
<strong>Allow from all</strong></pre>
<p>Replace these lines with the following line:</p>
<pre><strong>Require all granted</strong></pre>
<p>If you are working with an older version of apache then add the following lines instead of the above:</p>
<pre><strong>Order allow,deny</strong>
<strong>Allow from all</strong>

</pre>
<p>With this our apache configuration is complete. Now we need to restart apache with the following command.</p>
<pre><strong>systemctl restart httpd</strong></pre>
<p>Our nagios configuration is also complete with this now. We need to restart the nagios service in order to allow our changes to take effect.</p>
<pre><strong>systemctl restart nagios.service</strong></pre>
<p>Ensure that nagios is running</p>
<pre><strong>[ssuri@linuxnix:~] $ sudo systemctl status nagios</strong>
<strong>* nagios.service - Nagios Core 4.4.2</strong>
<strong>Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)</strong>
<strong>Active: active (running) since Sat 2018-10-13 17:32:06 UTC; 1 weeks 1 days ago</strong>
<strong>Docs: https://www.nagios.org/documentation</strong>
<strong>Process: 15354 ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)</strong>
<strong>Process: 15352 ExecStop=/usr/bin/kill -s TERM ${MAINPID} (code=exited, status=0/SUCCESS)</strong>
<strong>Process: 3225 ExecReload=/usr/bin/kill -s HUP ${MAINPID} (code=exited, status=0/SUCCESS)</strong>
<strong>Process: 15359 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)</strong>
<strong>Process: 15357 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)</strong>
<strong>Main PID: 15361 (nagios)</strong>
<strong>Tasks: 6</strong>
<strong>Memory: 4.0M</strong>
<strong>CGroup: /system.slice/nagios.service</strong>
<strong>|-15361 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg</strong>
<strong>|-15362 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh</strong>
<strong>|-15363 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh</strong>
<strong>|-15364 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh</strong>
<strong>|-15365 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh</strong>
<strong>`-15366 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg</strong>

<strong>Oct 22 04:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 05:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 06:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 07:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 08:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 09:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 10:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 11:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 12:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>Oct 22 13:32:06 linuxnix.example.org nagios[15361]: Auto-save of retention data completed successfully.</strong>
<strong>[ssuri@linuxnix:~] $</strong></pre>
<p><strong>Access the web interface</strong><br />
Once we&#8217;ve ensured that nagios is running on the server we can access the nagios web interface by pointing our browser to the URL http://&lt;nagios_server_ip&gt;/nagios. Because we configured Apache to use htpasswd, we need to enter the login credentials that we created earlier. We used &#8220;nagiosadmin&#8221; as the username.</p>
<h4>
Conclusion</h4>
<p>This completes the nagios server setup. In our next article we will demonstrate how to configure a nagios client machine to be monitored by our nagios core server.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/installing-nagios-on-centos-7-part-3-nagios-configuration/">Installing Nagios on Centos 7 part 3 (Nagios configuration)</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/installing-nagios-on-centos-7-part-3-nagios-configuration/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nagios installation on Centos 7 part 2 (installing plugins and NRPE)</title>
		<link>https://www.linuxnix.com/nagios-installation-on-centos-7-part-2-installing-plugins-and-nrpe/</link>
					<comments>https://www.linuxnix.com/nagios-installation-on-centos-7-part-2-installing-plugins-and-nrpe/#respond</comments>
		
		<dc:creator><![CDATA[Sahil Suri]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 05:55:35 +0000</pubDate>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Monitoring]]></category>
		<guid isPermaLink="false">https://www.linuxnix.com/?p=7970</guid>

					<description><![CDATA[<p>Introduction In our previews article we walked you through installing nagios core on a Centos 7 system. In this article we will explain how to install Nagios plugins and the Nagios Remote Plugin Executor (NRPE) package. How does Nagios work? Nagios core runs from a central server which holds the configuration files. It runs active [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/nagios-installation-on-centos-7-part-2-installing-plugins-and-nrpe/">Nagios installation on Centos 7 part 2 (installing plugins and NRPE)</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img class="size-full wp-image-7971 aligncenter" src="https://www.linuxnix.com/wp-content/uploads/2018/10/nagios-plugin-install-title.jpg" alt="" width="493" height="267"></p>
<h4>Introduction</h4>
<p>In our previews article we walked you through installing nagios core on a Centos 7 system. In this article we will explain how to install Nagios plugins and the Nagios Remote Plugin Executor (NRPE) package.</p>
<p><strong>How does Nagios work?</strong><br />
Nagios core runs from a central server which holds the configuration files. It runs active checks to monitor the state of services like HTTP and SSH, check if the server is up via ICMP and also monitor resource consumption like in the form of CPU load, memory utilization etc. The core server has a huge library of plugins and much of the functionality and flexibility of Nagios is derived from the use of these plugins.</p>
<p><strong>What are Nagios plugins?</strong><br />
Plugins are compiled executable or scripts (Perl scripts, shell scripts, etc.) that can be run from a command line to check the status or a host or service.&nbsp; Nagios uses the results from plugins to determine the current status of hosts and services on your network. Nagios will execute a plugin whenever there is a need to check the status of a service or host.&nbsp; The plugin does something to perform the check and then simply returns the results to Nagios.&nbsp;It will process the results that it receives from the plugin and take any necessary actions.</p>
<p><strong>Installing Nagios plugins</strong><br />
The plugins which provide the most commonly needed and used monitoring checks are available as a tarball which we will download and install. At the time of this writing, the latest version is Nagios Plugins 2.1.1.</p>
<pre><strong>[ssuri@linuxnix:~] $ curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz</strong>
<strong>% Total % Received % Xferd Average Speed Time Time Time Current</strong>
<strong>Dload Upload Total Spent Left Speed</strong>

<strong>0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0</strong>
<strong>0 2664k 0 1213 0 0 1330 0 0:34:11 --:--:-- 0:34:11 1331</strong>
<strong>36 2664k 36 975k 0 0 537k 0 0:00:04 0:00:01 0:00:03 537k</strong>
<strong>100 2664k 100 2664k 0 0 1071k 0 0:00:02 0:00:02 --:--:-- 1072k</strong>
<strong>[ssuri@linuxnix:~] $ tar xvf nagios-plugins-2.2.1.tar.gz </strong>
<strong>nagios-plugins-2.2.1/</strong>
<strong>nagios-plugins-2.2.1/perlmods/</strong>
<strong>nagios-plugins-2.2.1/perlmods/Config-Tiny-2.14.tar.gz</strong>
<strong>nagios-plugins-2.2.1/perlmods/parent-0.226.tar.gz</strong>
<strong>nagios-plugins-2.2.1/perlmods/Test-Simple-0.98.tar.gz</strong>
<strong>nagios-plugins-2.2.1/perlmods/Makefile.in</strong>
<strong>nagios-plugins-2.2.1/perlmods/version-0.9903.tar.gz</strong>
<strong>nagios-plugins-2.2.1/perlmods/Makefile.am</strong>
<strong>-----------------------------------------output truncated for brevity</strong>

<strong>[ssuri@linuxnix:~] $ cd nagios-plugins-2.2.1</strong>
<strong>[ssuri@linuxnix:~/nagios-plugins-2.2.1] $ ls</strong>
<strong>ABOUT-NLS AUTHORS config.h.in configure.ac INSTALL Makefile.am nagios-plugins.spec.in perlmods plugins-scripts REQUIREMENTS THANKS</strong>
<strong>acinclude.m4 build-aux config.rpath COPYING LEGAL Makefile.in NEWS pkg po SUPPORT tools</strong>
<strong>ACKNOWLEDGEMENTS ChangeLog config_test FAQ lib mkinstalldirs NPTest.pm plugins README tap</strong>
<strong>aclocal.m4 CODING configure gl m4 nagios-plugins.spec NP-VERSION-GEN plugins-root release test.pl.in</strong></pre>
<p>Now we will configure the plugins using the configure script provided with the tarball.</p>
<pre><strong>[ssuri@linuxnix:~/nagios-plugins-2.2.1] $ ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl</strong>
<strong>[ssuri@linuxnix:~/nagios-plugins-2.2.1] $ sudo </strong>
<strong>checking for a BSD-compatible install... /usr/bin/install -c</strong>
<strong>checking whether build environment is sane... yes</strong>
<strong>checking for a thread-safe mkdir -p... /usr/bin/mkdir -p</strong>
<strong>checking for gawk... gawk</strong>
<strong>checking whether make sets $(MAKE)... yes</strong>
<strong>checking whether to disable maintainer-specific portions of Makefiles... yes</strong>
<strong>checking build system type... x86_64-unknown-linux-gnu</strong>
<strong>checking host system type... x86_64-unknown-linux-gnu</strong>
<strong>checking for gcc... gcc</strong>
<strong>checking for C compiler default output file name... a.out</strong>
<strong>checking whether the C compiler works... yes</strong>
<strong>checking whether we are cross compiling... no</strong>
<strong>checking for suffix of executables... </strong>
<strong>-----------------------------------------output truncated for brevity</strong></pre>
<p>Now compile Nagios Plugins with this command:</p>
<pre><strong>[ssuri@linuxnix:~/nagios-plugins-2.2.1] $ make</strong></pre>
<p>Then install it with the &#8216;make install&#8217; command.</p>
<pre><strong>[ssuri@linuxnix:~/nagios-plugins-2.2.1] $ sudo make install</strong></pre>
<p><strong>Installing NRPE</strong><br />
NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). We talk about NRPE in depth in another article. For now we will explain how to install it on our Centos 7 system. We will download the NRPE source code using curl and then configure, compile and install it from source as we&#8217;ve done with Nagios core and Nagios plugins earlier.</p>
<pre><strong>[ssuri@linuxnix:~] $ curl -L -O http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz</strong>
<strong>% Total % Received % Xferd Average Speed Time Time Time Current</strong>
<strong>Dload Upload Total Spent Left Speed</strong>

<strong>0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0</strong>
<strong>100 349 100 349 0 0 1376 0 --:--:-- --:--:-- --:--:-- 1384</strong>
<strong>[2018-10-09 12:34:08] </strong>
<strong>0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0</strong>
<strong>100 409k 100 409k 0 0 395k 0 0:00:01 0:00:01 --:--:-- 714k</strong>
<strong>[ssuri@linuxnix:~] $ tar xvf nrpe-*.tar.gz</strong>
<strong>nrpe-2.15/</strong>
<strong>nrpe-2.15/Changelog</strong>
<strong>nrpe-2.15/LEGAL</strong>
<strong>nrpe-2.15/Makefile.in</strong>
<strong>nrpe-2.15/README</strong>
<strong>nrpe-2.15/README.SSL</strong>
<strong>nrpe-2.15/README.Solaris</strong>
<strong>nrpe-2.15/SECURITY</strong>
<strong>-----------------------------------------output truncated for brevity</strong></pre>
<pre><strong>[ssuri@linuxnix:~/nrpe-2.15] $./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu</strong>
<strong>checking for a BSD-compatible install... /usr/bin/install -c</strong>
<strong>checking build system type... x86_64-unknown-linux-gnu</strong>
<strong>checking host system type... x86_64-unknown-linux-gnu</strong>
<strong>checking for gcc... gcc</strong>
<strong>checking for C compiler default output file name... a.out</strong>
<strong>checking whether the C compiler works... yes</strong>
<strong>checking whether we are cross compiling... no</strong>
<strong>checking for suffix of executables... </strong>
<strong>checking for suffix of object files... o</strong>
<strong>checking whether we are using the GNU C compiler... yes</strong>
<strong>checking whether gcc accepts -g... yes</strong>
<strong>checking for gcc option to accept ANSI C... none needed</strong>
<strong>checking whether make sets $(MAKE)... yes</strong>
<strong>checking how to run the C preprocessor... gcc -E</strong>
<strong>checking for egrep... grep -E</strong>
<strong>checking for ANSI C header files... yes</strong>
<strong>checking whether time.h and sys/time.h may both be included... yes</strong>
<strong>checking for sys/wait.h that is POSIX.1 compatible... yes</strong>
<strong>checking for sys/types.h... yes</strong>
<strong>-----------------------------------------output truncated for brevity</strong></pre>
<p>Now build and install NRPE and its xinetd startup script with these commands:</p>
<pre><strong>[ssuri@linuxnix:~/nrpe-2.15] $ make all</strong>
<strong>[ssuri@linuxnix:~/nrpe-2.15] $ sudo make install</strong>
<strong>[ssuri@linuxnix:~/nrpe-2.15] $ sudo make install-xinetd</strong>
<strong>[ssuri@linuxnix:~/nrpe-2.15] $ sudo make install-daemon-config</strong></pre>
<p>Edit the /etc/xinetd.d/nrpe file using vi or any other editor of your choice and add the IP address of the Nagios core server in the only_from directive.</p>
<pre><strong>[ssuri@linuxnix:~] $ cat /etc/xinetd.d/nrpe</strong>
<strong># default: on</strong>
<strong># description: NRPE (Nagios Remote Plugin Executor)</strong>
<strong>service nrpe</strong>
<strong>{</strong>
<strong>flags = REUSE</strong>
<strong>socket_type = stream</strong>
<strong>port = 5666</strong>
<strong>wait = no</strong>
<strong>user = nagios</strong>
<strong>group = nagios</strong>
<strong>server = /usr/local/nagios/bin/nrpe</strong>
<strong>server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd</strong>
<strong>log_on_failure += USERID</strong>
<strong>disable = no</strong>
<strong>only_from = 127.0.0.1 192.168.87.134</strong>
<strong>}</strong>
<strong>[ssuri@linuxnix:~] $</strong></pre>
<p>This will allow Nagios core to communicate with NRPE.</p>
<p>Restart the xinetd service to start NRPE:</p>
<pre><strong>[ssuri@linuxnix:~] $ sudo service xinetd restart</strong></pre>
<h4>
Conclusion</h4>
<p>With this we&#8217;ve complete the second and third steps involved in getting our Nagios core installation up and running. In the next article we will go through the final phase towards completing our setup and that is the Nagios core configuration.</p>
<p>The post <a rel="nofollow" href="https://www.linuxnix.com/nagios-installation-on-centos-7-part-2-installing-plugins-and-nrpe/">Nagios installation on Centos 7 part 2 (installing plugins and NRPE)</a> appeared first on <a rel="nofollow" href="https://www.linuxnix.com">The Linux Juggernaut</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxnix.com/nagios-installation-on-centos-7-part-2-installing-plugins-and-nrpe/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
