How To Fix “Perl warning Setting locale failed” Issue in Debian or Ubuntu

This post will guide you how to fix “perl: Warning : Setting locale failed” issue while update your package index or installing a package in your Ubuntu or Debian Linux. How do I fix this Warning problem on my Debian or Ubuntu Linux system.

perl: warning: Falling back to the standard locale ("C").
Starting multipath daemon: multipathd.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")

To fix this issue in your Ubuntu system, and you need to generat missing locales by running the following locale-gen command, type:

$ sudo locale-gen en_US.UTF-8

Outputs:

Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.

Then you need to reconfigure locales using the following command:

$ sudo dpkg-reconfigure locales

Outputs:

Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IL.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
Generation complete.

The dpkg-reconfigure locales command will open a dialog under Debian for selecting the desired locale.

The post How To Fix “Perl warning Setting locale failed” Issue in Debian or Ubuntu first appeared on RSSFeedsCloud.

How To Enable and Setup Automatic Unattended Security Updates on Ubuntu 16.04 or 18.04

This post will guide you how to enable and set up automatic unattented security updates on your Ubuntu 16.04 or 18.04 Linux systems. How do I configure unattented automatic updates under Ubuntu Linux systems.

Installing Unattended Upgrades Package


You need to install the unattented-upgrades package in your Ubuntu system, and this package can be used to install updated packages automaticlly. And you can install it by the default Ubuntu Apt repository, just type the following command at the shell prompt from the command line:

$ sudo apt update
$ sudo apt install unattented-upgrades

Outputs:

devops@devops:~$ sudo apt install unattended-upgrades
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
bsd-mailx default-mta | mail-transport-agent needrestart
The following NEW packages will be installed:
unattended-upgrades
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 41.0 kB of archives.
After this operation, 393 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 unattended-upgrades all 1.1ubuntu1.18.04.11 [41.0 kB]
Fetched 41.0 kB in 0s (266 kB/s)
Preconfiguring packages ...
Selecting previously unselected package unattended-upgrades.
(Reading database ... 185900 files and directories currently installed.)
Preparing to unpack .../unattended-upgrades_1.1ubuntu1.18.04.11_all.deb ...
Unpacking unattended-upgrades (1.1ubuntu1.18.04.11) ...
Setting up unattended-upgrades (1.1ubuntu1.18.04.11) ...

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable unattended-upgrades
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.29) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
devops@devops:~$

Once the unattended-upgrades package is installed on your ubuntu system, and the Unattended upgrades server will be enabled and started automaticlly. you can check its status by running the following command:

$ systemctl status unattended-upgrades

Outputs:

