How Do I Update Linux Software On Ubuntu From Command Line?

Use this:

sudo apt update        # Fetches the list of available updates
sudo apt upgrade       # Installs some updates; does not remove packages
sudo apt full-upgrade  # Installs updates; may also remove some packages, if needed
sudo apt autoremove    # Removes any old packages that are no longer needed

Documentation about each apt option can be found in the the manpages for apt. These are also available by running man apt in your terminal.

Use of both upgrade and full-upgrade together is usually not needed, but it may help in some cases: see Debian documentation about Upgrades from Debian 9.

Source

nmap on Ubuntu

Installing nmap on Ubuntu

In order to install nmap on Ubuntu, we will be using these commands at terminal:

$ sudo apt-get install nmap

Simple Scanning With nmap on Ubuntu

In terminal of your choosing, type(you should use your own ip address or ip address of network you wish to scan):

$ sudo nmap -sn 10.0.0.0/24

Whatever ip address you have must be followed by ‘/24’. It also helps to change last number to ‘0’. That will give us first possible ip address on that network. Using ‘/24’ informs our computer to scan from ip address ‘10.0.0.0’ until it reaches and scans ‘10.0.0.255’.

Diving Deeper Scanning With nmap on Ubuntu

If we remove our ‘-sn’ option, we can use nmap to scan ports on all of those devices we found above.

Type:

$ sudo nmap 10.0.0.0/24

Aggressively Scanning With nmap On Ubuntu

$ sudo nmap -A -T4 10.0.0.254

In this line of code, ‘-A’ option acts as an aggressive scan. This runs nmap’s operating system detection, version detection, script scanning, and traceroute detection.

There is a timing template set by ‘-T’ flag. From 0 to 5, we can chose to run nmap in one of these timing modes. Each timing mode is interestingly named:

  • (0) Paranoid
  • (1) Sneaky
  • (2) Polite
  • (3) Normal
  • (4) Agressive
  • (5) Insane

Source

Uninstall A Package Via Command Line On Ubuntu Linux

Use one of these codes here to get a list of all the packages on your device.

$ apt --installed
OR
$ dpkg -l

Once you have found that program, use apt or one of these commands to remove it.

$ sudo apt remove package-name
OR
$ sudo apt-get remove package-name
OR
$ sudo dpkg -r package-name

Any of the above commands will remove the specified package, but they will leave behind configuration files, and in some cases, other files that were associated with the package. To remove those as well, you need to “purge” the package. You can do this either after removing a package or instead of removing a package (purging automatically implies removing as well).

$ sudo apt purge package-name
OR
$ sudo apt-get purge package-name
OR
$ sudo dpkg -P package-name

Source