bug in

If none of the more specific forums is the right place to ask

bug in

Postby rayandrews » 2018-02-20 21:40

Code: Select all
$ aptitude why "libreoffice" && echo "\n\n installed"
i   libenchant1c2a Depends  aspell-en | myspell-dictionary | aspell-dictionary |
                             ispell-dictionary | hunspell-dictionary           
p   myspell-hu     Provides myspell-dictionary                                 
p   myspell-hu     Suggests libreoffice                                         


installed

$ dpkg -V libreoffice
dpkg: package 'libreoffice' is not installed

$ aptitude why "librecad" && echo installed
Not currently installed
The candidate version 2.1.2-1+b1 has priority optional
No dependencies require to install librecad


I've only seen this with the one package: libreoffice, but 'aptitude' is getting it wrong.
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby Head_on_a_Stick » 2018-02-20 21:41

ESTRAGON: We always find something, eh, Didi, to give us the impression we exist?
VLADIMIR (impatiently): Yes, yes, we're magicians.
User avatar
Head_on_a_Stick
 
Posts: 7893
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: bug in

Postby rayandrews » 2018-02-21 02:19

I've done that a few times with not even a trace of reply that the thing was even read. I'm a bit discouraged, I though I'd just report it here and if anyone in the loop is interested they can follow up on it.
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby bw123 » 2018-02-21 05:44

I don't get it, but I got it too, what's the bug?

Code: Select all
$ aptitude why "gnome-core" && echo "\n\n installed"
i   task-desktop       Recommends task-gnome-desktop | task-xfce-desktop | task-kde-d
                                  esktop | task-lxde-desktop | task-cinnamon-desktop
                                  | task-mate-desktop | task-lxqt-desktop           
p   task-gnome-desktop Depends    gnome-core                                         
\n\n installed
$ dpkg -V gnome-core
dpkg: package 'gnome-core' is not installed
$ aptitude why "gnome-disk-utility" && echo installed
i   task-desktop       Recommends task-gnome-desktop | task-xfce-desktop | task-kde-d
                                  esktop | task-lxde-desktop | task-cinnamon-desktop
                                  | task-mate-desktop | task-lxqt-desktop           
p   task-gnome-desktop Depends    gnome-core                                         
p   gnome-core         Depends    gnome-disk-utility (>= 3.22)                       
installed
$ dpkg -V gnome-disk-utility
dpkg: package 'gnome-disk-utility' is not installed
$ echo $SHELL
/bin/bash

User avatar
bw123
 
Posts: 3276
Joined: 2011-05-09 06:02
Location: TN_USA

Re: bug in

Postby dilberts_left_nut » 2018-02-21 06:01

The "bug" is in your expectations of the output from your command.

From 'man aptitude' (why, why-not)
This command returns 0 if successful, 1 if no explanation could be constructed, and -1 if an error occurred.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4867
Joined: 2009-10-05 07:54
Location: enzed

Re: bug in

Postby rayandrews » 2018-02-21 16:12

Code: Select all
$ aptitude why libreoffice; echo $?
i   libenchant1c2a Depends  aspell-en | myspell-dictionary | aspell-dictionary |
...
0

$ aptitude why librecad; echo $?
Not currently installed
...
1

$ aptitude why grep; echo $?
i   hibernate    Suggests   xscreensaver | kscreensaver | gnome-screensaver | xl
...
0


Neither librecad nor libreoffice are installed on my system, and 'dpkg -V' correctly reports that fact, but 'aptitude' returns '1' for 'librecad', which is not installed and '0' for both 'grep', which is installed, and 'libreoffice' which is not installed. Surely that is not helpful?

BTW how would we say that 'no explanation can be constructed' when aptitude correctly reports that librecad is "Not currently installed"?? It sounds like an explanation to me: librecad isn't installed, no?
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby bw123 » 2018-02-21 16:49

These kinds of threads pop up now and then on the forum, and on debian-user list. Sometimes they go on and on, and I find them kind of interesting, especially if they explain the documentation better. They sometimes end up in a long drawn out argument though, and that's no fun.

