Tuesday, February 6, 2024

[SOLVED] Google Chrome installation failed on Ubuntu (/usr/bin/xdg-icon-resource: 12: Syntax error)

Issue

On KDE Neon 5.27 (so Ubuntu 22.04 LTS) I have downloaded the official chrome deb file but from the terminal I get this strange error

/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
  c = findall("[[(](\S+)/\S+[])]", msg)[0].lower()
Selezionato il pacchetto google-chrome-stable non precedentemente selezionato.
(Lettura del database... 293369 file e directory attualmente installati.)
Preparativi per estrarre .../google-chrome-stable_current_amd64.deb...
Estrazione di google-chrome-stable (121.0.6167.139-1)...
Configurazione di google-chrome-stable (121.0.6167.139-1)...
/usr/bin/xdg-icon-resource: 12: Syntax error: end of file unexpected (expecting ";;")
dpkg: errore nell'elaborare il pacchetto google-chrome-stable (--install):
 il sottoprocesso installato pacchetto google-chrome-stable script post-installation ha restituito lo stato di errore 2
Elaborazione dei trigger per bamfdaemon (0.5.6+22.04.20220217-0ubuntu1)...
Rebuilding /usr/share/applications/bamf-2.index...
Elaborazione dei trigger per mailcap (3.70+nmu1ubuntu1)...
Elaborazione dei trigger per desktop-file-utils (0.26-1ubuntu3)...
Elaborazione dei trigger per man-db (2.10.2-1)...
Not building database; man-db/auto-update is not 'true'.
Si sono verificati degli errori nell'elaborazione:
 google-chrome-stable

I tried with the classic sudo apt install ./google-chrome-stable_current_amd64.deb and also with sudo gdebi ./google-chrome-stable_current_amd64.deb, but no luck same error.

The annoying thing is that I have an installation that didn't finish correctly and I cannot remove the package because now all these commands fail

sudo apt --fix-broken install
sudo apt-get install -f
sudo apt-get autoremove
sudo apt remove google-chrome-stable

with the same error:

Rimozione di google-chrome-stable (121.0.6167.139-1)...
/usr/bin/xdg-icon-resource: 12: Syntax error: end of file unexpected (expecting ";;")
dpkg: errore nell'elaborare il pacchetto google-chrome-stable (--remove):
 il sottoprocesso installato pacchetto google-chrome-stable script pre-removal ha restituito lo stato di errore 2
dpkg: troppi errori, chiusura in corso
/usr/bin/xdg-icon-resource: 12: Syntax error: end of file unexpected (expecting ";;")
dpkg: errore durante la pulizia:
 il sottoprocesso installato pacchetto google-chrome-stable script post-installation ha restituito lo stato di errore 2
Si sono verificati degli errori nell'elaborazione:
 google-chrome-stable
L'operazione è stata bloccata perché si sono verificati troppi errori.
E: Sub-process /usr/bin/dpkg returned an error code (1)

The workaround to remove chrome is to edit this file sudo gedit /var/lib/dpkg/info/google-chrome-stable.prerm adding as first line exit 0. After that sudo apt remove google-chrome-stable works.

Any suggestions to fix the install?


Solution

I solved this error by following this guide on the link bellow: https://www.mail-archive.com/[email protected]/msg881471.html

Is just a leading backtick. Remove it and save the file.



Answered By - Kain Nhantumbo
Answer Checked By - Marie Seifert (WPSolving Admin)