Prefix each line of output with the 1-based line number within its input file
-s, --no-messages
Suppress error messages about nonexistent or unreadable files.
----
== Find IP
== Managing software
=== APT
WHAT IS APT?
A packaging system simply provides programs and applications for installation.
APT(Advanced Package Tool) is a command line tool that is the most efficient and preferred way of managing software from the command line for Debian and Debian based Linux distributions like Ubuntu . It manages dependencies effectively, maintains large configuration files and properly handles upgrades and downgrades to ensure system stability.
==== Updating Package Database
Before commencing any operations with apt, we need to ensure that our local copy of the database is up-to-date.
Without this the system won’t know if there are newer packages available or not.
[source,bash]
----
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Once your package database has been updated, you can now upgrade the packages with updates installed on you machine. This will update any applications, and the Ubuntu core system to the latest versions available.
[source,bash]
----
sudo apt-get upgrade
----
==== SEARCH FOR PACKAGES WITH APT
To search for a package you can use the following command:
[source,bash]
----
apt search apache2
----
==== INSTALLING NEW PACKAGES
If you are find the name of the package you want to install, you can install it by running this command:
[source,bash]
----
apt install apache2 vlc
----
==== REMOVING INSTALLED PACKAGES
To uninstall a package from your system, you can use the following command:
[source,bash]
----
apt remove vlc
----
NOTE: This command removes the package but keeps the configuration files. So in case you reinstall the same package, your configuration remains the same. If you want to remove both the package and its associated configuration files, you can run this command:
[source,bash]
----
apt purge vlc
----
==== clean up any unused libraries and packages
[source,bash]
----
apt autoremove
----
This command automatically removes any packages that aren’t used or associated with any installed program. It’s a great way to clean up any unused libraries and packages you don’t need.