Uninstall A Package Via Command Line On Ubuntu Linux

Use one of these codes here to get a list of all the packages on your device.

$ apt --installed
OR
$ dpkg -l

Once you have found that program, use apt or one of these commands to remove it.

$ sudo apt remove package-name
OR
$ sudo apt-get remove package-name
OR
$ sudo dpkg -r package-name

Any of the above commands will remove the specified package, but they will leave behind configuration files, and in some cases, other files that were associated with the package. To remove those as well, you need to “purge” the package. You can do this either after removing a package or instead of removing a package (purging automatically implies removing as well).

$ sudo apt purge package-name
OR
$ sudo apt-get purge package-name
OR
$ sudo dpkg -P package-name

Source