$ sudo apt-get remove rstudio-server-1.0.143-amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rstudio-server-1.0.143-amd64.deb
E: Couldn't find any package by glob 'rstudio-server-1.0.143-amd64.deb'
E: Couldn't find any package by regex 'rstudio-server-1.0.143-amd64.deb'

- 70,465

- 111
2 Answers
Guess here that you installed rstudio-server
by downloading it from an external source and then installing it using dpkg
or GDebi
. So, you are trying to remove it using the command:
sudo apt-get remove rstudio-server-1.0.143-amd64.deb
But, rstudio-server-1.0.143-amd64.deb
is the name of the file. The software is installed as: rstudio-server
. So, the correct command will be:
sudo apt-get remove --purge rstudio-server
Visit the question How can I reproduce the error "package... needs to be reinstalled, but I can't find an archive for it" for testing? and go to the How to manage broken packages section of the answer:
Try to remove the offending package, by force if necessary. You have to be very careful here as you can force the removal of a critical package or, worse, a set of critical packages.
The following commands go from polite to less polite to outright force. Try them in order.
sudo dpkg --remove $broken_package sudo dpkg --remove --force-remove-reinstreq $broken_package sudo dpkg --remove --force-all $broken_package
I hope that will help somebody. It worked for me.

- 14,585
sudo apt-get remove purge rstudio-server
– Raphael Jun 30 '17 at 09:15dpkg -r rstudio-server-1.0.143-amd64.deb
– v_sukt Jun 30 '17 at 14:02sudo apt-get remove rstudio-server
. Both purge and remove shouldn't be there. – Soumya Boral Aug 25 '21 at 14:22