FUNDAMENTALS A Complete Guide for Beginners
Linux offers a diverse type of package installation methods and each of them is tailored to specific distributions, package managers, and file types. For smooth software management, it is essential to have a clear understanding of these package managers and their installation methods.
Requirements to install packages in Linux:
- You need to have sudo privileges.
- You need to have snap and flatpak package managers installed.
- Required .rpm file and .AppImage file needed to be downloaded beforehand.
[Distro Used Throughout the Tutorial: Ubuntu 23.04 and RHEL 9.2]
3 Easy Methods for Package Installation in Debian-based Linux Distribution
Debian-based Linux distribution forms a significant portion of the open-source operating system family. It inherited the stability of the Debian system. Ubuntu, Linux Mint, and Debian itself are some of the prominent Debian-based Linux distributions. Installing a software package in Debian-based Linux is now a much easier process with many different methods suited for different users.
In this article, I will show you three straightforward methods for package installation in Ubuntu. If you want to know how to uninstall an app package check this amazing article How to Uninstall Packages in Linux. Here for this demonstration purpose, I will be installing VLC in my system.
Method 01: Package Installation Using “apt” in Linux
APT (Advanced Package Tool) is one of the default package management tools in Ubuntu. It is very capable and user-friendly. You can use it to install an app package in your system. Now, follow the steps to install vlc package using apt
:
- At first, open the Ubuntu terminal or press CTRL+ALT+T on the keyboard.
- Now, type the following command:
sudo apt install vlc
- After that hit ENTER. If you are asked for your sudo user’s password, provide it.
- Finally press Y for confirmation. After waiting for some time your app should be installed.
Method 02: Package Installation Using “dpkg”
DPKG (Debian Package) is a low-level package manager tool in Ubuntu. It can interact directly with each Debian package’s basic installation and configuration. To install an app package using the dpkg
app manager you will need the .deb file of that app package. Now, follow the steps to accomplish this task:
- Before starting, download the .deb package file for the app you want to install. You can usually find it on the official website of the app or in third-party repositories. You can also create the .deb file from the .rpm file using the alien package.
- Now, run the following command in the Ubuntu terminal to move to the directory where the .deb file is located:
cd Downloads/
EXPLANATION- cd: Changes the current directory to the destination directory.
- Downloads/: Name of the destination directory.
- After that, type the following command to view all the files and folders in that directory:
ls
EXPLANATION- ls: List all files and folders of the current directory in the command line.
- Finally, run the following command to install your app package:
sudo dpkg -i vlc_3.0.19-1.4_amd64.deb
EXPLANATION- dpkg: Low-level command line tool to directly manage Debian packages.
- i: Command option to specify the dpkg command to install the specified app package.
- 0.19-1.4_amd64.deb: .deb file of the app package.
After installing the app package, your command line interface should look like the above image.
Method 03: Package Installation Using “apt-get”
In Ubuntu, apt-get is a command line tool for managing app packages. It is a part of the apt package manager. It can get package information, package dependency, and package from safe and trusted sources for installation, update, or removal of the package. Check the following steps to install a package using apt-get
package manager:
- At first, type the following command in the Ubuntu terminal to update the package list to ensure that you have the latest information about available packages:
sudo apt-get update
EXPLANATION- apt-get: Debaian-based package management tool.
- update: It tells the apt-get command to update the local package lists from set repositories.
- After that hit enter. You have to give the sudo user password in this step.
- Now, type the following command to search for the app you want to install:
apt-cache search vlc
EXPLANATION- apt-cache: Command line tool to search for package details and metadata in the local package cache without actually installing the app package.
- search: It tells apt-cache to search for the package name.
- vlc: Name of the package to search.
Your terminal should look like this:
Then find the app you want to install.
- After, finding the app package name type the following command to install the app package using the
apt-get
command:sudo apt-get install vlc
EXPLANATION- install: It is a command for apt-get that tell it to install the app package.
- Now, hit enter and the app will be installed. After that, your command prompt will look similar to the above images.
Comparative Analysis of Debian-based Methods
In this section, I have shown 3 different methods of installing an app package in the Debian-based Linux distribution. For an easier understanding of which method is more suitable for your usage, here is a comparison of all methods.
Methods | Pros | Cons |
---|---|---|
apt |
|
|
dpkg |
|
|
apt-get |
|
|
Among all three methods, apt is recommended to most users for its user-friendliness. The usage of apt-get and dpkg is situational. If you want complete control over your installation process then use dpkg and if you want to install an app package using script use apt-get.
3 Methods for Package Installation in Red Hat-based Linux Distribution
Red Hat-based Linux distributions such as Red Hat Enterprise Linux (RHEL), CentOS, and Fedora are built on the renowned Red Hat ecosystem. In this article, I will show three different ways for package installation in Red Hat-based distributions using rpm
, yum
, and dnf
. By learning about these methods you can adeptly manage your software packages in your Red Hat-based operating system.
Method 01: Package Installation Using the “rpm” command
Installing a package using rpm (Red Hat Package Manager) is one of the fundamental processes in Red Hat-based distributions. You can efficiently manage your system by using rpm for package installations, updates, and uninstallation. In the article How to Install Local Package Using RPM I have shown how you can install an app package using the rpm package manager in your Red Hat-based distro.
Method 02: Package Installation Using the “yum” Command
YUM (Yellowdog Updater Modified) is one of the most common package managers in Red Hat-based distros. It is built on top of rpm and provides many features that aren’t available in rpm. Using yum for package installation streamlines the process of handling dependencies ensuring a seamless user experience. For installing an app using yum check this detailed article How to Install RPM Packages Using YUM. If you want to install a specific app version follow How to Install Specific Version of a Package Using YUM. For installing from a local file How to Install Local Package Using YUM.
Method 03: Package Installation Using the “dnf” Command
DNF (Dandified YUM) emerges as a powerful package manager in Red Hat-based distributions replacing its predecessor yum. This modern package manager can seamlessly handle package installations, updates, and dependencies. By using dnf you can experience improved dependency handling, very fast execution, and a very smooth and streamlined installation process. For installing app packages using dnf check this detailed article How to Install RPM Packages Using DNF. For group installation using dnf check 2 Ways to Install Group Packages Using DNF. If you want to install from a local file follow How to Install Local Package Using DNF. To install rpm packages from a text file check this How to Install RPM Packages From Text File.
Comparative Analysis of Red Hat-based Methods
Check out the following comparison table between the discussed three methods of installing a package in Red Hat-based Linux distributions:
Methods | Pros | Cons |
---|---|---|
rpm |
|
|
yum |
|
|
dnf |
|
|
If you prefer proper control over your package installation follow 1st method, for automatic dependency handling use method 2/3. If you don’t have any preference then method 3 is recommended.
4 Easy Methods for Universal Package Installation in any Linux Distribution
Among the diverse landscape of Linux distributions, the quest for universal package management methods has led us to many different versatile solutions. In this article, I will show 4 of those solutions – PackageKit
, Snap
, Flatpak
, and AppImage
. Irrespective of which Linux distribution you are using you can use these installation processes for hassle-free installation of the app packages. For this demonstration purpose, I am using Ubuntu to show the installation of app packages.
Method 01: Package Installation Using PackageKit
Packagekit is a package management service that provides an easy-to-use graphical interface for package management in many Linux distributions. Follow the steps to install a package using the PackageKit
:
- Click on the Ubuntu Software icon in the middle left edge of your system’s side panel.
- From there, select the search icon in the top left corner.
- Type the package name in the search bar.
- After that, from the found list, double-click on the app you want to install.
- Finally, click on the install icon.
Then, you will be asked to give the user password for installation authentication. After that, the app package will be downloaded and installed automatically.
Method 02: Package Installation Using Snap
Snap is a containerized package format and package manager. It is a cross-distribution app management tool. It provides a self-contained and sandboxed environment for app packages. To install a package using snap
, check the steps below:
- To ensure that you have the most up-to-date information about available snap packages in Ubuntu first, open the Ubuntu terminal and execute the following command to update the snap package list:
sudo snap refresh
EXPLANATION- sudo: Permits administrative permission.
- snap: Command line tool for managing snaps.
- refresh: It tells the snap command to update the snap package list.
- Now, run the following command to search for the app you want to install:
snap find vlc
OR,
snap search vlc
EXPLANATION- find/search: It instructs the snap command to search for snaps for your desired package.
- vlc: Name of the package to search.
Your workflow till now should look like this image:
- Then, type the following command to install the app package in your system:
sudo snap install vlc
EXPLANATION- install: It instructs the snap command to install the snap of your desired app package.
After that hit ENTER and the app package and all its dependencies will be downloaded and installed. After the installation is finished your command prompt will look similar to the above image.
Method 03: Package Installation Using Flatpak
Flatpak is another universal package management package in Linux distributions. It provides sandboxed application deployment which means the users can install and run software in isolated environments, ensuring stability and security without worrying about their Linux distribution. Now, follow the steps to install vlc using flatpak
:
- At first, open the Ubuntu terminal and execute the following command to search for the app package you want to install:
flatpak search vlc
EXPLANATION- flatpak: Command line tool for managing flatpak packages.
- search: It tells the flatpak package to search the package name.
You will see similar output in this image:
- Now, type the following command to search for the app you want to install:
flatpak install flathub VLC
EXPLANATION- install: It instructs the flatpak command to install the specified app package.
- flathub: a popular remote repository that provides a wide range of Flatpak packages.
- After that hit ENTER. Then type the number of the one starting with the app. Then press Y for the package download to start. It will auto-install after the download is complete.
Your terminal will look like this image:
Method 04: Package Installation Using AppImage
AppImage is a portable and self-contained application packaging format. It is a standalone file that runs on most Linux distributions without the need for installation. AppImage packages bundle all necessary dependencies, ensuring compatibility across different systems and versions. Users can easily run AppImage applications by making the file executable. It’s more convenient for users who don’t want to use package managers or need specific app versions without affecting system stability.
To install a package using AppImage
, check the steps:
- At first, you have to download the AppImage file of your desired app package from their respective website or a third-party website (e.g. GitHub AppImage or AppImageHub). Now, type the following command in the Ubuntu terminal to move to the directory where the AppImage file is downloaded:
cd Downloads/
EXPLANATION- cd: This command changes the current directory to the destination directory.
- Downloads/: Name of the destination directory.
- After that hit ENTER.
- Now, type the following command to view all the files and folders of that directory:
ls -l
EXPLANATION- ls: List all files and folders of the current directory in the command line.
- l: show more details in the list.
- You can see the AppImage file is not executable. Now, type the following command to make the AppImage file executable:
chmod +x VLC_media_player-3.0.11.1-x86_64.AppImage
EXPLANATION- chmod: It instructs the snap command to search for snaps for your desired package.
- +x: Name of the package to search.
- VLC_media_player-3.0.11.1-x86_64.AppImage: Name of the file for changing permission.
Your workflow till now should look like this image:
- Finally, execute the following command to open the AppImage file as an app without installing it in your system:
./VLC_media_player-3.0.11.1-x86_64.AppImage
You will see the above response and your app will be open.
Comparative Analysis of Universal Methods for Package Installation in Linux
Here, I have shown 4 different universal methods of installing an app package in Linux. The following comparison of all four methods will help you get an easier understanding of which method is more suitable for your usage:
Methods | Pros | Cons |
---|---|---|
PackageKit |
|
|
Snap |
|
|
Flatpak |
|
|
AppImage |
|
|
If you prefer the command line interface then you can use any method except the 1st method, if you prefer GUI then use the 1st method.
Error While Opening AppImage
When you are trying to open the AppImage file in your system you may see an error like dlopen ( ): error loading libfuse.so.2 that means libfuse.so.2 library is missing on your system or there are some issues with this version:
The AppImage file usually doesn’t require any special tool to run but some AppImage requires a utility named Fuse to run properly. To solve this problem you can simply install the fuse package in your system before opening your AppImage file. You can execute the following command in the terminal to install the fuse app package:
sudo apt install fuse
You may have to give the sudo user’s password for the installation.
Conclusion
In this article, I have discussed the different ways to install app packages in Linux. I have covered them based on their different usages. Among them, the best method to use will depend on your individual needs and preferences. No matter which method you choose, make sure to read the instructions carefully before you install any packages. This will help you to avoid problems. I hope this article is helpful for your task.
People Also Ask
How to install a local package in Linux?
To install a local package in Linux just run sudo dpkg -i <package pathname>
in the terminal. It will automatically install the package in your system.
How to install a list of packages in Linux?
You can install a list of packages in Linux using the apt
command. Execute sudo apt install package_1 package_2 package_3
and all packages will be installed.
How to List the Installed Packages in Linux?
To list all installed packages in Linux just run dpkg --list
in your terminal. This command will display a comprehensive list of installed packages.
How to find a package in Linux?
You can use the apt
command to search for a package in Linux. Execute apt search package_name
to show a list of packages matching your search query.
Related Articles
- How to Show List of Installed Packages Using YUM [2 Cases]
- How to Check if Package is Installed Using YUM [3 Solutions]
- How to Install Specific Version of a Package Using YUM
- How to Install Local Package Using YUM [2 Practical Cases]
- How to List Installed Packages Using RPM [2 Practical Cases]
- 3 Ways to Install Pacman Package Manager in Ubuntu
- How to Install RPM Packages Using YUM [4 Interactive Cases]
- How to Install Local Package Using RPM [A Quick Guide]
- How to Install RPM Packages Using DNF [4 Useful Cases]
- How to Install Local Package Using DNF [2 Practical Cases]
- 2 Ways to Install Group Packages Using DNF [With Cases]
- 5 Ways to List Installed Packages in RHEL Using DNF With Cases
- How to Install RPM Packages From Text File [5 Simple Cases]
<< Go Back to Package Management in Linux | Learn Linux Basics