LilyYucarp

the lav kit

Package managers

In most GNU/Linux distributions, programs and libraries are handled with package managers. This provides an easy way to keep track on all of the things installed and makes it easy to update all of the packages. The package manager downloads files from repositories, so the risk of accidentally installing malware is minimalized. Different distributions have different package managers, so the available programs might be different; although many programs are available in different repositories. Package managers also require root privileges, so it needs to be run as the root user. However, there are ways to temporarily gain root privilege without completely changing users.

Warning:

Although package managers are safe, sometimes repositories can get poisoned by some malicious people (especially user repositories). It's a good idea to check the news for your distribution.

Different types of package managers

There are many types of package managers and they differ from distribution to distribution. Few examples are the APT of Debian and Pacman of Arch Linux. Although some distributions offer a store in order to make installation and updating easier, there might be times you need to deal with the package manager directly using the terminal. There are information available online for your package manager, so you can look for them.

Gaining root privilege

The easiest and most available way to temporarily gain root privilege is by using the su (switch user) command. You can switch to the root user like this:

su root
Password: (the password of the root user)
					

After you successfully logged in as the root user, you can perform any task you want. You don't need to worry as only the terminal is logged in as the root user. After finishing your task you can write exit to end your session and return to the shell.

The sudo command

The sudo command has many advantages. You can simply run any program with root privileges without switching users. In some distributions the password of the root user is disabled so the only way to run programs as the administrator is using the command sudo.

sudo apt install vlc
Password: (the password of the current user)
					

Before: Introduction to the terminal Next: Getting help