Bug 349038

Summary: Ark should offer a solution when some packages are not found
Product: [Applications] ark Reporter: kono93 <kochnorman>
Component: generalAssignee: Raphael Kubo da Costa <rakuco>
Status: RESOLVED DUPLICATE    
Severity: minor CC: elvis.angelaccio
Priority: NOR    
Version First Reported In: 2.18   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description kono93 2015-06-11 18:26:40 UTC
I wanted to compress some files in dolphin to a rar-files and went to right click -> compress -> "to rar-file". I did not have the package "rar" installed (why then does Dolphin show this? It should be possible to check for that) and Ark opened with the message "Failed to locate program rar in PATH.". When I installed this, it worked fine, but the problem is: I am an advanced user. Normal users would be challenged by this. 

There should be a message like "Failed to locate program rar in PATH. Install it with sudo apt-get install rar" or even better: "Failed to locate program rar in PATH. Do you want the package to be installed?". This would greatly improve a normal user's experience. I believe there should be a normalized way of doing those kinds of installations, though this is the first time I experienced this.

Reproducible: Always

Steps to Reproduce:
1. Use a system without rar installed
2. Try to compress files to rar with the dolphin "compress"-menu

Actual Results:  
A message popped up telling me "Failed to locate program rar in PATH"

Expected Results:  
It should tell me how I install rar or even better ask me if this should be installed for my automatically.
Comment 1 kono93 2015-06-11 18:38:58 UTC
Such an easy script could do the job generally (at least kind of, some improvements are still needed of course).

#!/usr/bin/perl

use strict;
use warnings;

unless (qx(whereis apt-cache)) {
        warn "Cannot use apt-cache\n";
        exit 0;
}

my $this_program = shift;
exit 1 unless $this_program;
$this_program =~ s/[^\w\d-]//g;
my $apt_cache = qx(apt-cache search "^$this_program\$");
if($apt_cache) {
        warn "$this_program found!\n";
        exit 2;
}

warn "$this_program not found.\n";
exit 3;
Comment 2 Elvis Angelaccio 2015-10-20 15:30:14 UTC
How do you suggest to handle all the different package managers that are around? I do agree that the rar service menu should not be displayed if rar is not installed, though. In that case a novice user would just choose tar or zip and would not even notice that rar is not installed.
Comment 3 Elvis Angelaccio 2015-10-25 22:46:52 UTC
BTW, there is already a similar report.

*** This bug has been marked as a duplicate of bug 232856 ***