1

On my Ubuntu 14.04.2, what-source returns two times the package name for some packages, e.g.

~$ what-source openssl
openssl
openssl

or

~$ what-source firefox
firefox
firefox

Is this normal behavior?

The example from the manual here returns only one (same for my machine: only one name returned):

~$ what-source sl
sl

What is going on?

1 Answer 1

2

As the manpage says, what-source is a simple wrapper for apt-cache show | grep. The actual code is:

#!/bin/sh
# [....]
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

apt-cache show "$1" | grep "^Filename:" | sed -e "s:\(.*\)/\(.*\)/\(.*\)/\(.*\)/.*:\4:"

apt-cache show will show the description for each version of the software available in the repositories. For example:

$ apt-cache policy firefox
firefox:
  Installed: 38.0+build3-0ubuntu0.14.04.1
  Candidate: 38.0+build3-0ubuntu0.14.04.1
  Version table:
 *** 38.0+build3-0ubuntu0.14.04.1 0
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty-security/main amd64 Packages
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     28.0+build2-0ubuntu2 0
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty/main amd64 Packages

There are two versions available in three repositories, and apt-cache will show descriptions of these two versions:

$ apt-cache show firefox | grep -i -e version -e filename
Version: 38.0+build3-0ubuntu0.14.04.1
Filename: pool/main/f/firefox/firefox_38.0+build3-0ubuntu0.14.04.1_amd64.deb
Version: 28.0+build2-0ubuntu2
Filename: pool/main/f/firefox/firefox_28.0+build2-0ubuntu2_amd64.deb

So, yes, the behaviour is perfectly normal.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .