You are not logged in.

#1 2017-05-21 15:06:13

dotana
Member
Registered: 2017-05-21
Posts: 6

[Solved] Which package that arch and domainname command belong to ?

Hi,

Firstly, sorry my bad English.

I installed a software and it requires arch command and domainname command. In CentOS, I can run it easily, but in Arch linux, It returned "command not found". I also searched on google how to resolve but it seemly nobody have the same problem. So how can I know which packages contain that command ? How can I find out a package if I know command only ?

Thank you.

Edit:
1. domainname command: install yp-tools
2. arch command: create a bash shell in /usr/bin/ with name "arch" and call "uname -m" inside. I also try to make an alias but it didn't work when I run my software.
3. To search package contain a command: #2

Thank you for helping me out.

Last edited by dotana (2017-05-22 00:38:15)

Offline

#2 2017-05-21 15:22:58

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [Solved] Which package that arch and domainname command belong to ?

You can search through all Arch packages like this (meaning even the ones that are not installed):

sudo pacman -Fy  # you only have to do this occasionally, not every time you want to search
pacman -Fs domainname

You can then list the files in a package like this:

pacman -Fl yp-tools

This here prints the description of the package:

pacman -Si yp-tools

I can't really find an "arch" command. There's files with that name in some packages, but none of them would install it as /usr/bin/arch. A program "domainname" is in that "yp-tools" package.

Last edited by Ropid (2017-05-21 15:24:42)

Offline

#3 2017-05-21 15:36:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,560

Re: [Solved] Which package that arch and domainname command belong to ?

"arch" used to be part of util-linux; it was deprecated upstream a decade ago and is no longer included at all.

It is part up upstream coreutils, but not installed by default and not inluded in Arch.

Use uname.

Last edited by Scimmia (2017-05-21 15:40:46)

Offline

#4 2017-05-21 16:18:43

dotana
Member
Registered: 2017-05-21
Posts: 6

Re: [Solved] Which package that arch and domainname command belong to ?

Ropid wrote:

You can search through all Arch packages like this (meaning even the ones that are not installed):

sudo pacman -Fy  # you only have to do this occasionally, not every time you want to search
pacman -Fs domainname

You can then list the files in a package like this:

pacman -Fl yp-tools

This here prints the description of the package:

pacman -Si yp-tools

I can't really find an "arch" command. There's files with that name in some packages, but none of them would install it as /usr/bin/arch. A program "domainname" is in that "yp-tools" package.


Yes, I got the same with you, domainname command in yp-tools as your reply and I also cann't search "arch" command.

Offline

#5 2017-05-21 16:21:45

dotana
Member
Registered: 2017-05-21
Posts: 6

Re: [Solved] Which package that arch and domainname command belong to ?

Scimmia wrote:

"arch" used to be part of util-linux; it was deprecated upstream a decade ago and is no longer included at all.

It is part up upstream coreutils, but not installed by default and not inluded in Arch.

Use uname.

I checked my system and both util-linux and coreutil had installed. But the "arch" command still not found.

I tested my server and found that "uname" and "arch" are 2 different command.

"uname" command return : Linux
"arch" command return: x86_64

Offline

#6 2017-05-21 16:25:36

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: [Solved] Which package that arch and domainname command belong to ?

man 1 uname wrote:

       -m, --machine
              print the machine hardware name

Offline

#7 2017-05-21 16:27:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Which package that arch and domainname command belong to ?

uname --help

Please make more of an effort to help yourself; don't expect to have your hand held here.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2017-05-21 17:12:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [Solved] Which package that arch and domainname command belong to ?

You can also use pkgfile to find out ownership:

% pkgfile domainname
extra/yp-tools

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2017-05-22 00:22:09

dotana
Member
Registered: 2017-05-21
Posts: 6

Re: [Solved] Which package that arch and domainname command belong to ?

loqs wrote:
man 1 uname wrote:

       -m, --machine
              print the machine hardware name

Oh, I forgot call help function. Thank you.

I solve my problem by creating a bash shell in /usr/bin named arch with command uname -m and it's seemly ok now.

Offline

#10 2017-05-22 00:23:22

dotana
Member
Registered: 2017-05-21
Posts: 6

Re: [Solved] Which package that arch and domainname command belong to ?

jasonwryan wrote:
uname --help

Please make more of an effort to help yourself; don't expect to have your hand held here.

OK. Thanks so much.

Offline

#11 2017-05-22 01:26:04

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [Solved] Which package that arch and domainname command belong to ?

dotana wrote:

I solve my problem by creating a bash shell in /usr/bin named arch with command uname -m and it's seemly ok now.

I'd recommend to put your file in /usr/local/bin instead of /usr/bin. This /usr/local/bin location should be in $PATH same as /usr/bin is so your program will still work. Putting the file in that other /usr/local location is not really needed here, but you will more easily find your own files if you don't mix it with locations where pacman will install things, and you will be sure that you don't clash with names used by Arch packages.

Last edited by Ropid (2017-05-22 01:26:18)

Offline

#12 2017-05-22 03:19:38

dotana
Member
Registered: 2017-05-21
Posts: 6

Re: [Solved] Which package that arch and domainname command belong to ?

Ropid wrote:
dotana wrote:

I solve my problem by creating a bash shell in /usr/bin named arch with command uname -m and it's seemly ok now.

I'd recommend to put your file in /usr/local/bin instead of /usr/bin. This /usr/local/bin location should be in $PATH same as /usr/bin is so your program will still work. Putting the file in that other /usr/local location is not really needed here, but you will more easily find your own files if you don't mix it with locations where pacman will install things, and you will be sure that you don't clash with names used by Arch packages.

Thank you for your advice. I will do it.

Offline

Board footer

Powered by FluxBB