We have moved to a new Sailfish OS Forum. Please start new discussions there.
8

Verify integrity of installed packages after upgrade or later

asked 2015-10-29 09:08:35 +0200

villes gravatar image

updated 2020-04-14 19:33:38 +0200

olf gravatar image

My Jolla has suffered so far two problems after 2.0.0.10 upgrade. (This post)

Both related to zero sized files and not properly updated package where package was in place, but there were no files in filesystem or some files were missing belonging that package, and package version was old.

These problems caused that I could not access Accounts, or launch browser since browser paniced because missing library files (package xulrunner-qt5 was installed, but wrong version and missing library files)

My question/feature-request: Is there or should be there some sort of verify process or tool after upgrade to make sure everything is up to date?

In my case fix was to re-run: pkcon install pkgname

I was curious and luckily find out that there was rpm binary installed so I ended up running rpm --verify against all installed packages to see how much there are differencies. I found there was some, mostly just timestamp and permission differencies but also MD5 sum differencies. Below is explained what verify output means.

   S file Size differs
   M Mode differs (includes permissions and file type)
   5 MD5 sum differs
   D Device major/minor number mismatch
   L readLink(2) path mismatch
   U User ownership differs
   G Group ownership differs
   T mTime differs
   P caPabilities differ

One package for example.

[root@Jolla tmp]# rpm -V libjollasignonuiservice-qt5
5..T.....    /usr/lib/libjollasignonuiservice-qt5.so.1.0.0
...T.....    /usr/share/translations/libjollasignonuiservice_qt5_eng_en.qm

[root@Jolla tmp]# pkcon install libjollasignonuiservice-qt5
Installing                                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Starting                                                                                                                                                                    
Refreshing software list                                                                                                                                                   
Querying                                                                                                                                                                   
Resolving dependencies                                                                                                                                                     
Installing packages                                                                                                                                                        
Installing                                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Waiting for authentication                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Starting                                                                                                                                                                    
Refreshing software list                                                                                                                                                   
Querying                                                                                                                                                                   
Resolving dependencies                                                                                                                                                     
Installing packages                                                                                                                                                        
Downloading packages                                                                                                                                                       
Installing packages                                                                                                                                                        
[root@Jolla tmp]# rpm -V libjollasignonuiservice-qt5
[root@Jolla tmp]#

Another example:

[root@Jolla tmp]# rpm -V nemo-qml-plugin-calendar-qt5-lightweight      
5S.T.....    /usr/bin/calendardataservice
5..T.....    /usr/lib/qt5/qml/org/nemomobile/calendar/lightweight/libnemocalendarwidget.so
[root@Jolla tmp]# ls -l /usr/bin/calendardataservice 
-rwxr-sr-x 1 root privileged 211660 Jul 16 15:59 /usr/bin/calendardataservice
[root@Jolla tmp]# pkcon install nemo-qml-plugin-calendar-qt5-lightweight
Installing                                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Starting                                                                                                                                                                    
Refreshing software list                                                                                                                                                   
Querying                                                                                                                                                                   
Resolving dependencies                                                                                                                                                     
Installing packages                                                                                                                                                        
Installing                                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Waiting for authentication                                                                                                                                                 
Waiting in queue                                                                                                                                                           
Starting                                                                                                                                                                    
Refreshing software list                                                                                                                                                   
Querying                                                                                                                                                                   
Resolving dependencies                                                                                                                                                     
Installing packages                                                                                                                                                        
Downloading packages                                                                                                                                                       
Installing packages                                                                                                                                                        
[root@Jolla tmp]# ls -l /usr/bin/calendardataservice 
-rwxr-sr-x 1 root privileged 212288 Sep  5 01:15 /usr/bin/calendardataservice
[root@Jolla tmp]# rpm -V nemo-qml-plugin-calendar-qt5-lightweight
[root@Jolla tmp]#

Package version was before and after same: nemo-qml-plugin-calendar-qt5-lightweight-0.2.8-10.22.1.jolla.armv7hl

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-10-12 23:44:22 +0200

olf gravatar image

updated 2020-04-14 19:28:05 +0200

Become root per devel-su

  • On SailfishOS before 2.2.1: version --verify # Only test for missing packages
  • On all SailfishOS versions:
    • ssu re "$(version | grep -o '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*' | sed -n '1p')" && version --dup # Jolla's "recommended" way for automatic installation of missing packages
    • Per sfos-upgrade
      sfos-upgrade "$(version | grep -o '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*' | sed -n '1p')" (or simpler since its v3.7.0: sfos-upgrade --verify) does exactly the same (ultimately per version --dup, too), but avoids the bug mentioned below to hit (and more).
    • Per zypper (install per pkcon install zypper)
      • Refresh its caches per zypper refresh
        • zypper verify --dry-run # Only test for missing packages interactively
        • zypper verify # Interactive, conditional installation of missing packages
        • zypper verify -y # Automatic installation of missing packages


Notes:

  • Take care not to be affected by the "ssu re differs from version"-bug when performing any of the checks above (except sfos-upgrade).
  • Do not use the rpm command line utility to perform general package management (especially complex dependency resolution, because its dependency resolver is less sophisticated than libzypp's, which is used by pkcon, zypper, version --dup etc.) on SailfishOS or MeeGo.
    Side note: It is still very useful to perform query actions per rpm -q, though.
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
6 followers

Stats

Asked: 2015-10-29 09:08:35 +0200

Seen: 1,071 times

Last updated: Apr 14 '20