how to delete deb package from ubuntu code example

Example 1: ubuntu remove package and dependencies install deb

#For Ubuntu the correct method to remove packages through the console is:
apt-get –-purge remove skypeforlinux.
dpkg –-remove skypeforlinux.
dpkg –r packagename.deb.
apt-get clean && apt-get autoremove. sudo apt-get -f install. ...
#apt-get update. #dpkg –-configure -a. ...
apt-get -u dist-upgrade.
apt-get remove –dry-run packagename.

Example 2: install *.deb file in ubuntu

Install a downloaded program in Ubuntu - Linux
sudo dpkg -i package_file.deb
//or
sudo apt install path_to_deb_file