smhk

Workaround for installing Dropbox on Debian with libpango transitional package

tl;dr:

On Linux, Dropbox depends upon libpango1.0-0, which was renamed to libpango-1.0-0 over six years ago. In the meantime, libpango1.0-0 became a deprecated, “transitional package”, which depends upon libpango-1.0-0 as a means of easing the renaming transition. A month ago, Debian removed the transitional package. Until Dropbox update their package to depend upon libpango-1.0-0, it is no longer possible to do apt install dropbox.

The best workaround for now is to create your own transitional package:

apt install equivs
mkdir /tmp/pkg
cd /tmp/pkg
cat <<EOF >>libpango1.0-0
Package: libpango1.0-0
Version: 1.44.7-4
Depends: libpango-1.0-0
EOF
equivs-build libpango1.0-0
apt install ./libpango1.0-0_1.44.7-4_all.deb
apt-mark auto libpango1.0-0

Following are the full notes, but the tl;dr above gives the solution.

Installing Dropbox 2020.03.04 on Debian 10. Followed the official instructions to install Dropbox.

$ sudo dpkg -i dropbox_2020.03.04_amd64.deb 
Selecting previously unselected package dropbox.
(Reading database ... 266502 files and directories currently installed.)
Preparing to unpack dropbox_2020.03.04_amd64.deb ...
Unpacking dropbox (2020.03.04) ...
dpkg: dependency problems prevent configuration of dropbox:
 dropbox depends on libpango1.0-0 (>= 1.36.3); however:
  Package libpango1.0-0 is not installed.

dpkg: error processing package dropbox (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for mime-support (3.64) ...
Processing triggers for desktop-file-utils (0.24-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 dropbox

Was unsuccessful.

Followed steps on Dropbox forum.

$ sudo dpkg --ignore-depends=libpango1.0-0 -i dropbox_2020.03.04_amd64.deb 
Selecting previously unselected package dropbox.
(Reading database ... 266502 files and directories currently installed.)
Preparing to unpack dropbox_2020.03.04_amd64.deb ...
Unpacking dropbox (2020.03.04) ...
Setting up dropbox (2020.03.04) ...
Please restart all running instances of Nautilus, or you will experience problems. i.e. nautilus --quit
Dropbox installation successfully completed! You can start Dropbox from your applications menu.
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for mime-support (3.64) ...
Processing triggers for desktop-file-utils (0.24-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.9.1-1) ...

That worked, but with a big caveat. Whenever apt upgrade is run, the following error occurs, and the entire update aborts:

$ sudo apt upgrade
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:
 dropbox : Depends: libpango1.0-0 (>= 1.36.3) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Some suggest installing libpango1.0-0, but this does not work:

$ sudo apt install libpango1.0-0
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:
 libpango1.0-0 : Depends: libpango-1.0-0 (= 1.40.5-1) but 1.44.7-4 is to be installed
                 Depends: libpangocairo-1.0-0 (= 1.40.5-1) but 1.44.7-4 is to be installed
                 Depends: libpangoft2-1.0-0 (= 1.40.5-1) but 1.44.7-4 is to be installed
                 Depends: libpangox-1.0-0 (>= 0.0.2-2~) but it is not going to be installed
                 Depends: libpangoxft-1.0-0 (= 1.40.5-1) but 1.44.7-4 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Similarly, trying libpango-1.0-0 does not work:

$ sudo apt install libpango-1.0-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpango-1.0-0 is already the newest version (1.44.7-4).
libpango-1.0-0 set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 dropbox : Depends: libpango1.0-0 (>= 1.36.3) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Perhaps try modifying the Dropbox .deb to depend upon libpango1.0-0 rather than libpango-1.0-0? Would prefer not to have to hack the package to make it work.

Let’s try first uninstalling Dropbox:

$ sudo apt remove dropbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  dropbox
0 upgraded, 0 newly installed, 1 to remove and 153 not upgraded.
After this operation, 339 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 266529 files and directories currently installed.)
Removing dropbox (2020.03.04) ...
Processing triggers for mime-support (3.64) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1) ...

Let’s try making a temporary replacement.

apt install equivs
mkdir /tmp/pkg
cd /tmp/pkg
cat <<EOF >>libpango1.0-0
Package: libpango1.0-0
Version: 1.44.7-4
Depends: libpango-1.0-0
EOF
equivs-build libpango1.0-0
apt install ./libpango1.0-0_1.44.7-4_all.deb
apt-mark auto libpango1.0-0

Now let’s try installing dropbox:

apt install equivs
mkdir /tmp/pkg
cd /tmp/pkg
cat <<EOF >>libpango1.0-0
Package: libpango1.0-0
Version: 1.44.7-4
Depends: libpango-1.0-0
EOF
equivs-build libpango1.0-0
apt install ./libpango1.0-0_1.44.7-4_all.deb
apt-mark auto libpango1.0-0

That did the trick!