Pages

Tuesday, August 9, 2016

Check dependencies of local RPM package

We all know that for managing packages or softwares on any system, we need some kind of tool which can be used to manage the packages or softwares. Different distributions have its know tool for achieving the same.

                     For example for RHEL/Centos/Fedora we use RPM(RPM Package Manager)
 for all rpm package management which take care of "installation, uninstallation, update, query etc.



              So, sometimes whenever we install any package we get lots of error regarding the dependencies. Here we are discussing that how we can list dependencies associated with particular rpm file.


1.) Check for file i,e, yet package is not installed:
         rpm -qpR {rpm-file}  
e.g. test
    -----
    -----
    output truncated..
  2.) If packages is already installed:
      rpm -qR {package-name}
e.g. :

   3.) Dry run without installing the package:
         rpm -Uvh --test {rpm-file}
  e.g.:

Finally, yes of course if you don't make these checks and just try to install then you will get list of missing dependencies as well.

Monday, April 25, 2016

Remount multiple NFS mount points on Client in one go

                                     Sometimes we may have number of mount points available on NFS clients and after making changes for any one of parameters, we have to remount all partitions. Doing umount and mount on multiple partitions will really be hectic job and there may be chances of human errors.
     
    We can do this using single command to achieve the same. Sharing some other commands as well, before moving to exact one :).

  • Get the list of all NFS mount points available on System:
                     Before moving ahead with changes, lets see how many partitions are their on system. Below command will do trick and give you all the nfs mount points without any header and headers.
    • Without headers -
                     #df -PF nfs | awk '{if(NR>1)print}'     # This command will suppress header line 


    • With headers-
                   #df -PF nfs 

  • Here goes the actual thing, where we need to mount and remount multiple nfs partitions after making changes to parameters.
                    #for M in $(mount | awk '/type nfs / {print $3;}'); do echo $M; sudo umount $M && sudo mount $M && echo "ok :)"; done


[Note: Execute at your own risk after doing testing on test environments ;) ]

Monday, March 21, 2016

"ERROR: Could not find cookbook in your cookbook path, skipping it" in Chef

Chef is a automation framework tool which help us to deploy code or configuration across multiple systems which may be physical, virtual or cloud systems.

Here I am just want to highlight one small issue which I got when I was trying to upload cookbook from my workstation. Everything was in place, but still it was throwing below error:

$ knife  cookbook upload cookbook_nameERROR: Could not find cookbook cookbook_name in your cookbook path, skipping it
ERROR: Failed to upload 1 cookbook.

Usually, by default knife will use default location specified in ~/.chef/knife.rb file for cookbook. In my everything was correctly configured as below :

$ cat ~/.chef/knife.rb | grep cookbook_path
cookbook_path [ '.', '..' ]
I was trying to upload as per directory name given to cookbook.


After, doing lots of search finally got to know that knife command will compare the cookbook name from metadata.rb file in cookbook directory. Then I made the correction in metadata.rb file and it works like charm as below: