6

I accidentally removed the /usr/share/bug directory using the following command:

sudo rm -r /usr/share/bug

That bug directory had supportive files for most of the installed packages. I want them back. This problem leads me to some serious issues.

After rebooting my PC I can't even open system packages like Disks, Disk usage analyser, and even settings editor and settings manager. And also all the icons of the installed packages are gone.

Please help me to solve this problem. Installed packages appears without icon

psmears
  • 138
  • 4

1 Answers1

14

You can ask the APT to run a restoration procedure for you. Use commands below:

sudo apt-get update
sudo apt-get install --reinstall $(dpkg -S /usr/share/bug | sed 's/,//g' | sed 's|: /usr/share/bug||g')

where:

  • dpkg -S /usr/share/bug shows the list of comma-separated packages
  • sed 's/,//g' - removes commas
  • sed 's|: /usr/share/bug||g' - removes : /usr/share/bug in the end

Additional notes. If above does not help then you have two options:

  • reinstall packages which have files upper level directory - in /usr/share by

    sudo apt-get install --reinstall $(dpkg -S /usr/share | sed 's/,//g' | sed 's|: /usr/share||g')
    
  • reinstall all installed packages by

    sudo apt-get install --reinstall $(dpkg -l | grep ^ii | awk '{print $2}')
    

Then reboot.

N0rbert
  • 103,263