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

1
  • 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. Jun 5, 2021 at 8:40

1 Answer 1

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.

3
  • 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 Jun 4, 2021 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 4, 2021 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. Jun 5, 2021 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .