L11: ifconfig not found && command-not-found

Hello,
I received my L11 yesterday and have the first issues (@joao.azevedo):

purism@pureos:~$ ifconfig -a
Could not find command-not-found database. Run 'sudo apt update' to populate it.
ifconfig: command not found
purism@pureos:~$ sudo apt install --reinstall command-not-found
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 55.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://repo.pureos.net/pureos crimson/main all command-not-found all 23.04.0-1 [55.2 kB]
Fetched 55.2 kB in 7s (8481 B/s)
(Reading database ... 110927 files and directories currently installed.)
Preparing to unpack .../command-not-found_23.04.0-1_all.deb ...
Unpacking command-not-found (23.04.0-1) over (23.04.0-1) ...
Setting up command-not-found (23.04.0-1) ...
Processing triggers for man-db (2.11.2-2) ...
purism@pureos:~$ ls -l /var/lib/command-not-found/
total 0

How could I get the command ifconfig?

Try this:

apt install net-tools
2 Likes

Thanks. This solved the ifconfig part of my question, which was the more important part. I looked first in my L5, where ifconfigwas available and not part of any pkg as dpkg -S /usr/sbin/ifconfig says. Why I have to install something in the L11 to get it?

1 Like

I’d suggest getting familiar with the ip command, as ifconfig is kindof deprecated in today’s Linux world…

2 Likes

I’ve been trying to do that whenever I get a new computer, but the man page isn’t very helpful for my initial use case, figuring out the various interface names. So I install net-tools to use ifconfig to get the information I need. So the next time I can’t figure out the ip command I need, I fall back to ifconfig. Then I get into the habit going straight to ifconfig. I miss the good old days of eth0, usb0, etc., although I uderstand why they have gone away. What I really miss is the Sun device naming conventions which were both easy, predictable, and did not shift around with reboots.

As far as I can tell, ifconfig is part of the net-tools package also on L5. I ran sudo apt remove net-tools and after that the ifconfig command is gone. I don’t know why dpkg -S /usr/sbin/ifconfig does not show it when the package is installed, maybe the package metadata for that package is incomplete or something.

This has been happening to me on a number of commands. I’ve just been pushed over the edge to dig into it.

I’ve become used to things like this happening when say blahblahblah is a symbolic link to /etc/alternative/blahblahblah but that is not the case here.

It turns out that for debian 11 bullseye dpkg considers the file to be /sbin/ifconfig but /sbin is a symbolic link to /usr/sbin

dpkg -S /usr/sbin/ifconfig
dpkg-query: no path found matching pattern /usr/sbin/ifconfig

dpkg -S /sbin/ifconfig
net-tools: /sbin/ifconfig

4 Likes