Wilson Mar bio photo

Wilson Mar

Hello!

Calendar YouTube Github

LinkedIn

Download and install dependencies and keep them updated

US (English)   Norsk (Norwegian)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Estonian   اَلْعَرَبِيَّةُ (Egypt Arabic)   Napali   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean

Overview

This article 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 from:

    /etc/apt/aptdaemon/

    The program references the DPKG database located by default at:
    /var/lib/dpkg

    DPKG

  2. To see information about itself:

    dpkg --get-selections | grep -w install
    
  3. To search debs available locally:

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

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

    apt-get install package
    

    For a specific package:

    dpkg -i package
    
  6. To uninstall:

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

    dpkg -l
    

    To list updates available:

  8. To obtain the latest versions:

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

    ?
    
  10. 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
   

Video course

Linux Installation and Initial Configuration 2 Jun 2014 by Andrew Mallett covers about half the material in the LPIC-1 Linux exam.