No Dock in Ubuntu 18.04

Solution 1:

I have personally experienced this many times.. as the first thing I do in lot of fresh Installations of Ubuntu 18.04 is to run sudo rm -rf /usr/share/gnome-shell/extenisons/* This will remove the pre-enabled extensions but apt still thinks this is not removed from the system and that's why it says gnome-shell-extension-ubuntu-dock is already the newest version (0.9.1ubuntu18.04.3).

Example:

pratap@i7-4770U:~$ ls /usr/share/gnome-shell/extensions/
[email protected]  [email protected]
pratap@i7-4770U:~$ sudo rm -rf /usr/share/gnome-shell/extensions/*
[sudo] password for pratap: 
pratap@i7-4770U:~$ ls /usr/share/gnome-shell/extensions/
pratap@i7-4770U:~$ sudo apt install gnome-shell-extension-ubuntu-dock
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gnome-shell-extension-ubuntu-dock is already the newest version (0.9.1ubuntu18.04.3).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
pratap@i7-4770U:~$ sudo apt purge gnome-shell-extension-ubuntu-dock
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  gnome-shell-extension-ubuntu-dock* ubuntu-desktop*
0 upgraded, 0 newly installed, 2 to remove and 8 not upgraded.
After this operation, 687 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 233472 files and directories currently installed.)
Removing ubuntu-desktop (1.417.1) ...
Removing gnome-shell-extension-ubuntu-dock (0.9.1ubuntu18.04.3) ...
Processing triggers for libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.2) ...
pratap@i7-4770U:~$ 

so, the workaround is to purge the extension with the below command

sudo apt purge gnome-shell-extension-ubuntu-dock

and then re-install with

sudo apt install gnome-shell-extension-ubuntu-dock

between these two commands, I am not sure.. whether these commands are required or not

sudo apt autoremove && sudo apt autoclean
gnome-session-logout

and then Install it from any tty, I did not remember it when I came across with this situation.. but guessing is that sudo apt purge gnome-shell-extension-ubuntu-dock command will remove ubuntu-desktop also