Sunday, July 7, 2019

dpkg - Upgrade from 17.10 -> 18.04 crashing on qdbus-qt5 install

I am unable to upgrade 17.10 to 18.04 because the installation of qdbus-qt5 is failing. This is actually kubuntu, but I have asked the question on the kubuntu and ubuntu forums, as well as launchpad, and have not been able to resolve the problem. The upgrade goes fine until it reaches qdbus-qt5, at which point it crashes and cannot go any further. I tried purging qbdus-qt5 (and most of kde along with it), and the upgrade goes through, but still cannot install qbdus-qt5 and therefore kde.



Trying to manually install qdbus-qt5 with dpkg, I get the following error:




root@Crynfyd:/# dpkg -i /var/cache/apt/archives/qdbus-qt5_5.9.5-0ubuntu1_amd64.deb
(Reading database ... 839516 files and directories currently installed.)
Preparing to unpack .../qdbus-qt5_5.9.5-0ubuntu1_amd64.deb ...
Unpacking qdbus-qt5 (5.9.5-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/qdbus-qt5_5.9.5-0ubuntu1_amd64.deb (--install):
unable to open '/usr/lib/qt5/bin/qdbus.dpkg-new': No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/qdbus-qt5_5.9.5-0ubuntu1_amd64.deb



Basically it is supposed to be creating the file /usr/lib/qt5/bin/qdbus.dpkg-new , but it is deleting it instead. If I touch the file, it deletes it and quits. Some sort of strange conundrum that I can't get around.



More details in launchpad here:



https://answers.launchpad.net/ubuntu/+source/qttools-opensource-src/+question/668259



Any help or ideas much appreciated. Please, no "fresh install", that is impractical and not a solution. I don't really know where the problem is, whether a problem with qdbus-qt5, dpkg, or whatever else I cannot imagine as others don't seem to be having this problem, and it isn't occurring with other packages (well, it does occur with other qtcreator packages, but I have purged those before the upgrade). This is a real mess and it is blocking the whole upgrade process.







Updates



Problem Solved.



The symptom:



Ugrade from 17.10 -> 18.04 crashes while trying to install qdbus-qt5.
Trying to manually install the package produces this error:







root@Crynfyd:/# dpkg -i /var/cache/apt/archives/qdbus-   qt5_5.9.5-0ubuntu1_amd64.deb
(Reading database ... 839516 files and directories currently installed.)
Preparing to unpack .../qdbus-qt5_5.9.5-0ubuntu1_amd64.deb ...
Unpacking qdbus-qt5 (5.9.5-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/qdbus-qt5_5.9.5-0ubuntu1_amd64.deb (--install):
unable to open '/usr/lib/qt5/bin/qdbus.dpkg-new': No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/qdbus-qt5_5.9.5-0ubuntu1_amd64.deb






Here is the problem:



In artful, the package qdbus-qt5 installs its binary to
/usr/lib/x86_64-linux-gnu/qt5/bin/qdbus . The directory /usr/lib/qt5 is
actually a symbolic link to /usr/lib/x86_64-linux-gnu/qt5 . So
ls /usr/lib/qt5/bin/ produces a list of files that looks real, but they aren't
really there. I noticed that doing a dpkg-query --search /usr/lib/qt5/bin/qdbus

produced no results, and wondered why, as the files looked like they were there.



In bionic, the package qdbus-qt5 installs its binary to /usr/lib/qt5/bin/qdbus,
and installs a symlink in /usr/lib/x86_64-linux-gnu/qt5/bin/qdbus that points to
/usr/lib/qt5/bin/qdbus .



So when trying to upgrade from artful to bionic, the package installs its binary
into a directory that is a symlink to /usr/lib/x86_64-linux-gnu/qt5/bin/ and
then tries to install the symlink to the file the directory actually points to.
I discovered this while trying to manually install the files from the package,

and files were just disappearing. This is what dpkg has been screaming about all
along.



There is a problem, therefore, in the upgrade process going from which files are
symlinks and which are actual binaries. The upgrade process evidently doesn't
address this problem. I read somewhere that the upgrade from 16.04 -> 18.04
won't be in place until July; this may be one of the reasons why, and maybe the
same problem going from 17.10 -> 18.04. There may be other problems that have
not surfaced as of yet.




Note that this same problem also exists for several other packages, mostly
connected with QT Creator:



qtcreator 
qtcreator-data
qtcreator-doc
qmlscene
qt5-qmake
qttools5-dev-tools
qtbase5-dev-tools



And maybe others I haven't found yet.
They can be removed prior to the upgrade, though in my test they did
not cause any problems after applying the hack below.



SHAMELESS HACK to fix this for the upgrade:



## Remove the symlink:
sudo rm /usr/lib/qt5

## Do a hard copy of the relevant files:
sudo cp -r /usr/lib/x86_64-linux-gnu/qt5 /usr/lib/


I also noticed there is some sort of problem with locales; fix for that:



export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8

sudo dpkg-reconfigure locales


Then upgrade/dist-upgrade (or do-release-upgrade, or however you do it).
Still needed the occasional apt-get install -f / dpkg --configure -a /
dpkg -i --force-overwrite , but seems to go through as expected.



So much for "fresh install".



PS: Thanks to those who offered help. The bit about dpkg -x ing the package, and the bizarre results it produced, is what tipped me on this.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...