Update Ubuntu Linux Software Using Command Line?

I have the latest version of Ubuntu Linux LTS server. How do I update Ubuntu Linux for security and application fix/upgrades using ssh command line? How can I install updates via command line option?

Ubuntu Linux server – Install updates via apt-get command line

The commands are as follows:

  1. apt-get update: Update is used to resynchronize the package index files from their sources on Ubuntu Linux via the Internet.
  2. apt-get upgrade: Upgrade is used to install the newest versions of all packages currently installed on the Ubuntu system.
  3. apt-get install package-name: Install is followed by one or more packages desired for installation. If package is already installed it will try to update to latest version.

First, open the Terminal application and type following two commands (Application > Accessories > Terminal).

Get updated software list for Ubuntu, enter:

$ sudo apt-get update
$ sudo apt-get upgrade

Please note that above two commands will fetch files from the Internets or local mirrors. The location of update pages is specified in /etc/apt/sources.list (repositories). You need NOT make any changes to this file until and unless you need extra repositories for your setup.

INSTALL KERNEL UPDATES ON A UBUNTU LTS SERVER

Type the following apt-get command:

$ sudo apt-get dist-upgrade

The dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files.

How to enable/disable firewall on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective is to show how to enable or disable firewall on Ubuntu 18.04 Bionic Beaver Linux

Check a current firewall status

$ sudo ufw status
[sudo] password for linuxconfig: 
Status: inactive

Enable Firewall

To enable firewall execute:

$ sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup

Firewall, is now enabled:

$ sudo ufw status
Status: active

Disable Firewall

UFW is quite intuitive to use. To disable firewall execute:

$ sudo ufw disable
Firewall stopped and disabled on system startup

Confirm the firewall status:

$ sudo ufw status
Status: inactive