If there's a bug in an app, or in the documentation it should be reported and corrected. So what's the bug?
User avatar
bw123
 
Posts: 3276
Joined: 2011-05-09 06:02
Location: TN_USA

Re: bug in

Postby rayandrews » 2018-02-21 19:08

The bug IMHO is that aptitude should report libreoffice as uninstalled just as dpkg -V does and which is in fact the truth. So far every other uninstalled package I've tried is reported as uninstalled by aptitude, with this one exception. This could be a bug in aptitude but since this only happens on this one occasion (so far) I'm inclined to think there's some issue with the libreoffice package such that whatever aptitude does to determine install status does not work on this one occasion. dpkg must use some other test, cuz dpkg gets it right. Again, I suspect some glitch in the libreoffice package, tho again since dpkg gets it right, it could be a problem within aptitude itself (heck, maybe dpkg would get it wrong on some other package that aptitude reports correctly.)
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby dilberts_left_nut » 2018-02-22 01:33

But you're not asking aptitude whether a package is installed or not, your asking if it can find a reason to install it, and it's return code for this function is as per the man page - YOU are basing your 'echo installed' output on an incorrect assumption.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4867
Joined: 2009-10-05 07:54
Location: enzed

Re: bug in

Postby rayandrews » 2018-02-22 15:35

Yet it does report that librecad is not installed, why should it be different for libreoffice? Nevermind, if no one is interested in this, or if you want to not see the problem then you will not see it. I did my duty reporting it. I have a script that needs to check on install status of packages, I'll just use 'dpkg -V' that seems to work every time.
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby dilberts_left_nut » 2018-02-22 18:01

What?
If you're just checking installed status, why are you using 'aptitude why'?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4867
Joined: 2009-10-05 07:54
Location: enzed

Re: bug in

Postby ticojohn » 2018-02-22 18:46

rayandrews wrote:Yet it does report that librecad is not installed, why should it be different for libreoffice? Nevermind, if no one is interested in this, or if you want to not see the problem then you will not see it. I did my duty reporting it. I have a script that needs to check on install status of packages, I'll just use 'dpkg -V' that seems to work every time.

Excuse me Ray, but this is a help forum. If you feel there is a bug then report it to the developers, that would be your duty. Don't rave at people that answer your question but you don't seem to want to listen to their response.
I'm not irrational, I'm just quantum probabilistic.
User avatar
ticojohn
 
Posts: 801
Joined: 2009-08-29 18:10
Location: Costa Rica

Re: bug in

Postby rayandrews » 2018-02-22 23:51

Sometimes a bug is not really a bug, so the first step is just to ask if it IS a bug. Since no one here agrees that it is a bug I figger I'll just drop it. BTW how you you check install status? There's several methods of course, which is best? I like 'aptitude why' because it gives three statuses: installed, uninstalled, or no such package.

Oh, and I don't mean to rant. I just find it puzzling that this ONE exception to otherwise predictable behavior would not be seen as a bug.
rayandrews
 
Posts: 44
Joined: 2014-01-31 21:32

Re: bug in

Postby sunrat » 2018-02-23 01:20

rayandrews wrote:BTW how you you check install status? There's several methods of course, which is best? I like 'aptitude why' because it gives three statuses: installed, uninstalled, or no such package.

Code: Select all
apt policy <packagename>
will give you that info.
Code: Select all
dpkg -l |grep <packagename>

is good for searching installed packages
Code: Select all
apt search <something>
will take a fuzzy description or packagename and show what is available.

*note I used Sid to check these commands. Stretch may still use apt-cache for search and policy* Not checking that right now. ;)

Indeed there are several methods, depending on what result you want.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2428
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: bug in

Postby dilberts_left_nut » 2018-02-23 04:00

Or 'aptitude show <package>' and grepping for the status field.

The problem with your original approach is that 'aptitude why' isn't really interested if it's installed or not, only in analyzing current state of the dependency chains related to it.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4867
Joined: 2009-10-05 07:54
Location: enzed

Next

Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable