Welcome to the Linux Foundation Forum!

7.6. DPKG Queries example "-p"

jengel
jengel Posts: 41

Using the LFCS Ubuntu 16-04 image when I execute the example "dpkg -p wget" I get:

 


student@ubuntu:~$ dpkg -p wget dpkg-query: package 'wget' is not available Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their contents.

 

using "apt-cache show wget" I get the expected result.

Checking in my own installations it looks like there is a difference between 14.04 and 16.04.

Checking man:


-p, --print-avail package-name... Display details about package-name, as found in /var/lib/dpkg/available. Users of APT-based frontends should use apt-cache show package-name instead.

 

So I can see what is going on, but don't understand it or understand why it is so. Can anyone clarify this for me, please?



Finally, a suggestion to admin to consider this discrepancy and adjust the course material accordingly.

PS.  "dpkg -V wget_1.17.1-1ubuntu1_amd64.deb " also fail, I assume for the same reason.

Comments

  • Hi,

    This is the key:

    dpkg-query: package 'wget' is not available

    So, you need to check if 'wget' is installed or not, or broken. So then fix it (do I need to install it?) and try again.

    Regards,

    Luis.

     

     

  • jengel
    jengel Posts: 41
    edited October 2017

    Hi Luis,

    No, wget is installed. Point is in 16.04 it would seem it is not installed with dpkg but with apt. In that case "-p" won't work, as confirmed in the documentation. "-s" will correctly show installation status as shown below. The course material probably was created with earlier versions and work fine if you do this on e.g. 14.04.

    I'd suggest the course material maybe choose another application to demonstrate the "-p". Actually, it may be better this fact is called out in the course so people understand what is going on i.e. "-p" only work if dpkg was used in the first place to install something, which I guess is not many applications nowadays.


    student@ubuntu:~$ dpkg-query -s wget Package: wget Status: install ok installed

    student@ubuntu:~$ dpkg-query -p wget dpkg-query: package 'wget' is not available

     

  • luisviveropena
    luisviveropena Posts: 1,215
    edited October 2017

    Hi Jengel,

    I did the test and I got it, so 'dpkg -p <package_name>' is not working on Ubuntu 16.04, but '-s' is (and it's working on 14.04).

    We'll check on this and will let you know.

    Thanks for reporting it!

    Luis.

  • Gald I'm not the only one running into this problem!

  • luisviveropena
    luisviveropena Posts: 1,215
    edited November 2017

    Yeah, some very specific things changes (or even fails) from one distro version to another, so don't worry, we are working on this.

    Regards,

    Luis.

Categories

Upcoming Training