Linux Beginner’s Guide Part 5

Installing Packages / Applications / Software in Linux

The dnf in fedora (apt-get or apt in Ubuntu/Debian based distributions) command is used to install new packages and to update/upgrade the operating system, it requires administrative access, so it must be used with sudo.

dnf [OPTIONS] [COMMAND]
apt-get [OPTIONS] [COMMAND] (Ubuntu)
apt [OPTIONS] [COMMAND] (Ubuntu)

The operating system must be updated on a regular basis, this way you will keep your data and integrity of the system safe. In order to update your system, run one of the following commands:

dnf update
apt-get update

dnf upgrade (updates the obsolete packages too)
apt-get upgrade

After the system is updated you can run dnf clean, to erase the files that were left after the packages installed.

apt-get autoremove (Ubuntu)
apt-get autoclean (Ubuntu)
apt-get clean (Ubuntu)

To search for a specific package/application/software in the repository (we will search for Gimp – a graphic software) use:

dnf search gimp (apt-get search gimp in Ubuntu)

and to install it run:

dnf install gimp (apt-get install gimp in Ubuntu).

And if you no longer need it:

dnf erase gimp (apt-get remove gimp in Ubuntu).

(use: dnf reinstall gimp in case you deleted it by mistake)

By default the Linux repository contains only packages that are considered stable, but we will see later in this tutorial, how to modify the repository and add more packages.

Shutdown command in Linux

The shutdown command is used to prepare the system to turn off in a safe way, all logged in users will be announced that the system will be turned off and in the last 5 minutes new logins are blocked.

shutdown [OPTIONS] [TIME] [MESSAGE]

Please note that the shutdown command requires administrative access, so you must login with the root user: su root

The argument [TIME] can accept the following options: now, hh:mm, +minutes

To see the current date/time and date/time format of your system run this command in the console: date

Do a few exercises

shudown 08:32

shutdown +3 “Bye Bye!”

To stop a shutdown command you must use: shutdown -c

Su users can also use this command in order to issue a restart:

reboot

shutdown -r now

halt

Make sure you save your work before you run commands like restart or shutdown.

Previous articleLinux Beginner’s Guide Part 4
Next articleLinux Beginner’s Guide Part 6
A.Sulthan, Ph.D.,
Author and Assistant Professor in Finance, Ardent fan of Arsenal FC. Always believe "The only good is knowledge and the only evil is ignorance - Socrates"
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments