RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 879375 - # yum install /usr/bin/netstat .. does not work
Summary: # yum install /usr/bin/netstat .. does not work
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-22 17:39 UTC by Richard W.M. Jones
Modified: 2014-01-21 06:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-30 16:56:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2012-11-22 17:39:29 UTC
Description of problem:

$ sudo yum install /usr/bin/netstat
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No package /usr/bin/netstat available.
Error: Nothing to do

However:

$ sudo yum install net-tools
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.2.20121106git.el7 will be installed
--> Finished Dependency Resolution
[...]

$ which netstat
/usr/bin/netstat

But even after that:

$ sudo yum install /usr/sbin/netstat
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No package /usr/sbin/netstat available.
Error: Nothing to do

Version-Release number of selected component (if applicable):

yum-3.4.3-46.el7.noarch
RHEL 7.0 20121120.1

How reproducible:

100%

Steps to Reproduce:
1. See above.

Comment 1 Zdeněk Pavlas 2012-11-23 08:45:42 UTC
/usr/sbin/netstat should be included in primary.  Looks like a packaging error.  Can you query metadata?

~$ sqlite3 /var/cache/path-to-repo-with-net-tools/gen/primary_db.sqlite
sqlite> select * from files where name = '/usr/bin/netstat';
...
sqlite> select files.name from files join packages using(pkgkey) where packages.name = 'net-tools';
...

Comment 2 Richard W.M. Jones 2012-11-23 09:41:47 UTC
$ sqlite3 /var/cache/yum/x86_64/6.92Server/rhel-7.0/gen/primary_db.sqlite 
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from files where name = '/usr/bin/netstat';
sqlite> select files.name from files join packages using(pkgkey) where packages.name = 'net-tools';
/sbin/slattach
/sbin/route
/sbin/plipconfig
/sbin/nameif
/sbin/mii-tool
/sbin/mii-diag
/sbin/iptunnel
/sbin/ipmaddr
/sbin/ifconfig
/sbin/ether-wake
/sbin/arp
/bin/netstat
sqlite> select * from files where name = '/bin/netstat';
/bin/netstat|file|1084

Installing /bin/netstat works:

$ sudo yum install /bin/netstat 
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel-7.0                                                 | 3.7 kB     00:00     
rhel-7.0-optional                                        | 3.7 kB     00:00     
Package net-tools-2.0-0.2.20121106git.el7.x86_64 already installed and latest version
Nothing to do

Also:

$ ls -ld /bin
lrwxrwxrwx. 1 root root 7 Nov 22 15:40 /bin -> usr/bin

So it's something broken by UsrMove, I guess.

Interestingly, this doesn't work on Fedora 18 either.

Comment 3 Panu Matilainen 2012-11-23 09:55:06 UTC
This is indedd UsrMove braindamage:

[pmatilai@localhost tmp]$ rpm -qpl --nosignature net-tools-2.0-0.2.20121106git.fc18.x86_64.rpm |grep bin/
/bin/netstat
/sbin/arp
/sbin/ether-wake
/sbin/ifconfig
/sbin/ipmaddr
/sbin/iptunnel
/sbin/mii-diag
/sbin/mii-tool
/sbin/nameif
/sbin/plipconfig
/sbin/route
/sbin/slattach

Those are the only paths that yum will recognize for those files, although they do of course end up in /usr/bin in practise. "Fixing" this would require net-tools to install them into /usr instead, but that in turn will break any packages that have dependencies on the current /[s]bin/ paths.

Comment 4 Richard W.M. Jones 2012-11-23 12:00:30 UTC
I thought yum had been fixed somehow so that either path worked?
At least, that was my recollection ...

Comment 5 Panu Matilainen 2012-11-23 12:44:26 UTC
Nope. On rpm level symlinked paths can be interchanged for already installed packages, but for to-be-installed packages its ultimately an unsolvable issue:

On an already installed system, the other direction (specifying /bin/telnet where the actual file owned by telnet package /usr/bin/telnet) could be easily handled with realpath(), but going "backwards" is a good deal more complicated. And neither direction is "translatable" when the directories are not present on the filesystem, such as on initial installation into chroot.

Comment 6 Richard W.M. Jones 2012-11-30 17:04:37 UTC
It *is* a bug, it's just that you won't or can't fix it.


Note You need to log in before you can comment on or make changes to this bug.