Have you ever used your terminal to uninstall your programs in your ubuntu machine? It is not that hard! Terminal is real power and you need to learn it. Practice, practice and practice and one day you will feel the joy of using the terminal for almost everything. Now let me introduce you guys to my simple problem.
I have installed TeamViewer 8 from a deb package and I am not using it anymore, so I decided to uninstall this software, but I want to do it from terminal since I love it, and make me understand how things work from a low level. But, the question is, how? Do you know what a deb package is? Since is very important to know what a deb package is I am explaining it to you in two or three short sentences.
A deb package is an archive that contains two tar archives. These archives may be compressed with gzip (zlib), Bzip2, or xz programs and the deb package is handled by dpkg or other programs such as apt/aptitude, the Ubuntu Software Center, Synaptic or Gdebi.
"Debian packages can be converted into other packages and vice versa using alien, and created from source code using CheckInstall or Debian Package Maker." (Wikipedia)
I think you guys understand now that to remove TeamViewer 8 from my ubuntu machine I have to remove the package with its configuration files. What if you do not remember the exact name of the package you want to remove? Don't worry! The Tab will help you to autocomplete the name of the package.
Find the package name with dpkg
I use dpkg -l | grep -i teamviewer command to find the package name of teamviewer. You can see it on Figures.
Remove the package from terminal
Use apt-get purge package_name to remove the package with its configuration files.
$ sudo apt-get purge teamviewer
I showed you how to use apt-get purge package_name for removing my TeamViewer package, but you can use it to remove any package you like.