Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Youtube

Github Stackoverflow Pinterest

Download and install dependencies and keep them updated


Overview

This repo is about making use of utilities that install software on various operating systems.

There are different package managers for each operating system and language:

Operating System Command File Folder  
Red Hat, Fedora, CentOS yum .rpm /var/lib/rpm  
Debian, Ubuntu apt-get, dpkg .deb apt repositories  
SUSE, openSUSE zypper .rpm -  
MacOS brew - Homebrew.org  
Windows choco .nuget Chocolatey.org  
Java mvn pom.xml - -
Ruby rake .gemfile - -
Node npm .npm - -
Python pip package.json - -

Some were developed by the same people who wrote the operating system or

Other (in the case of Mac, Windows) were developed by others.

Each package manager have a different architecture and way of working.

They all have similar functionality:

  1. The package manager utility is downloaded and installed.
  2. Packages are stored in a website or a local network folder.
  3. A text file associated with each application specifies the files to be downloaded and installed for that application.
  4. A utility is run to download and install packages based on the specification file.
  5. A utility is run to list what has been installed by various specification files.
  6. A utility is run to provide information about each package.
  7. A utility is run to identify updates and installs them.
  8. A utility is run to identify which others are dependent on a package.
  9. A utility is run to remove packages for an application (to free up disk space).

RPM

  1. RPM comes with Red Hat, Fedora, and CentOS operating systems.

    The RPM database is located by default at:
    /var/lib/rpm

  2. RPM works with files from DVD media or file folder.

  3. Files for each app are defined in .rpm files.

  4. To install files specified in an .rpm file from that application’s folder:

    rpm ?
    

    To -install a package from a source:

    rpm -i package.rpm
    
  5. To -query a -list of all rpms installed:

    rpm -ql
    

    “x86_64” is for 64-bit x86 (Intel) machines.

  6. To -query -package -information:

    rpm -qpi package.rpm
    
  7. To update:

    rpm -u
    
  8. To -identify which others are dependent on a package:

    rpm -i package.rpm
    
  9. To remove packages for an app:

    rpm -e myapp
    

Zypper for SUSE

  1. The SUSE and openSUSE operating systems also use .rpm files.

    However, SUSE use the zypper se packagename.

    The RPM database is located by default at:
    /var/lib/rpm

  2. RPM works with files from DVD media or file folder.

  3. Files for each app are defined in .rpm files.

  4. To install files specified in an .rpm file from that application’s folder:

    zypper in package
    
  5. To -query a -list of all rpms installed:

    ?
    
  6. To search for a package:

    zypper se package
    
  7. To update:

    zypper update
    
  8. To -identify which others are dependent on a package:

    ?
    
  9. To remove packages for an app:

    zypper rm myapp
    

YUM (Yellowdog Unified Manager)

https://access.redhat.com/videos/214873 is a video overview about yum.

https://access.redhat.com/articles/yum-cheat-sheet lists all the commands.

  1. YUM comes with Red Hat, Fedora, and CentOS operating systems, running as yum.repos.d daemon.

    To see information about itself:

    yum repolist
    
  2. To search rpms available from the website:

    yum search myapp
    

    List groups of software available and installed:

    yum grouplist
    
  3. Files for each app are defined in .rpm files.

    Old versions are not deleted in case one wants to yum downgrade <em>package</em>.

  4. To install files specified in an .rpm file from that application’s folder:

    yum install myapp
    
  5. To operate on packages as batched commands:

    yum shell 
    info package
    ts
    run
    

    ts is transaction summary listing the commands to be run.

    The commands can be in a file for processing.

  6. To list what all has been installed:

    yum list installed
    

    To list updates available:

    yum updatelist info package
    

    To list what updates will occur:

    yum check-update
    
  7. To perform the upgrade:

    yum upgrade package
    
  8. To -identify which others are dependent on a package:

    ?
    
  9. To remove packages for an app:

    yum remove myapp -y
    

    -y says don’t prompt “are you sure?”.

APT

  1. API comes with Debian and Ubuntu operating systems, running as /etc/apt/aptdaemon/.

    The DPKG database is located by default at:
    /var/lib/dpkg

    To see information about itself:

  2. To search debs available locally:

    ls /var/cache/apt
    ls /var/cahce/apt/archives/
    
  3. Files for each app are defined in .deb files.

  4. To -install files specified in an .rpm file from that application’s folder:

    apt-get install package
    

    For a specific package:

    dpkg -i package
    
  5. To uninstall:

    dpkg-reconfigure package 
    
  6. To -list what all has been installed:

    dpkg -l
    

    To list updates available:

  7. To obtain the latest versions:

    apt-get update
    
  8. To -identify which others are dependent on a package:

    ?
    
  9. To remove packages for an app:

    dpkg -r package -y
    

    -y says don’t prompt “are you sure?”.


Rake Ruby gemfiles

https://www.digitalocean.com/community/tutorials/how-to-work-with-the-ruby-package-manager-rubygems-getting-started


Share libraries

(These don’t work on Macs)

To list shared libraries (.so files) for the ls command:

ldd /bin/ls
   

To list loaded kernel (.ko) modules:

lsmod
   

The PATH to search for modules is maintained in:

ls /etc/ls.so.conf
   

List:

lldconfig -p | grep vmware
   

For module parameters, look in directory:

/etc/modprobe.d
   

Further reading

Linux Installation and Initial Configuration 2 Jun 2014 by Andrew Mallett covers half the material of the LPIC-1 Linux certification.