I was having problem to remove Replication from server after removing the replication from the db using
EXEC sp_removedbreplication 'DBName';
then after getting some research i got how to do this, here is the procedure
EXEC master.dbo.sp_serveroption @server=N'abcserver', @optname=N'dist', @optvalue=N'false'
use sp_helpserver to get servers.
or use this command
EXEC sp_dropdistributor @no_checks = 1, @ignore_distributor = 1