Download and install dependencies and keep them updated
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:
- The package manager utility is downloaded and installed.
- Packages are stored in a website or a local network folder.
- A text file associated with each application specifies the files to be downloaded and installed for that application.
- A utility is run to download and install packages based on the specification file.
- A utility is run to list what has been installed by various specification files.
- A utility is run to provide information about each package.
- A utility is run to identify updates and installs them.
- A utility is run to identify which others are dependent on a package.
- A utility is run to remove packages for an application (to free up disk space).
RPM
-
RPM comes with Red Hat, Fedora, and CentOS operating systems.
The RPM database is located by default at:
/var/lib/rpm -
RPM works with files from DVD media or file folder.
-
Files for each app are defined in .rpm files.
-
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
-
To -query a -list of all rpms installed:
rpm -ql
“x86_64” is for 64-bit x86 (Intel) machines.
-
To -query -package -information:
rpm -qpi package.rpm
-
To update:
rpm -u
-
To -identify which others are dependent on a package:
rpm -i package.rpm
-
To remove packages for an app:
rpm -e myapp
Zypper for SUSE
-
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 -
RPM works with files from DVD media or file folder.
-
Files for each app are defined in .rpm files.
-
To install files specified in an .rpm file from that application’s folder:
zypper in package
-
To -query a -list of all rpms installed:
?
-
To search for a package:
zypper se package
-
To update:
zypper update
-
To -identify which others are dependent on a package:
?
-
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.
-
YUM comes with Red Hat, Fedora, and CentOS operating systems, running as
yum.repos.d
daemon.To see information about itself:
yum repolist
-
To search rpms available from the website:
yum search myapp
List groups of software available and installed:
yum grouplist
-
Files for each app are defined in .rpm files.
Old versions are not deleted in case one wants to
yum downgrade <em>package</em>
. -
To install files specified in an .rpm file from that application’s folder:
yum install myapp
-
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.
-
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
-
To perform the upgrade:
yum upgrade package
-
To -identify which others are dependent on a package:
?
-
To remove packages for an app:
yum remove myapp -y
-y
says don’t prompt “are you sure?”.
APT
-
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 -
To see information about itself:
dpkg --get-selections | grep -w install
-
To search debs available locally:
ls /var/cache/apt ls /var/cahce/apt/archives/
-
Files for each app are defined in .deb files.
-
To -install files specified in an .rpm file from that application’s folder:
apt-get install package
For a specific package:
dpkg -i package
-
To uninstall:
dpkg-reconfigure package
-
To -list what all has been installed:
dpkg -l
To list updates available:
-
To obtain the latest versions:
apt-get update
-
To -identify which others are dependent on a package:
?
-
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.