TCM Security Academy Notes - by syselement
🏠 Home BlogGitHub📚 Buy Me a Book
  • TCM Security Academy Notes
  • Courses
    • TCM - Linux 101
      • 1. Introduction
        • Linux Distributions
        • Installing Linux
      • 2. Command Line
        • Intro to Command Line
        • Getting help on the Command Line
        • Command Line Arguments and Options
        • Reading Text Files
      • 3. File System
        • Filesystem Hierarchy Standard
        • Devices, Partitions and Mounting
        • Absolute and Relative Paths
        • Files and Directories
        • Paths, Filenames and Text Files
        • Filesystem Links
        • Archiving and Searching Files
      • 4. Users and Groups
        • Working with Users and Groups
        • File and Directory Permissions
        • Changing Users and Passwords
      • 5. Installing Software
        • Package Management
      • 6. Shells
        • Common Command Line Shells
        • Environment Variables & Startup Files
        • Input/Output Redirection
        • Command History & Substitution
      • 7. Utilities and File Editors
        • Searching and Processing Text
        • Networking at the Command Line
        • File Transfer
        • Text Editors and Converters
      • 8. Process Management
        • Process Information
        • Foreground and Background Processes
        • Managing Processes
        • Scheduling Processes
      • 9. Regular Expressions
        • Regular Expressions, Searching, Replacing, Building
      • 10. Bash Scripting
        • Bash Scripting Basics, Control Structures, Loops
      • 🌐Linux101 References
    • TCM - Mobile Application Penetration Testing
      • 1. Introduction & Mobile Pentesting
      • 2. Android Security
      • 3. Android Lab Setup
      • 4. Android Static Analysis
      • 5. Android Dynamic Analysis
      • 6. Android Bug Bounty
      • 7. iOS Security
      • 8. iOS Lab Setup
      • 9. iOS Static Analysis
      • 10. iOS Dynamic Analysis
      • 11. iOS Bug Bounty
      • 🌐MAPT References
    • TCM - Practical Ethical Hacking
      • 1. Introduction & Networking
      • 2. Lab Set Up, Linux & Python
        • Intro to Kali Linux
        • Intro to Python
      • 3. The Ethical Hacker Methodology
        • Information Gathering
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • Capstone Practical Labs
      • 4. Active Directory
        • Active Directory Lab
        • AD - Initial Attack Vectors
        • AD - Post-Compromise Enumeration
        • AD - Post-Compromise Attacks
        • AD - Additional Attacks
        • AD - Case Studies
      • 5. Post Exploitation
      • 6. Web Application
        • Web App Lab Setup
        • Web App - SQL Injection
        • Web App - XSS
        • Web App - Command Injection
        • Web App - Insecure File Upload
        • Web App - Authentication Attacks
        • Web App - XXE
        • Web App - IDOR
        • Web App - Capstone Practical Lab
      • 7. Wireless Attacks
      • 8. Legal Documentation & Report Writing
      • 🌐PEH References
  • 🏠syselement's Blog Home
Powered by GitBook
On this page
  • Debian
  • dpkg
  • apt
  • Red Hat
  • rpm
  • yum
  • Manual Installing
  • checkinstall

Was this helpful?

Edit on GitHub
  1. Courses
  2. TCM - Linux 101
  3. 5. Installing Software

Package Management

Previous5. Installing SoftwareNext6. Shells

Last updated 2 years ago

Was this helpful?

  • Modern Linux distributions primarly use a Software Manager, a centralized system, automating installing, updating, configuring and uninstalling software.

  • The package manager stores the program's executable, libraries and configuration into a single archive, called a package.

  • Two prevelant format standards are .deb (for Debian distros) and .rpm (for RedHat distros).

  • On desktop invironments there is a GUI package management system.

  • Programs depend on third party libraries. Those dependencies are handled by the package manager automatically.

Debian

📌

  • There are many package management tools, but two of them are primarly used.

dpkg

  • dpkg - low level tool

dpkg -i package_name.deb

apt

  • apt - commandline package manager. It provides commands for searching, managing, querying information about packages.

sudo apt update
# update list of available packages

sudo apt upgrade
# upgrade packages and O.S. (download and installation)

sudo apt search package_name
# search for package if present

sudo apt search duf
    Sorting... Done
    Full Text Search... Done
    duf/jammy 0.6.2-1build1 amd64
      Disk Usage/Free Utility
sudo apt show duf
# Show "duf" package information
# Packages can be in transitional status

sudo apt install package_name
# install the package, the use needs to be root

sudo apt remove package_name
# remove the package, NOT the dependencies/config files

sudo apt purge package_name
# remove the package including all configuration files

sudo apt autoremove
# Remove unused packages/dependencies

sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# One line to update packages, O.S. and clean unneeded depencencies

Red Hat

rpm

  • rpm - low level tool

rpm -ivh package_name.rpm

yum

  • yum - packaging system used by RedHat distros

sudo yum update
# Combination of update + upgrade of apt command

yum search package_name
yum info package_name
sudo yum install package_name
sudo yum remove package_name

sudo tail /var/log/yum.log
# view yum history

Manual Installing

  • Some software do not have a package for the used distribution. The alternative is to download the source code of the programs and compile it.

  • First thing, install the tools necessary to build the software:

sudo apt update
sudo apt install build-essential automake checkinstall libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc curl
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.38.0.tar.gz
# Download the tarball and build from source

tar xfz git-2.38.0.tar.gz
# x for extract, f for file, z filter the archive through gzip
cd git-2.38.0/

# Configure the build environment:
less INSTALL
# for Git installation info

./configure
# creates a Makefile, used by the make utility to build and install the sw

make
# compiles the code, the process will take a while

sudo make install
# installs the compiled software

checkinstall

  • Instead of sudo make install, checkinstall tool can be used.

  • It keeps track of all files installed by a "make install", creates rpm/deb package with those files and adds it to the installed packages database.

sudo apt update && sudo apt install checkinstall

cd git-2.38.0/
sudo make; sudo checkinstall
# installs the software and creates .deb file
**********************************************************************
Done. The new package has been installed and saved to
/home/user/git-2.38.0/git_2.38.0-1_amd64.deb
You can remove it from your system anytime using: 
     dpkg -r git
**********************************************************************

sudo dpkg -r package_name
# Remove package_name

📌

Install git manually ():

Debian package management manual
Red Hat package management manual
git download page