Linux Flashcards
How can you install software on a Linux system and what are the common package managers used in Linux?
What are software packages and package managers?
A software package is a collection of files and metadata that contains the information and instructions needed to install, run, and remove a software application or component. Software packages can have different formats, such as .deb, .rpm, .tar.gz, .snap, or .appimage, depending on the distribution and the packaging system used. A package manager is a tool that simplifies the process of installing, updating, and removing software packages by resolving dependencies, checking compatibility, and verifying integrity. Some of the most popular package managers in Linux are apt, yum, dnf, pacman, snap, and flatpak.
How to use apt to install and remove .deb packages?
Apt is the package manager utilized by Debian-based distributions, such as Ubuntu, Mint, or Kali. It is used to manage .deb packages, which are compressed archives that contain the binary files and the control files of the software. To use apt, you must open a terminal and execute the following commands:
sudo apt update
, which updates the list of available packages from the repositories;
sudo apt install package_name
, which installs a package by name;
sudo apt remove package_name
, which removes a package by name;
sudo apt install /path/to/file.deb
, which installs a package from a local .deb file; and
sudo apt purge package_name
, which removes a package and its configuration files.
How to use yum or dnf to install and remove .rpm packages?
Yum and dnf are the package managers used by Red Hat-based distributions, such as Fedora, CentOS, or RHEL. These managers work with .rpm packages, which are compressed archives that contain the binary files and the metadata of the software. To use yum or dnf, you need to open a terminal and use certain commands. For example, if you want to update the list of available packages from the repositories, then you should use
sudo yum update
or
sudo dnf update
. If you want to install a package by name, then type in
sudo yum install package_name
or
sudo dnf install package_name
. To remove a package by name, you can use
sudo yum remove package_name
or
sudo dnf remove package_name
. If you want to install a package from a local .rpm file, type in
sudo yum localinstall /path/to/file.rpm
or
sudo dnf localinstall /path/to/file.rpm
. Lastly, if you want to remove a package and its dependencies, use
sudo yum autoremove package_name
or
sudo dnf autoremove package_name
How to use pacman to install and remove .tar.gz packages?
Pacman is the package manager used by Arch-based distributions, such as Manjaro, EndeavourOS, or Arch Linux. It works with .tar.gz packages, which are compressed archives containing the binary files and metadata of the software. To use pacman, you need to open a terminal and type in certain commands. For instance, to update the list of available packages from the repositories, type in
sudo pacman -Syu
. To install a package by name, use
sudo pacman -S package_name
. To remove a package by name, use
sudo pacman -R package_name
. If you want to install a package from a local .tar.gz file, type in
sudo pacman -U /path/to/file.tar.gz
. To remove a package and its dependencies, use
sudo pacman -Rs package_name
. Pacman is an important tool for managing software on Arch-based distributions
Explain the Linux file system / structure
Why the Drive C?
Since early computers only had floppy drives, they were called a and b and they were removable, the first hard drive letter turned out to be C.
What is Mac’s ancestor?
Unix
What can you find in /bin and /sbin folder?
It is short for binaries and these are the most basic binaries, which is another word for programs or applications. ls, cat etc kind of functions are stored here.
In the sbin folder there are system binaries that a system admin would use and a standard user wouldnt have access without permission. When you install a program on Linux, it’s typically not placed in these folders.
What is /boot folder in Linux?
It contains everything your OS needs to boot. Bootloaders live here.
What is /dev folder in Linux?
This is where your devices live. Here you will find your hardware. Everything in Linux is a file, so you can find your disk and your partition in this folder. Everything else also lives here, your webcam, keyboard etc. This is an area where applications and drivers should access.
What is /etc folder in Linux?
etc has system wide application configuration.
What are /lib folders doing?
These are where the libraries stored
What are /mnt and /media folders for?
Floppy disk, external disk, second hard drive, these are here. A B D drive are here. /media OS managed, mnt for us to mount.
What is /opt?
Optional. For all the applications that we install can go here.