Removing netplan.io causes no immediate effects (network still works), but the next time the server is restarted, there is no network. That means netplan.io is responsible for some aspect of configuration (obviously), and the OS is able to use the network, if it's properly configured.
I have tried these steps to attempt to manually bring up the network without netplan.io:
ifconfig eth0 upbrings some semblence of IPv6 up, but no IPv4. No network access.dhclient eth0(after #1) hangs forever, i.e. does nothing.- The
ifupcommand does not exist. - The
/etc/network/interfacesfile does not exist.
Here is the configuration I am able to extract from netplan get while it is installed:
network:
version: 2
ethernets:
eth0:
addresses:
- "<censored>/24"
gateway4: <censored>
It looks extremely basic but I somehow can't find out how to apply it without netplan.io.
My end goal is to get network working without netplan.io installed, and automatically on system startup. I cannot find any packages to try installing in order to facilitate this. I can only find guides on how to edit /etc/network/interfaces, but that isn't applicable here. On top of that, apt-file cannot find any package that contains that file, so I can't even make it applicable.
How do I keep ethernet working without netplan.io?
EDIT: I finally found a sequence of commands that properly configures the network:
ifconfig eth0 <address> netmask 255.255.255.0
route add default gw <gateway4> eth0
ifconfig eth0 up
DNS name resolution even works too! Now just to find a way to perform this automatically on boot... maybe an @reboot cron job, but that feels hacky...
ifupdownand get rid ofNetworkManager(if installed).ifupdownis the old way of using the/etc/network/interfacesfile for your network. – Terrance Apr 13 '22 at 13:00aptever required python, you may be thinking of thecommand-not-foundhook. I just testedapt updateandapt upgradeand both work fine. So does other package management like adding/removing packages. Note that uninstallingpython3also uninstalled all its dependents and I manually reviewed that list, which only containednetplan.ioandufw(and python3 libs). Not sure who downvoted but I don't think it was deserved. – Dev Apr 13 '22 at 20:19ubuntu-minimalpackage still includes Python (3) by default as well as a bunch of other packages that depend on it (https://askubuntu.com/a/1259446). But that doesn't change the fact that this system seems to run fine without it. Note that it was heavily stripped by the hosting provider to use around 30MB of RAM at idle, so a lot of those packages that depended on Python were clearly unnecessary for actual server operation. From memory (unsourced now, sorry), Ubuntu used to require Python 2 for some things, but doesn't anymore. – Dev Apr 13 '22 at 20:34ifupdownand get away with using the/etc/network/interfacesfile. If all you wanted to replace netplan, then why did you start off your question with trying to remove Python? – Terrance Apr 13 '22 at 20:44