Linux Resources
- Home
- Linux Resources
This article covers how to install Flask on Ubuntu 20.04. Flask is a powerful web framework for any developer. Unlike Django , by default Flask doesn’t include ORM, form validation, or any other functionalities provided by third-party libraries. Flask is built with extensions in mind, which are Python packages that add functionality to a Flask application.
Flask packages are included in the official Ubuntu repositories and can be installed using the apt package manager.
This is the simplest way to install Flask on Ubuntu 20.04, but not as flexible as installing in a virtual environment.
Also, the version included in the repositories may lag behind the latest version of Flask.
To install Flask on Ubuntu 20.04:
1. Ubuntu 20.04 ships with Python 3.8. You can verify that Python is installed on your system by typing:
$ python3 -V
2. The recommended way to create a virtual environment is by using the venv module, which is provided by the python3-venv package. Run the following command to install the package:
$ sudo apt install python3-venv
3. Create a new directory for the Flask application and switch into it:
$ mkdir flask_app && cd flask_app
4. Run the following command inside the directory to create the virtual environment:
$ python3 -m venv venv
The command will create a directory called venv, which contains a copy of the Python binary, the Pip package manager , the standard Python library, and other supporting files. You can use any name you want for the virtual environment.
5. To start using the virtual environment, you need to activate it with the activate script:
source venv/bin/activate
6. Now that the virtual environment is activated, use the Python package manager pip to install Flask:
$ pip install Flask
7. To verify the installation, run the following command, which prints the Flask version:
$ python -m flask --version
This article covers how you can list installed packages on Ubuntu 20.04 LTS system. Also, you can also filter a specific package from the list and count the number of installed packages on your system.
You can list all installed packages with apt command or apt-get command on Ubuntu Linux.
You need to use the apt or apt-get or dpkg command to list all installed packages on an Ubuntu Linux server from the bash shell prompt.
To see what packages are installed on Ubuntu Linux:
1. Open the terminal application or log in to the remote server using ssh (e.g. ssh user@sever-name).
2. Run command apt list --installed to list all installed packages on Ubuntu.
3. To display a list of packages satisfying certain criteria such as show matching apache2 packages, run apt list apache.
To List all installed packages only:
The apt command displays both installed and packages available to install:
$ apt list --installed
To list or find out if a specific package installed or not:
Run package policy as follows:
$ apt list -a pkgNameHere
This article covers how a cron job can be scheduled to run every hour on Ubuntu System. Most Linux users are familiar with the Crontab job scheduler, which acts as a silent daemon that performs all the tasks assigned to it automatically, without any human intervention.
This job scheduler makes the life of a Linux user much easier, as the user can hand over all the frequently occurring tasks to the Crontab scheduler so that these tasks can be executed automatically according to a specified schedule.
To Start Crontab Service
Run the following command:
$ sudo systemctl start cron
To Check Status of Crontab Service
Execute the command:
$ sudo systemctl status cron
To Launch Crontab File:
Execute the command:
$ crontab –e
To Run a program or script every 5 or X minutes or hours on Linux:
1. Edit your cronjob file by running crontab -e command.
2. Add the following line for an every-5-minutes interval. */5 * * * * /path/to/script-or-program.
3. Save the file, and that is it.
This article covers how to install Skype on Linux Mint 20 system. Skype is used to make free video and voice calls, send instant messages, and also to share files with other people on Skype.
However, if at any instance, you feel like you are getting more inclined towards some other application or Skype is not fulfilling your needs anymore, then you can easily remove it by following the removal method prescribed in this guide.
To Install Skype on Linux Mint using the Software Center:
1. Click ‘Menu’, type ‘Software Manager’ in the search box and launch it.
2. Search for ‘Skype’ in the Software Manager’s search box. You should see Skype and Skype (Flathub). These are just coming from two different sources. Click on only the “Skype” version. This is coming from the official Linux Mint’s Repository source.
3. Click “Install”, enter the Root password to complete the installation.
4. After the installation is complete, you can click on the “Launch” button or open the app from the “Applications” menu.
5. Start using Skype!
This article covers the different methods to install Skype on Ubuntu 20.04 LTS including both the GUI and the command line.
To install the Skype snap, open your terminal (Ctrl+Alt+T) and run the following command:
$ sudo snap install skype --classic
That's it. You have installed Skype on your Ubuntu machine, and you can start using it.
How to install Skype with apt on Ubuntu ?
Skype is available from the official Microsoft Apt repositories. To install it, follow the steps below:
1. Open your terminal and download the latest Skype .deb package using the following wget command:
$ wget https://go.skype.com/skypeforlinux-64.deb
2. Once the download is complete, install Skype by running the following command as a user with sudo privileges :
$ sudo apt install ./skypeforlinux-64.deb
You will be prompted to enter your password.
3. When a new version is released, you can update the Skype package through your desktop standard Software Update tool or by running the following commands in your terminal:
$ sudo apt update
$ sudo apt upgrade
This article covers how to install Apache web server on CentOS 8 distribution. With Apache we server, you can host web pages over the network. Apache is available within CentOS's default software repositories, which means you can install it with the dnf package manager.
To install Apache on CentOS:
1. Execute the command below to install the Apache package:
$ sudo dnf install httpd
After confirming the installation, dnf will install Apache and all required dependencies.
2. If you also plan to configure Apache to serve content over HTTPS, you will also want to open up port 443 by enabling the https service:
$ sudo firewall-cmd --permanent --add-service=https
3. Next, reload the firewall to put these new rules into effect:
$ sudo firewall-cmd --reload
After the firewall reloads, you are ready to start the service and check the web server.
To check your Apache Web Server:
1. Apache does not automatically start on CentOS once the installation completes, so you will need to start the Apache process manually:
$ sudo systemctl start httpd
2. Verify that the service is running with the following command:
$ sudo systemctl status httpd
You will receive an active status when the service is running.
To manage the Apache Process on CentOS:
Now that the service is installed and running, you can now use different systemctl commands to manage the service.
1. To stop your web server, type:
$ sudo systemctl stop httpd
2. To start the web server when it is stopped, type:
$ sudo systemctl start httpd
3. To stop and then start the service again, type:
$ sudo systemctl restart httpd
4. If you are simply making configuration changes, Apache can often reload without dropping connections. To do this, use this command:
$ sudo systemctl reload httpd
5. By default, Apache is configured to start automatically when the server boots. If this is not what you want, disable this behavior by typing:
$ sudo systemctl disable httpd
6. To re-enable the service to start up at boot, type:
$ sudo systemctl enable httpd
Apache will now start automatically when the server boots again.