I'm looking for the tool (dpkg ?) and command line parameters, that will
give me the package (name and version), a file on my HD belongs to.
Something like :
dpkg --search | grep /usr/bin/nedit ??
Result : nedit_1.5.5-2ubuntu3.deb
Thank you. Francois
--
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-17-2009, 08:56 PM
Ansgar Burchardt
which package a file belongs to
Hi,
frmas <frmas@free.fr> writes:
> I'm looking for the tool (dpkg ?) and command line parameters, that will
> give me the package (name and version), a file on my HD belongs to.
> Something like :
> dpkg --search | grep /usr/bin/nedit ??
>
> Result : nedit_1.5.5-2ubuntu3.deb
The command `dpkg -S /usr/bin/nedit' will tell you the package name and
then you can use `dpkg -l [package]' to get the installed version.
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-17-2009, 08:57 PM
Charlie Kravetz
which package a file belongs to
On Sat, 17 Jan 2009 22:47:10 +0100
frmas <frmas@free.fr> wrote:
> Hello,
>
> I'm looking for the tool (dpkg ?) and command line parameters, that
> will give me the package (name and version), a file on my HD belongs
> to. Something like :
> dpkg --search | grep /usr/bin/nedit ??
>
> Result : nedit_1.5.5-2ubuntu3.deb
>
> Thank you. Francois
I don't know if this is what you want, but try
apt-cache policy nedit
in a terminal.
Good luck,
--
Charlie Kravetz
Linux Registered User Number 425914 [http://counter.li.org/]
Never let anyone steal your DREAM. [http://keepingdreams.com]
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-17-2009, 09:11 PM
Mario Vukelic
which package a file belongs to
On Sat, 2009-01-17 at 22:47 +0100, frmas wrote:
>
> I'm looking for the tool (dpkg ?) and command line parameters, that
> will
> give me the package (name and version), a file on my HD belongs to.
dpkg -S <package>
See the man page of dpkg for details.
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 08:48 AM
Mario Vukelic
which package a file belongs to
On Sat, 2009-01-17 at 23:11 +0100, Mario Vukelic wrote:
> dpkg -S <package>
Um no, it is of course "dpkg -S <file>", as Ansgar wrote in the other
reply.
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 09:11 AM
frmas
which package a file belongs to
Ansgar Burchardt a écrit :
>> I'm looking for the tool (dpkg ?) and command line parameters, that will
>> give me the package (name and version), a file on my HD belongs to.
>> Something like :
>> dpkg --search | grep /usr/bin/nedit ??
>>
>> Result : nedit_1.5.5-2ubuntu3.deb
>
> The command `dpkg -S /usr/bin/nedit' will tell you the package name and
> then you can use `dpkg -l [package]' to get the installed version.
yes, that could do the trick.
I've tried to optimize that, but I failed. I don't know how to get rid
of those little ":" at the end of the name. This is my command line :
dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
but awk returns "nedit:" ;-(
I do not know how to remove those ":".... Francois
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 10:16 AM
Matthew Flaschen
which package a file belongs to
frmas wrote:
> Ansgar Burchardt a écrit :
>>> I'm looking for the tool (dpkg ?) and command line parameters, that will
>>> give me the package (name and version), a file on my HD belongs to.
>>> Something like :
>>> dpkg --search | grep /usr/bin/nedit ??
>>>
>>> Result : nedit_1.5.5-2ubuntu3.deb
>> The command `dpkg -S /usr/bin/nedit' will tell you the package name and
>> then you can use `dpkg -l [package]' to get the installed version.
>
> yes, that could do the trick.
> I've tried to optimize that, but I failed. I don't know how to get rid
> of those little ":" at the end of the name. This is my command line :
> dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
dpkg -l `dpkg -S /usr/bin/nedit|sed s/:.*//`
Matt Flaschen
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 10:26 AM
Nils Kassube
which package a file belongs to
frmas wrote:
> I've tried to optimize that, but I failed. I don't know how to get rid
> of those little ":" at the end of the name. This is my command line :
> dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
> but awk returns "nedit:" ;-(
> I do not know how to remove those ":".... Francois
How about this?
dpkg -S /usr/bin/nedit|dpkg -l $(cut -f1 -d':')
Nils
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 10:31 AM
Matthew Flaschen
which package a file belongs to
Nils Kassube wrote:
> frmas wrote:
>> I've tried to optimize that, but I failed. I don't know how to get rid
>> of those little ":" at the end of the name. This is my command line :
>> dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
>> but awk returns "nedit:" ;-(
>> I do not know how to remove those ":".... Francois
>
> How about this?
>
> dpkg -S /usr/bin/nedit|dpkg -l $(cut -f1 -d':')
Doesn't work. But:
dpkg -l `dpkg -S /usr/bin/nedit|cut -f1 -d':'`
would.
Matt Flaschen
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
01-18-2009, 10:58 AM
frmas
which package a file belongs to
Matthew Flaschen a écrit :
> Nils Kassube wrote:
>> frmas wrote:
>>> I've tried to optimize that, but I failed. I don't know how to get rid
>>> of those little ":" at the end of the name. This is my command line :
>>> dpkg -S /usr/bin/nedit | dpkg -l `awk '{print $1}'`
>>> but awk returns "nedit:" ;-(
>>> I do not know how to remove those ":".... Francois
>> How about this?
>>
>> dpkg -S /usr/bin/nedit|dpkg -l $(cut -f1 -d':')
>
> Doesn't work. But:
>
> dpkg -l `dpkg -S /usr/bin/nedit|cut -f1 -d':'`
Thank you to all of you. Time to share my work. From your posts, I wrote
that litte script I placed in my /usr/local/bin directory. That way I
can run it against a file without all the stuff to type (and remember)
each time :-)
This is it. Save it, chmod to 755 and voila. I would be pleased if some
of you could improve it.
>----------------------cut here --------------------------------
#!/bin/bash
startScript() {
case $1 in
--{$1} | -{$1})
TYPE="itsok"
;;
--help | -help | -H | --H | -h | --h)
echo ""
echo "Usage: "$0 --file_searched" - file_searched
as to be replaced with the path and name file."
echo ""
exit;;
*)
esac
if [[ $1 = "" ]] ; then
clear
echo "*************Warning***Warning***Warning********* ****"
echo "* *"
echo "* Run that script with a parameter as : *"
echo "* "paquet /usr/bin/nedit" *"
echo "* *"
echo "***Warning*************Warning*************Warnin g***"
exit 1
else
clear
echo ""
clear
echo "."
read -t 1
clear
echo ".."
read -t 1
clear
echo "..."
fi
}
startScript $1
dpkg -l `dpkg -S $1|sed s/:.*//`
exit
>----------------------cut here --------------------------------
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users