devops@devops:~$ systemctl status unattended-upgrades
unattended-upgrades.service - Unattended Upgrades Shutdown
Loaded: loaded (/lib/systemd/system/unattended-upgrades.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-02 23:34:50 EDT; 15min ago
Docs: man:unattended-upgrade(8)
Main PID: 1200 (unattended-upgr)
Tasks: 2 (limit: 1121)
CGroup: /system.slice/unattended-upgrades.service
└─1200 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal

Oct 02 23:34:50 devops systemd[1]: Started Unattended Upgrades Shutdown.
Oct 02 23:48:36 devops systemd[1]: unattended-upgrades.service: Current command vanished from the unit file, execution of the command list won't be resumed.

Configuring Unattended Automatic Upgrades


You can configure the unattended-upgrades configuration file is located in the “/etc/apt/apt.conf.d” directory, and you need to edit the configuration file called 50unattended-upgrades to define upgrade type or blanklist updates.

For example, you can use your vi or vim text editor to open the configuration file “50unattended-upgrades“, and then you need comment all lines and leave only the security line in the first “Allowed-Origins” section. And it will only update all security updates. If you want to update other packages, and you can uncomment other origins. See below type definition for security updates only:

Unattended-Upgrade::Allowed-Origins {
// "${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
// available, the policy for updates is such that unattended-upgrades
// should also install from here by default.
// "${distro_id}ESM:${distro_codename}";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};

If you do not want some certain packages to be updated, and you can add it to the pacakge blacklist, and regexp are supported. see below:

Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};

If you want to get an email notification for every updates, and you can uncomment the following two lines and type your own emial address for receiving notification.

Unattended-Upgrade::Mail "mytest@gmail.com";
Unattended-Upgrade::MailOnlyOnError "true";

Save and close the file.

Enabling Unattended Automatic upgrades


You still need to enable automatic updates in your ubuntu system, and you need to edit the configuration file called “20auto-upgrades” under /etc/apt/apt.conf.d/ directory using vim text editor:

$ sudo vim /etc/apt/apt.conf.d/20auto-upgrades

you need to make the configuration as below:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";

Save and close the file.

Checking Unattended Automatic upgrades


Once Unattended Automatic upgrades is configured in the above steps, and you can now check whether the automatic upgrades works well or not by running the following command:

$ sudo unattended-upgrades --dry-run --debug

Outputs:

devops@devops:~$ sudo unattended-upgrade --dry-run --debug
[sudo] password for devops:
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic-security
Using (^linux-image-[0-9]+.[0-9.]+-.*|^linux-headers-[0-9]+
......

adjusting candidate version: systemd-sysv=237-3ubuntu10.29
Checking: udev ([])
adjusting candidate version: udev=237-3ubuntu10.29
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
blacklist: []
whitelist: []
No packages found that can be upgraded unattended and no pending auto-removals

Conclusion


You should know that how to set up and configure automatic security updates in your Ubuntu or Debian Linux system.

The post How To Enable and Setup Automatic Unattended Security Updates on Ubuntu 16.04 or 18.04 first appeared on RSSFeedsCloud.

How To Enable and Setup Automatic Unattended Security Updates on Ubuntu 16.04 or 18.04

This post will guide you how to enable and set up automatic unattented security updates on your Ubuntu 16.04 or 18.04 Linux systems. How do I configure unattented automatic updates under Ubuntu Linux systems.

Installing Unattended Upgrades Package


You need to install the unattented-upgrades package in your Ubuntu system, and this package can be used to install updated packages automaticlly. And you can install it by the default Ubuntu Apt repository, just type the following command at the shell prompt from the command line:

$ sudo apt update
$ sudo apt install unattented-upgrades

Outputs:

devops@devops:~$ sudo apt install unattended-upgrades
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
bsd-mailx default-mta | mail-transport-agent needrestart
The following NEW packages will be installed:
unattended-upgrades
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.
Need to get 41.0 kB of archives.
After this operation, 393 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 unattended-upgrades all 1.1ubuntu1.18.04.11 [41.0 kB]
Fetched 41.0 kB in 0s (266 kB/s)
Preconfiguring packages ...
Selecting previously unselected package unattended-upgrades.
(Reading database ... 185900 files and directories currently installed.)
Preparing to unpack .../unattended-upgrades_1.1ubuntu1.18.04.11_all.deb ...
Unpacking unattended-upgrades (1.1ubuntu1.18.04.11) ...
Setting up unattended-upgrades (1.1ubuntu1.18.04.11) ...

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable unattended-upgrades
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.29) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
devops@devops:~$

Once the unattended-upgrades package is installed on your ubuntu system, and the Unattended upgrades server will be enabled and started automaticlly. you can check its status by running the following command:

$ systemctl status unattended-upgrades

Outputs:

devops@devops:~$ systemctl status unattended-upgrades
unattended-upgrades.service - Unattended Upgrades Shutdown
Loaded: loaded (/lib/systemd/system/unattended-upgrades.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-02 23:34:50 EDT; 15min ago
Docs: man:unattended-upgrade(8)
Main PID: 1200 (unattended-upgr)
Tasks: 2 (limit: 1121)
CGroup: /system.slice/unattended-upgrades.service
└─1200 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal

Oct 02 23:34:50 devops systemd[1]: Started Unattended Upgrades Shutdown.
Oct 02 23:48:36 devops systemd[1]: unattended-upgrades.service: Current command vanished from the unit file, execution of the command list won't be resumed.

Configuring Unattended Automatic Upgrades


You can configure the unattended-upgrades configuration file is located in the “/etc/apt/apt.conf.d” directory, and you need to edit the configuration file called 50unattended-upgrades to define upgrade type or blanklist updates.

For example, you can use your vi or vim text editor to open the configuration file “50unattended-upgrades“, and then you need comment all lines and leave only the security line in the first “Allowed-Origins” section. And it will only update all security updates. If you want to update other packages, and you can uncomment other origins. See below type definition for security updates only:

Unattended-Upgrade::Allowed-Origins {
// "${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
// available, the policy for updates is such that unattended-upgrades
// should also install from here by default.
// "${distro_id}ESM:${distro_codename}";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};

If you do not want some certain packages to be updated, and you can add it to the pacakge blacklist, and regexp are supported. see below:

Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};

If you want to get an email notification for every updates, and you can uncomment the following two lines and type your own emial address for receiving notification.

Unattended-Upgrade::Mail "mytest@gmail.com";
Unattended-Upgrade::MailOnlyOnError "true";

Save and close the file.

Enabling Unattended Automatic upgrades


You still need to enable automatic updates in your ubuntu system, and you need to edit the configuration file called “20auto-upgrades” under /etc/apt/apt.conf.d/ directory using vim text editor:

$ sudo vim /etc/apt/apt.conf.d/20auto-upgrades

you need to make the configuration as below:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";

Save and close the file.

Checking Unattended Automatic upgrades


Once Unattended Automatic upgrades is configured in the above steps, and you can now check whether the automatic upgrades works well or not by running the following command:

$ sudo unattended-upgrades --dry-run --debug

Outputs:

devops@devops:~$ sudo unattended-upgrade --dry-run --debug
[sudo] password for devops:
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic-security
Using (^linux-image-[0-9]+.[0-9.]+-.*|^linux-headers-[0-9]+
......

adjusting candidate version: systemd-sysv=237-3ubuntu10.29
Checking: udev ([])
adjusting candidate version: udev=237-3ubuntu10.29
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
blacklist: []
whitelist: []
No packages found that can be upgraded unattended and no pending auto-removals

Conclusion


You should know that how to set up and configure automatic security updates in your Ubuntu or Debian Linux system.

The post How To Enable and Setup Automatic Unattended Security Updates on Ubuntu 16.04 or 18.04 first appeared on RSSFeedsCloud.

How to Use TimeShift to Backup and Restore Ubuntu Linux

Have you ever wondered how you can backup and restore your Ubuntu or Debian system ? Timeshift is a free and opensource tool that allows you to create incremental snapshots of your filesystem. You can create a snapshot using either RSYNC or BTRFS.

With that. let’s delve in and install Timeshift. For this tutorial, we shall install on Ubuntu 18.04 LTS system.

Installing TimeShift on Ubuntu / Debian Linux

TimeShift is not hosted officially on Ubuntu and Debian repositories. With that in mind, we are going to run the command below to add the PPA:

# add-apt-repository -y ppa:teejee2008/ppa

Next, update the system packages with the command:

# apt update

After a successful system update, install timeshift by running following apt command :

# apt install timeshift

Preparing a backup storage device

Best practice demands that we save the system snapshot on a separate storage volume, aside from the system’s hard drive. For this guide, we are using a 16 GB flash drive as the secondary drive on which we are going to save the snapshot.

# lsblk | grep sdb

For the flash drive to be used as a backup location for the snapshot, we need to create a partition table on the device. Run the following commands:

# parted /dev/sdb  mklabel gpt
# parted /dev/sdb  mkpart primary 0% 100%
# mkfs.ext4  /dev/sdb1

After creating a partition table on the USB flash drive, we are all set to begin creating filesystem’s snapshots!

Using Timeshift to create snapshots

To launch Timeshift, use the application menu to search for the  Timeshift application.

Click on the Timeshift icon and the system will prompt you for the Administrator’s password. Provide the password and click on Authenticate

Next, select your preferred snapshot type.

Click ‘Next’.  Select the destination drive for the snapshot. In this case, my location is the external USB drive labeled as /dev/sdb

Next, define the snapshot levels. Levels refer to the intervals during which the snapshots are created.  You can choose to have either monthly, weekly, daily, or hourly snapshot levels.

Click ‘Finish’

On the next Window, click on the ‘Create’ button to begin creating the snapshot. Thereafter, the system will begin creating the snapshot.

Finally, your snapshot will be displayed as shown

Restoring Ubuntu / Debian from a snapshot

Having created a system snapshot, let’s now see how you can restore your system from the same snapshot. On the same Timeshift window, click on the snapshot and click on the ‘Restore’ button as shown.

Next, you will be prompted to select the target device.  leave the default selection and hit ‘Next’.

A dry run will be performed by Timeshift before the restore process commences.

In the next window, hit the ‘Next’  button to confirm actions displayed.

You’ll get a warning and a disclaimer as shown. Click ‘Next’ to initialize the restoration process.

Thereafter, the restore process will commence and finally, the system will thereafter reboot into an earlier version as defined by the snapshot.

Conclusion

As you have seen it quite easy to use TimeShift to restore your system from a snapshot. It comes in handy when backing up system files and allows you to recover in the event of a system fault. So don’t get scared to tinker with your system or mess up. TimeShift will give you the ability to go back to a point in time when everything was running smoothly.

The post How to Use TimeShift to Backup and Restore Ubuntu Linux first appeared on RSSFeedsCloud.

How to Install Python 3.8 on Ubuntu, Debian and LinuxMint

The Python team has released its latest version Python 3.8 for general use. You can download the latest stable version Python 3.8 series and install it on your system. This article will help you to install Python 3.8.0 on Ubuntu, Debian, and LinuxMint operating system. You can visit here to read more about Python releases.

Step 1 – Prerequsitis

As you are going to install Python 3.8 from the source. You need to install some development libraries to compile Python source code. Use the following command to install prerequisites for Python:

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev 
    libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

Step 2 – Download Python 3.8

Download Python source code using the following command from python official site. You can also download the latest version in place of specified below.

cd /opt
sudo wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

Then extract the downloaded source archive file

sudo tar xzf Python-3.8.0.tgz

Step 3 – Compile Python Source

Use below set of commands to compile Python source code on your system using altinstall.

cd Python-3.8.0
sudo ./configure --enable-optimizations
sudo make altinstall
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

Step 4 – Check Python Version

Check the installed version of python using the following command. As you have not overwritten the default Python version on the system, So you have to use Python 3.8 as follows:

python3.8 -V

Python-3.8.0

After successful installation remove the downloaded archive to save disk space

sudo rm -f Python-3.8.0.tgz

The post How to Install Python 3.8 on Ubuntu, Debian and LinuxMint appeared first on TecAdmin.

The post How to Install Python 3.8 on Ubuntu, Debian and LinuxMint first appeared on RSSFeedsCloud.

How To Use APT(Advanced Package Tool) in Ubuntu/Debian Linux

This post will guide you how to use APT tool for the package management on your Ubuntu or Debian based systems. How do I use the APT package management tool to install, remove,update,upgrade and manage software packages on Ubuntu or Debian Linux.

APT Command


apt provides a high-level commandline interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like apt-get(8) and apt-cache(8).

The syntax of the APT command is as follow:

apt [-h] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {list | search | show | update |install pkg [{=pkg_version_number | /target_release}]... | remove pkg... | upgrade | full-upgrade | edit-sources | {-v | --version} | {-h | --help}}

Updating Package Index with APT Command


Apt Tools works on the indexes of available packages. If the indexes are not updated, and the APT Tool won’t know if there are any newer packages available. This is you need to resynchronize the package index files from their sources before installing a package. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. An update should always be performed before an upgrade or dist-upgrade.

To updating the package indexes, you need to run the following command:

$ sudo apt update

Outputs:

devops@devops-ubuntu:~$ sudo apt update
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Hit:6 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:7 http://repository.spotify.com stable InRelease
Hit:8 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu bionic InRelease
Hit:9 https://repo.skype.com/deb stable InRelease
Get:10 http://dl.bintray.com/apache/cassandra 311x InRelease [3,183 B]
Fetched 3,183 B in 1s (2,184 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
55 packages can be upgraded. Run 'apt list --upgradable' to see them.

Upgrading Installed Packages with APT Command


Once the package index have been updated and you can use the apt command with the subcommand “upgrade” to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. type:

$ sudo apt upgrade

Outputs:

devops@devops-ubuntu:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
amd64-microcode base-files bluez bluez-cups bluez-obexd containerd.io docker-ce docker-ce-cli grep ibverbs-providers libbluetooth3 libegl-mesa0 libegl1-mesa libgbm1 libgl1-mesa-dri
libgl1-mesa-dri:i386 libgl1-mesa-glx libgl1-mesa-glx:i386 libglapi-mesa libglapi-mesa:i386 libglx-mesa0 libglx-mesa0:i386 libibverbs1 libnss-myhostname libnss-systemd libpam-systemd libpython2.7
libpython2.7-minimal libpython2.7-stdlib libpython3.6 libpython3.6-dev libpython3.6-minimal libpython3.6-stdlib libsystemd0 libudev1 libudev1:i386 libwayland-egl1-mesa libxatracker2
linux-libc-dev mesa-va-drivers mesa-vdpau-drivers python2.7 python2.7-minimal python3.6 python3.6-dev python3.6-minimal python3.6-venv systemd systemd-sysv thunderbird thunderbird-gnome-support
thunderbird-locale-en thunderbird-locale-en-us ubuntu-drivers-common udev
55 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 210 MB of archives.
After this operation, 5,973 kB disk space will be freed.
Do you want to continue? [Y/n]Y

Note: Packages currently installed with new versions available are retrieved and upgraded;

Installing Package with APT Command


If you want to install a package using apt command, and you can install it with the subcommand “install“. For example, you wish to install a package called wget, and you can install it by running the following command:

$ sudo apt install wget

Outputs:

devops@devops-ubuntu:~$ sudo apt install wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libpango1.0-0 libpangox-1.0-0
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
wget
0 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
Need to get 316 kB of archives.
After this operation, 954 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 wget amd64 1.19.4-1ubuntu2.2 [316 kB]
Fetched 316 kB in 0s (1,620 kB/s)
Selecting previously unselected package wget.
(Reading database ... 186877 files and directories currently installed.)
Preparing to unpack .../wget_1.19.4-1ubuntu2.2_amd64.deb ...
Unpacking wget (1.19.4-1ubuntu2.2) ...
Setting up wget (1.19.4-1ubuntu2.2) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

Installing Multiple Packages with APT Command


If you want to install multiple packages using apt command at a time, and you just need to provide the package names all together to the apt command.

$ sudo apt install  

Installing a Package with a Specified Version


If you do not install the latest version from the default APT repository, and you can specify the version number while installing a package using apt command. And you need to know the exact verion number that you want to install. type:

$ sudo apt install =
$ sudo apt install wget=1.19.4-1ubuntu2.2

Outputs:

devops@devops-ubuntu:~$ sudo apt install wget=1.19.4-1ubuntu2.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
wget
0 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
Need to get 316 kB of archives.
After this operation, 954 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 wget amd64 1.19.4-1ubuntu2.2 [316 kB]
Fetched 316 kB in 0s (1,617 kB/s)
Selecting previously unselected package wget.
(Reading database ... 186865 files and directories currently installed.)
Preparing to unpack .../wget_1.19.4-1ubuntu2.2_amd64.deb ...
Unpacking wget (1.19.4-1ubuntu2.2) ...
Setting up wget (1.19.4-1ubuntu2.2) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

Searching for a Package with APT Command


If you want to search for the given regex term in the list of available packages and display all matched package names. you can use the apt command with its subcommand “search“, type:

$ sudo apt search firefox

Outputs:

devops@devops-ubuntu:~$ sudo apt search firefox
Sorting... Done
Full Text Search... Done
firefox/bionic-security,bionic-updates,now 69.0.2+build1-0ubuntu0.18.04.1 amd64 [installed]
  Safe and easy web browser from Mozilla

firefox-dbg/bionic-security,bionic-updates 69.0.2+build1-0ubuntu0.18.04.1 amd64
  Safe and easy web browser from Mozilla - debug symbols

firefox-dev/bionic-security,bionic-updates 69.0.2+build1-0ubuntu0.18.04.1 amd64
  Safe and easy web browser from Mozilla - development files

firefox-geckodriver/bionic-security,bionic-updates 69.0.2+build1-0ubuntu0.18.04.1 amd64
  Safe and easy web browser from Mozilla - geckodriver

firefox-globalmenu/bionic-security,bionic-updates 68.0.2+build1-0ubuntu0.18.04.1 amd64
  Safe and easy web browser from Mozilla (transitional package)

firefox-launchpad-plugin/bionic,bionic 0.5 all
  Launchpad firefox integration
......

Show Information about the Given Packages


If you want to show information about the given package(s) including its dependencies, installation and download size, sources the package is available from, the description of the packages content using apt command. and you can use apt command with its subcommand “show“, type:

$ sudo apt show firefox

Outputs:

devops@devops-ubuntu:~$ sudo apt show firefox
Package: firefox
Version: 69.0.2+build1-0ubuntu0.18.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 189 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.27), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-gtk-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 5y
Download-Size: 50.3 MB
APT-Manual-Installed: yes
APT-Sources: http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 Packages
Description: Safe and easy web browser from Mozilla
Firefox delivers safe, easy web browsing. A familiar user interface,
enhanced security features including protection from online identity theft,
and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it

Remvoing Installed Packages with APT Command


If you want to remove a installed package using apt command on your ubuntu system, and you can run apt command with remove subcommand. and it will only remove the package files only but configuration file still remain on your system.

If you want to remove a package and its all configuration files, and you need to use apt command with its anoter subcommand “purge“. type:

$ sudo apt remove wget

or

$ sudo apt purge wget

Outputs:

devops@devops-ubuntu:~$ sudo apt remove wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libpango1.0-0 libpangox-1.0-0
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
hplip minecraft-launcher printer-driver-postscript-hp ssh-import-id ubuntu-standard wget
0 upgraded, 0 newly installed, 6 to remove and 55 not upgraded.
After this operation, 3,863 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187040 files and directories currently installed.)
Removing printer-driver-postscript-hp (3.17.10+repack0-5) ...
Removing hplip (3.17.10+repack0-5) ...
Removing minecraft-launcher (2.1.3676) ...
Removing ssh-import-id (5.7-0ubuntu1.1) ...
Removing ubuntu-standard (1.417.3) ...
Removing wget (1.19.4-1ubuntu2.2) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for cups (2.2.7-1ubuntu2.7) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
devops@devops-ubuntu:~$

Removing Unused Packages


You can use autoremove subcommand to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed. type:

$ sudo apt autoremove

Outputs:

devops@devops-ubuntu:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libpango1.0-0 libpangox-1.0-0
0 upgraded, 0 newly installed, 2 to remove and 55 not upgraded.
After this operation, 203 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 186885 files and directories currently installed.)
Removing libpango1.0-0:amd64 (1.40.14-1ubuntu0.1) ...
Removing libpangox-1.0-0:amd64 (0.0.2-5) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

Listing All Installed or Upgradeable Packages


If you want to display a list of all installed pacakges or all the packages that have a newer version can be upgraded. you can use the following commands:

$ sudo apt list --installed
$ sudo apt list --upgradeable

Outputs:

devops@devops-ubuntu:~$ sudo apt list --installed
Listing... Done
accountsservice/bionic,now 0.6.45-1ubuntu1 amd64 [installed]
acl/bionic,now 2.2.52-3build1 amd64 [installed]
acpi-support/bionic,now 0.142 amd64 [installed]
acpid/bionic,now 1:2.0.28-1ubuntu1 amd64 [installed]
adduser/bionic,bionic,now 3.116ubuntu1 all [installed]
adium-theme-ubuntu/bionic,bionic,now 0.3.4-0ubuntu4 all [installed]
adwaita-icon-theme/bionic,bionic,now 3.28.0-1ubuntu1 all [installed]
aisleriot/bionic,now 1:3.22.5-1 amd64 [installed]
alien/bionic,bionic,now 8.95 all [installed]
alsa-base/bionic,bionic,now 1.0.25+dfsg-0ubuntu5 all [installed]
alsa-utils/bionic,now 1.1.3-1ubuntu1 amd64 [installed]
......
devops@devops-ubuntu:~$ sudo apt list --upgradeable
Listing... Done
amd64-microcode/bionic-proposed 3.20181128.1~ubuntu0.18.04.1 amd64 [upgradable from: 3.20180524.1~ubuntu0.18.04.2]
base-files/bionic-proposed 10.1ubuntu2.7 amd64 [upgradable from: 10.1ubuntu2.6]
bluez/bionic-proposed 5.48-0ubuntu3.2 amd64 [upgradable from: 5.48-0ubuntu3.1]
bluez-cups/bionic-proposed 5.48-0ubuntu3.2 amd64 [upgradable from: 5.48-0ubuntu3.1]
bluez-obexd/bionic-proposed 5.48-0ubuntu3.2 amd64 [upgradable from: 5.48-0ubuntu3.1]
containerd.io/bionic 1.2.10-2 amd64 [upgradable from: 1.2.6-3]
......

If you want to get more help while using apt command, and you can use the following commands:

$ man apt 
$ man apt-get
$ apt help

Outputs:

devops@devops-ubuntu:~$ apt help
apt 1.6.12 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
list - list packages based on package names
search - search in package descriptions
show - show package details
install - install packages
remove - remove packages
autoremove - Remove automatically all unused packages
update - update list of available packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.
devops@devops-ubuntu:~$

Conclusion


You should know that how to use APT pacakge management Tool to install/remove/update/upgrade packages in your Ubuntu or Debian based systmes.

The post How To Use APT(Advanced Package Tool) in Ubuntu/Debian Linux first appeared on RSSFeedsCloud.

How To Install and Enable SSH on Ubuntu Linux

This post will guide you how to install SSH server on your Ubuntu or Debian based system from the command line. How do I install SSH client or enable SSH on Ubuntu Linux system.

What is SSH?


Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Typical applications include remote command-line, login, and remote command execution, but any network service can be secured with SSH.

sshd (OpenSSH Daemon) is the daemon program for ssh. sshd can be configured using command-line options or a configuration file (by default sshd_config(5)); command-line options override values specified in the configuration file.

ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to provide secure encrypted communications between two untrusted hosts over an insecure network.

Installing OpenSSH Server on Ubuntu


If you want to setup a ssh server on your Ubuntu Linux system, and you need to install the openssh-server package by running the following command, type:

$ sudo apt install openssh-server

Outputs:

devops@devops-ubuntu:~$ sudo apt install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:
molly-guard monkeysphere rssh ssh-askpass
The following NEW packages will be installed:
ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 upgraded, 4 newly installed, 0 to remove and 39 not upgraded.
Need to get 637 kB of archives.
After this operation, 5,316 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 ncurses-term all 6.1-1ubuntu1.18.04 [248 kB]
Get:2 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 openssh-sftp-server amd64 1:7.6p1-4ubuntu0.3 [45.6 kB]
Get:3 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 openssh-server amd64 1:7.6p1-4ubuntu0.3 [333 kB]
Get:4 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 ssh-import-id all 5.7-0ubuntu1.1 [10.9 kB]
Fetched 637 kB in 0s (1,423 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... 184235 files and directories currently installed.)
Preparing to unpack .../ncurses-term_6.1-1ubuntu1.18.04_all.deb ...
Unpacking ncurses-term (6.1-1ubuntu1.18.04) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-sftp-server (1:7.6p1-4ubuntu0.3) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-server (1:7.6p1-4ubuntu0.3) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_5.7-0ubuntu1.1_all.deb ...
Unpacking ssh-import-id (5.7-0ubuntu1.1) ...
Setting up ncurses-term (6.1-1ubuntu1.18.04) ...
Setting up openssh-sftp-server (1:7.6p1-4ubuntu0.3) ...
Setting up ssh-import-id (5.7-0ubuntu1.1) ...
Setting up openssh-server (1:7.6p1-4ubuntu0.3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.29) ...

Once the openssh-server package is installed, and SSHd service have started and enabled on your ubuntu system. And you can verify the installation by running the following command:

$ sudo systemctl status sshd

Outputs:

devops@devops-ubuntu:~$ systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-09 04:20:22 EDT; 52s ago
Main PID: 10102 (sshd)
Tasks: 1 (limit: 1121)
CGroup: /system.slice/ssh.service
└─10102 /usr/sbin/sshd -D

Oct 09 04:20:22 devops-ubuntu systemd[1]: Starting OpenBSD Secure Shell server...
Oct 09 04:20:22 devops-ubuntu sshd[10102]: Server listening on 0.0.0.0 port 22.
Oct 09 04:20:22 devops-ubuntu sshd[10102]: Server listening on :: port 22.
Oct 09 04:20:22 devops-ubuntu systemd[1]: Started OpenBSD Secure Shell server.

If you need to start/stop/restart SSHd service on your Ubuntu system, and you can use the following commands:

$ sudo systemctl start sshd
$ sudo systemctl stop sshd
$ sudo systemctl restart sshd

Installing OpenSSh Client on Ubuntu


If you want to log into a remote machine on your ubuntu system, and you need to install the openssh-client package with the following command:

$ sudo apt install openssh-client

Outputs:

devops@devops-ubuntu:~$ sudo apt install openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
keychain libpam-ssh monkeysphere ssh-askpass
The following NEW packages will be installed:
openssh-client
0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
Need to get 614 kB of archives.
After this operation, 4,162 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 openssh-client amd64 1:7.6p1-4ubuntu0.3 [614 kB]
Fetched 614 kB in 0s (1,688 kB/s)
Selecting previously unselected package openssh-client.
(Reading database ... 184193 files and directories currently installed.)
Preparing to unpack .../openssh-client_1%3a7.6p1-4ubuntu0.3_amd64.deb ...
Unpacking openssh-client (1:7.6p1-4ubuntu0.3) ...
Setting up openssh-client (1:7.6p1-4ubuntu0.3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
devops@devops-ubuntu:~$

Once the installation of ssh client finishes, you can use the ssh command to log into a remote machine for executing commands, type:

$ ssh user@remoteServerIP
$ ssh devops@192.168.3.56

Configuring SSH on Ubuntu


Now you have installed SSH Server and client on your Ubuntu system, and you can now configure it. You can change the default SSH port from 22 to another port number. or you can also enable root user login by configuring a configuration file using your vim text editor.

For example, you want to change the default port number from 22 to 2048, just open up the ssh configuration file by running the following command:

$ sudo vim /etc/ssh/sshd_config

then you need to find and change the following line from:

# Port 22

to

Port 2048

save and close the file.

You still need to configure your UFW firewall to allow the newly SSH port number 2048, type:

$ sudo ufw allow 2048

Outputs:

devops@devops-ubuntu:~$ sudo ufw allow 2048
Rules updated
Rules updated (v6)

Now you can restart SSHD service for the changes to take effect with the following command:

$ sudo systemctl restart sshd

Conclusion


You should know that how to install and configure SSH Server from the command line in your Ubuntu or Debian based systems.

The post How To Install and Enable SSH on Ubuntu Linux first appeared on RSSFeedsCloud.

How To Check Running Process in Ubuntu

This post will guide you how to check All running proceses from the command line in your Ubuntu 16.04 or 18.04 system. How do I check running process using ps command under Ubuntu or Debian based system.

List All Running Processes using ps command in Ubuntu


If you want to list all running processes in your Ubuntu system, and you can open a terminal, and type “ps -aux” command at the shell prompt:

$ ps aux | less
$ ps aux | more
$ ps -a

Outputs:

$ ps aux | less
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.6 225768 6400 ? Ss 01:48 0:01 /sbin/init splash
root 2 0.0 0.0 0 0 ? S 01:48 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I

Check Running Process using top command in Ubuntu


You can also use top command to display Linux processes, and it will provide a dynamic real-time view of a running system. and it can display system summary information as well as a list of processes or threads currently being managed by the linux kernel. type:

$ top

outputs:

top - 02:09:20 up 20 min, 2 users, load average: 0.00, 0.14, 0.25
Tasks: 279 total, 1 running, 242 sleeping, 0 stopped, 0 zombie
%Cpu(s): 6.3 us, 2.6 sy, 0.9 ni, 88.8 id, 0.9 wa, 0.0 hi, 0.4 si, 0.0 st
KiB Mem : 1006580 total, 74704 free, 690044 used, 241832 buff/cache
KiB Swap: 2097148 total, 1335628 free, 761520 used. 133292 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5831 devops 20 0 44216 4052 3344 R 23.5 0.4 0:00.05 top
1 root 20 0 225768 6380 4712 S 0.0 0.6 0:01.71 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd

Find the ID of Process using pgrep command in Ubuntu


If you want to find a process by name in your Ubuntu system, and you can use the pgrep command at the shell prompt, type:

$ pgrep processName
$ pgrep apache2

Outputs:

devops@devops-ubuntu:~$ pgrep apache2
1365
4276
4277
4278
4279
4280

Kill a Process using kill command in Ubuntu


If you want to kill a process on your Ubuntu system, and you can use kill command from the command line, type:

$ sudo kill pidNumber
$ sudo kill -i pidNumber

You need to find the ID of Process using pgrep or pidof command. For example, you want to kill a process named apache2, its pid is 4280, type:

$ sudo kill -9 4280

you can also kill a process by name using pkill or killall command, type:

$ sudo killall apache2

or

$ sudo pkill apache2

Conclusion


You should know that how to check running process using ps/top/pgrep commands in your Ubuntu Linux system.

The post How To Check Running Process in Ubuntu first appeared on RSSFeedsCloud.

How To Disable and Stop Firewall on Linux(CentOS/Ubuntu)

This post will guide you how to disable Firewall on your CentOS 7 or CentOS 8 or Ubuntu Linux system. How do I Stop Firewalld or UFW service on your CentOS or Ubuntu Linux from the command line.

What is Firewalld


firewalld provides a dynamically managed firewall with support for network/firewall zones to define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings and for ethernet bridges and has a separation of runtime and permanent configuration options. It also supports an interface for services or applications to add firewall rules directly.

What is UFW


UFW is used by Ubuntu and Debian Linux system for managing a netfilter firewall. This program is for managing a Linux firewall and aims to provide an easy to use interface for the user.

Checking Firewall Status


If you need to check the current status of the firewalld service or checking if a frewalld service is running or not in your CentOS or RHEL system, and you can use the following command:

$ sudo firewall-cmd --state

Or

$ systemctl status firewalld

outputs:

[devops@mydevops ~]$ sudo firewall-cmd --state
running
[devops@mydevops ~]$ systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-10-08 02:53:52 EDT; 6h ago
Docs: man:firewalld(1)
Main PID: 846 (firewalld)
Tasks: 2 (limit: 8297)
Memory: 31.0M
CGroup: /system.slice/firewalld.service
└─846 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

Oct 08 02:53:50 mydevops.com systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 08 02:53:52 mydevops.com systemd[1]: Started firewalld - dynamic firewall daemon.

If you want to check if a UFW firewall is running or not on your Ubuntu or Debian based system, and you can use the following command:

$ sudo ufw status

Outputs:

devops@devops:~$ sudo ufw status
Status: active

Stopping Firewall


If you want to stop the firewalld service temporarily on your CentOS or RHEL Linux system, you can type the following command:

$ sudo systemctl stop firewalld

It is only valid for the current runtime session.

For Ubuntu or Debian Linux:

$ sudo ufw disable

Outputs:

devops@devops:~$ sudo ufw disable
Firewall stopped and disabled on system startup

Disabling Firewall


If you want to disable the firewalld service or UFW in CentOS or Ubuntu system at boot time, you can use the following command:

$ sudo systemctl disable firewalld

or

$ sudo ufw disable

Outputs:

[devops@mydevops ~]$ sudo systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[devops@mydevops ~]$

devops@devops:~$ sudo ufw disable
Firewall stopped and disabled on system startup

Enabling Firewall


if you want to enable the Firewall service or UFw based firewall on your CentOS or Ubuntu Linux system, and you can type the following command at the shell prompt:

$ sudo systemctl enable firewalld

or

$ sudo ufw enable

Outputs:

[devops@mydevops ~]$ sudo systemctl enable firewalld
Created symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service → /usr/lib/systemd/system/firewalld.service.
Created symlink /etc/systemd/system/multi-user.target.wants/firewalld.service → /usr/lib/systemd/system/firewalld.service.


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

Conclusion


You should know that how to stop and disable the firewalld service or UFW based firewall in your CentOS or RHEL or Ubuntu Linux system.

The post How To Disable and Stop Firewall on Linux(CentOS/Ubuntu) first appeared on RSSFeedsCloud.

How To start/Stop/Restart Network Service on Ubuntu or Debian Linux

This post will guide you how to start or restart network service on the latest Ubuntu 18.04 or Debian linux system. How do I start, stop or restart Network service from the command line on your Ubuntu Linux system.

Displaying Netowrking Configuration File


If you are working on a Ubuntu Linux system, and you may be need to set IP address for a given enternet interface or you need to change network settings by modifying networking configuration file called interfaces located in the /etc/network directory using your vim text editor. or you can use cat command to dispaly the content of the current networking configuration file, type:

$ sudo vim /etc/network/interfaces

or

$ cat /etc/network/interfaces

Outputs:

devops@devops:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet dhcp

Starting Network Service in Ubuntu


If your network service daemon is stopped, and you may be need to start it by using the following command:

$ sudo systemctl start networking.service

or

$ sudo /etc/init.d/networking start

Stop Network Service in Ubuntu


If you wish to stop a network service in your Ubuntu or Debian Linux, and you can type the following comand:

$ sudo systemctl stop networking.service

or

$ sudo /etc/init.d/networking stop

Restart Network Service in Ubuntu


If you modified networking configuration in your Ubuntu system, and you need to restart its service by using the following command:

$ sudo systemctl restart networking.service

or

$ sudo /etc/init.d/networking restart

Checking Status of Networking Service


If you need to check the current status of networking service in your Ubuntu system, and you can issue the following command:

$ sudo systemctl status networking.service

Or

$ sudo /etc/init.d/networking status

Outputs:

devops@devops:~$ sudo systemctl status networking.service
networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; disabled; vendor preset: enabled)
Active: active (exited) since Tue 2019-10-08 02:59:03 EDT; 18min ago
Docs: man:interfaces(5)
Main PID: 1158 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 1121)
CGroup: /system.slice/networking.service

Oct 08 02:58:59 devops systemd[1]: Starting Raise network interfaces...
Oct 08 02:59:03 devops systemd[1]: Started Raise network interfaces.

Enabling Netowrk Service in Ubuntu


If you want to enable your network service at system boot on your Ubuntu system, and you can run the following command:

$ sudo systemctl enable networking.service

Outputs:

devops@devops:~$ sudo systemctl enable networking.service
Synchronizing state of networking.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable networking

Disabling Network Service in Ubuntu


If you want to diable network service at system boot, just using the following command:

$ sudo systemctl disable networking.service

Conclusion


You should know that how to start/stop/restart/enable/disalbe network service in your Ubuntu or Debian L Linux system.

The post How To start/Stop/Restart Network Service on Ubuntu or Debian Linux first appeared on RSSFeedsCloud.