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
  • It must have been something else that is causing you those problems. Deleting /usr/share/bug should be relatively harmless; all it might impair is the Debian bug reporting script, reportbug, but I doubt you use that anyway. – user3840170 Jun 05 '21 at 08:40

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
  • 99,918
  • Thank You for you help. But that doesn't work. i literally used the command you provide. But i haven't notice any differences after rebooting – Arun Chinnathambi Jun 04 '21 at 10:04
  • 6
    Then you have to provide more information about removed folders or paths. Recovery of whole /usr/share folder is possible by other answer. Reinstallation of all packages is possible by commands like sudo apt-get install --reinstall $(dpkg -l | grep ^ii | awk '{print $2}') . – N0rbert Jun 04 '21 at 10:09
  • 3
    @ArunChinnathambi it is possible that your problems are caused by something else and you do not realise that. This answer should be able to sort you out if the problem is what you stated it is. – Andrew Savinykh Jun 05 '21 at 04:09