One of the hardest parts of installing Unix programs is keeping track of dependencies.
Any more or less complex program in its work uses the features provided by other modules, system libraries, etc. Thus, a dependency appears – if we want to install program “A”, which uses the libraries of program “B” when running, we first need to install program “B” (which, in turn, may have its own dependencies). Thus, the more programs and dependencies appear on the server, the more difficult it is to track and manage them. The good news is that this can be done using the Advanced Packaging Tool ( APT) package manager .
Installing with a package manager
The evolution of methods for installing and managing software packages has evolved over time to the use of package managers tightly integrated with repositories. The repositories contain packaged program files with data about their dependencies. After installation, system repositories are already connected to the operating system: with their help, you can update the OS and install software packages that have been adapted and optimized to work with this version of the operating system.
[step num=”1″]
Before you start installing packages, it is recommended to update the version and dependency data in the repository with the following command:
sudo apt-get update
[/step]

[step num=”2″]
If you need to clarify the name of the package you want to install, look for a keyword manager in the local cache, for example, web server :
sudo apt-cache search web server
[/step]
[step num=”3″]
As a result, we get a large list of packages where this keyword is present in the description:
[/step]

[step num=”4″]
We select the package we need – in this case it is apache2 , and install it:
sudo apt-get install apache2
[/step]
[step num=”5″]
The package manager checks dependencies, versions, compares them with packages already installed via apt-get , after which it gives a list of components required for installation and asks for permission to continue the operation:
[/step]

[step num=”6″]
Press y and wait for the installation to complete.
[/step]
Commonly used package manager commands:
- apt-get update – update information about packages and dependencies in connected repositories;
- apt-get upgrade – upgrade all installed packages to the latest version available in the repository;
- apt-get install package_name – install a package;
- apt-get remove package_name – remove a package;
- apt-get download package_name – download the deb package to a local folder;
- apt-cache search keywords – search for a package by keywords;
- apt-cache show package_name – show information about the package;
- apt-cache depends package_name – show which components this package depends on;
- apt-cache rdepends package_name – show which components depend on the package;
- apt-mark hold package_name – fix the current version of the package, stop updating the package;
- apt-mark unhold package_name – Allow the package to be updated.
Installation via Debian package
[step num=”7″]
Software packages may or may not be distributed through repositories. For example, they may be available on developer websites. In this case, you can download the package and use the dpkg (debian package) utility to install it. When using dpkg , there is no automatic tracking of dependencies and downloading of additional packages. If any programs or libraries are missing, the installation will fail with a list of missing packages. They will have to be installed separately, for example, via apt – get if they are present in the connected repositories, or downloaded from the developers’ sites and installed in the right order via dpkg .
[/step]
[step num=”8″]
For example, let’s download the Nginx web server installation package from the system repository with the command:
sudo apt-get download nginx
[/step]
[step num=”9″]
and try to install via dpkg – i filename. deb :
sudo dpkg –i ./nginx_1.14.0-0ubuntu1.6_all.deb
[/step]
[step num=”10″]
As a result, the system gives an error with a list of missing packages:
[/step]

Basic dpkg options :
- dpkg –i filename.deb – package installation; the full name of the file is specified as a parameter;
- dpkg -r package_name – remove a previously installed package;
- dpkg -l – display the list of packages installed on the system.
Installation via script files
[step num=”11″]
Installing the program is unpacking the archive, copying the program files to system directories and, if necessary, making changes to the system configuration files. All these actions can be added to the script executable file and performed when it is launched. Now this method of installing a program is quite rare, but, nevertheless, some developers use it. If there is a need to install such a package, you need to download the archive (usually a file with a .tgz or .tar.gz extension), unpack it into a separate directory on the server, examine the unpacked files, and read the readme file, if available. The installation of the program is usually started by the install.sh script , so you need to include the executable file attribute with the command:
sudo chmod +x ./install.sh
[/step]
[step num=”12″]
then run the script directly:
sudo ./install.sh
[/step]
Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!