7

I want to install Open JDK or Oracle JDK to my machine but I got an error during installation. The error is:

Selecting previously unselected package oracle-java8-installer.
dpkg: warning: files list file for package 'unity-scope-gourmet' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-guayadeque' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-gmusicbrowser' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-manpages' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-firefoxbookmarks' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-gdrive' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-home' missing; assuming package has no files currently installed
E: Sub-process /usr/bin/dpkg returned an error code (2)

I searched on Google and try to something for install/reinstall this packages. Finally i try to remove Unity. I faced this error for my every tries. I am using Xmonad. How can I fix this issue?

0
10

One loop over the seven packages' names to recreate the list-file for each package.

But first run

sudo apt-get autoclean

to remove unneeded DEBs in /var/cache/apt/archives. This is necessary that the following commands work properly.

arch="$(dpkg --print-architecture)"
for p in
  unity-scope-gourmet unity-scope-guayadeque unity-scope-gmusicbrowser
  unity-scope-manpages unity-scope-firefoxbookmarks unity-scope-gdrive
  unity-scope-home
do
    find /var/cache/apt/archives -type f -name "${p}_*_${arch}.deb" -exec dpkg-deb --fsys-tarfile {} \; -quit | tar t | cut -f2- -d. | sed 's|^/$|/.|;s|/$||' | sudo tee "/var/lib/dpkg/info/$p.list" > /dev/null
done
sudo chmod -R a+r /var/lib/dpkg/info

Some tests later, the command

sudo apt-get install --reinstall unity-scope-gourmet unity-scope-guayadeque unity-scope-gmusicbrowser unity-scope-manpages unity-scope-firefoxbookmarks unity-scope-gdrive unity-scope-home

should also help.

3
  • dpkg-deb shouldn't need sudo, the find command should probably be terminated after the first match. And instead of dpkg-deb -c ... | awk ... | , where you're processing tar's verbose output, you could use tar to print only the paths: dpkg-deb --fsys-tarfile {} | tar t | ...
    – muru
    Jan 1 '16 at 12:21
  • Can you explain in detail one command to recreate? What if I do not want to install but to remove the package?
    – Timo
    Mar 5 '18 at 19:55
  • @Timo: If you want to remove the package you should still reinstall it to recreate its file list first and only then remove it, so that Apt knows which files to remove. Jul 22 '18 at 5:53
-1

I tried it A.B.'s approach but i faced same error with unity-scope-devhelp. Then, i deleted /var/lib/dpkg/unity-scope-devhelp.list

It Works :)

1
  • 1
    Why didn't you adapt A.B.'s method for unity-scope-devhelp?
    – muru
    Jan 1 '16 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.