0

When I run apt-get upgrade using root user, I got...

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libglib2.0-dev : Depends: libglib2.0-bin (= 2.56.4-0ubuntu0.18.04.4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When I try apt --fix-broken install as it prompted, I got...

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libglib2.0-bin
The following NEW packages will be installed:
  libglib2.0-bin
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
9 not fully installed or removed.
Need to get 0 B/68.7 kB of archives.
After this operation, 284 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 91896 files and directories currently installed.)
Preparing to unpack .../libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb ...
Unpacking libglib2.0-bin (2.56.4-0ubuntu0.18.04.4) ...
dpkg: error processing archive /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb (--unpack):
 unable to securely remove '/usr/bin/gsettings.dpkg-new': Permission denied
Errors were encountered while processing:
 /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Basically, is there any way I can install that libglib2.0-bin?


Edit:

I tried sudo dpkg -i --force-overwrite /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb

and I got...

(Reading database ... 91896 files and directories currently installed.)
Preparing to unpack .../libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb ...
Unpacking libglib2.0-bin (2.56.4-0ubuntu0.18.04.4) ...
dpkg: error processing archive /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb (--install):
 unable to securely remove '/usr/bin/gsettings.dpkg-new': Permission denied
Errors were encountered while processing:
 /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb

So what does unable to securely remove '/usr/bin/gsettings.dpkg-new': Permission denied mean? I tried to manually rm this file and it appeared again immediately.


Edit:

ls -al /usr/bin/gsettings.dpkg-new returns:

-rwxrwxrwx 0 root root 26696 Jul 4 2019 /usr/bin/gsettings.dpkg-new

and

lsattr /usr/bin/gsettings.dpkg-new returns:

lsattr: Inappropriate ioctl for device While reading flags on /usr/bin/gsettings.dpkg-new

  • ls -al /usr/bin/gsettings.dpkg-newplease and lsattr /usr/bin/gsettings.dpkg-new – nobody Jan 16 '20 at 14:08
  • @nobody Thank you for your advice! Question updated. – TaihouKai Jan 16 '20 at 14:13
  • Do you run the apt-get commands with sudo ? They needs elevated rights to work. – Soren A Jan 16 '20 at 14:20
  • @SorenA The whole thing happens in root user with root privilege. – TaihouKai Jan 16 '20 at 14:21
  • Turn your system off. Boot a live-linux and make filesystemcheck. Look during the repair for errors. And I think it is also recommend to check your harddrive with smartmontools. And of course make a backup from yout datas. – nobody Jan 16 '20 at 15:22

2 Answers2

1

I finally managed to delete everything depending on libglib2.0-dev and install everything again and it worked.

0

Look like a problem with the archive. Try removing it by doing the following:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libglib2.0-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb

This question looks a lot like this and it was already explained in more detail

Oscar
  • 299
  • This command returns similar thing(shown in question). I am reading the question given and see whether something might work. – TaihouKai Jan 16 '20 at 13:45