The small linux problem thread

I tend to reach for awk for these tasks. (No need for grep, and awk’s searching is more flexible, f.ex. awk '/search-string/ && $2 > 42'). In this case, it is helpful:

$ awk '/^\d/'
awk: cmd. line:1: warning: regexp escape sequence `\d' is not a known regexp operator
1 Like

Yeah, I usually use awk’s search too, just that I wasn’t thinking very straight at the time. I solved it all with just a sed later.

1 Like

I am running into an issue with the add-apt-repository command failing, it gives an error saying it timed out.

TimeoutError: [Errno 110] Connection timed out

A quick google found two other posts (source and source) with related issues, but none had a solution.

Does anyone know why this might be an issue? If not, how would I go about manually adding these PPAs to my system? If it matters, I am trying to add the ondrej/php ppa.

EDIT:

Figured it out. Was a problem with my computer trying to use IPv6, which isn’t set up. This fixed it:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
2 Likes

You can configure IPv4 to be the default path instead of killing IPv6

Also, to (officially) manually add apt sources:
https://help.ubuntu.com/stable/ubuntu-help/addremove-sources.html

1 Like

TBH, I don’t fully understand Wendell’s ramble post xD, but do you think this will accomplish what I am trying to do.

Not certain this will work, but I am trying to give Wireguard peers access to the LAN. If this isn’t what I am supposed to do using Wendel’s guide, what is? Also, the top rule is one Tom made on the Lawrence Systems video.

Update:
So it doesn’t seem to work. Also, there’s a lot of stuff in Wendel’s guide that thankfully doesn’t apply to me. I am a new Google Fiber subscriber (Hallelujah!), so I don’t have to worry about carrier-grade NAT or even Dynamic DNS because the IP address going to my fiber box / router is permanent! Everything else behind my LAN, though, doesn’t get a true public IP. I think this is called True NAT. There’s a lot of networking terms that are very jargony to me still.

I figured it out! Disregard my previous post.

1 Like

Actually, I have discovered that there is a problem on my laptop. When I said I figured it out, it is because I connected to my cellular data using my phone and tried to navigate to the pfsense web portal. That worked. Yet, now I have discovered that it doesn’t work on my Linux-powered laptop.

Follow-up on how I solved this problem (accidentally installing one os as EFI and one as legacy for dual boot).

We anyway decided to reinstall Windows 10 in UEFI mode, to make everything proper feng shui. After that we realized that Pop!_OS seemed to fit my wife’s workflow better than Ubuntu, so we ended up reinstalling Linux too (of course after turning off CSM in CMOS, to avoid any more non-EFI shenanigans).

Funnily however, when installing Pop after Windows, systemd-boot somehow wiped the EFI partition on the Windows drive. This is the kind of thing that the Windows installer used to do to Linux disks, I never expected it the other way around!

I had to reinstall the boot files for Windows afterwards, googling myself to the procedure. But now everything should be fine.

Understanding Flatpak?

Here I am again with not a technical problem, rather an “understanding” problem. I’m trying out Flatpak as a method to install those fringe programs that for various reasons refuse to live in the regular distro repositories. One of those is Signal-desktop on Debian-based distros.

On a fairly freshly installed Debian 11, I installed Flatpak from the apt repositories. Then I followed the instructions on Flathub to install Signal-Desktop. All look good, however it pulled in a bunch of dependencies:

root@host # flatpak install flathub org.signal.Signal
...
        ID                                            Branch Op Remote  Download
 1. [✓] org.freedesktop.Platform.GL.default           21.08  i  flathub 130.1 MB / 129.8 MB
 2. [✓] org.freedesktop.Platform.GL.nvidia-470-129-06 1.4    i  flathub 273.4 MB / 273.0 MB
 3. [✓] org.freedesktop.Platform.Locale               21.08  i  flathub  17.7 kB / 325.8 MB
 4. [✓] org.freedesktop.Platform.openh264             2.0    i  flathub   1.8 MB / 1.5 MB
 5. [✓] org.freedesktop.Platform                      21.08  i  flathub 224.5 MB / 200.4 MB
 6. [✓] org.signal.Signal                             stable i  flathub 154.2 MB / 156.3 MB

Warning: Not exporting file org.signal.Signal.appdata.xml of unsupported type.
Installation complete.

(the warning looks harmless according to a quick search, and the app works)

My question

Some of these deps look like things that could exist in the debian repositories too (though I haven’t verified this). Anyways they were taken as flatpaks. Is this simply because Flatpak needs to be a self-contained ecosystem in parallel with that based on the distro’s packaging system (in this case apt), or is there a way to integrate them and make Flatpak use deps from apt if possible?

I would prefer to have as much as possible in the distro’s preferred software catalog, and use things like Flatpak only for the out-of-the-ordinary stuff.

Essentially, yes.

No. Keep in mind that not only is it part of the ecosystem and concept, but the deps in the Flatpak repo are likely also a different version then what the distros repo provides (especially on Debian).

1 Like

Yeah I can see why it needs to work this way to avoid complexity issues down the road. Thanks for clearing it up!

Are you sure that it wiped the partition on the MS Windows drive? It would only do this if you are using one drive and dual booting.

More than likely, the EFI variables were overwritten and now point to the Pop drive. You should be able to verify this in the uEFI boot section of the CMOS/BIOS.

**Edit
My x13 Gen 3 just came in with Win 11 on it. I currently do not have the other drive to install Arch or DragonFly. I will be going through this process and can make a write up if I experience the same issue as you.

2 Likes

This is what I thought too, but the boot selector in CMOS did not list the drive at all. It usually lists both something like Windows 10 loader on (drive id) and simply (drive id), and I can usually select either. Now none of them were there.

So I booted into cmd from the Windows installer usb, inspected the partitions on the Win drive, and found a 500Mb partition that was empty. I installed the Windows EFI boot files to that one. Then the drive started showing up in CMOS and was bootable.

Now that I’m thinking of it, I see one other possibility. Perhaps there was also a “bootable” flag that was missing. Possibly, the boot files were intact and placed somewhere else, but the partition was not set as bootable (if bootable flags are at all a thing in EFI boot contexts?). Either way, something must have happened to the Windows drive while installing Pop on another drive.

I was too unprepared for this to track exactly what I did and what was happening, but if you try and find out something, do let us know!

1 Like

I hate installers insisting on installing a boot loader. Perhaps be the default for newbies, or they’ll easily get a system that won’t boot, but there should always be an easily accessible way to say the computer already has a perfectly good boot loader, thank you, leave it alone.

1 Like

the linux boot loader should be on the linux drive.
the windows loader should be on your windows install drive.
the two should never meet.
you then set grub as your default boot loader in bios/uefi.
after reboot you will be able to boot into windows or linux.
if you leave windows as the default bootloader you only get a windows boot.
if you install linux after windows make sure you dont over write the windows boot loader. it must go on the drive your installing to…
if its a partitioned drive then install to the partition you installed linux on not the main windows boot partition.

2 Likes

Exactly, this is what I always did with Grub. Assumed it would be straightforward with Systemd-boot too, and maybe it is, but if so I didn’t find the way yet…

1 Like

Since you are a veteran from the old days, I guess from now on, take the other drive out when installing any OS so that they do not nuke each other? I have not had this issue since the early 2000s but who is to say that it is not coming back in style.

2 Likes

Advanced options in the installer. They usually come with instructions like, “Know what you are doing from this point”. Install EFI-stub, systemd-boot and what ever the other non-grub boot loader is and they will just setup EFI variables and will not touch the other drives.

Grub is quite nice to be able to get into drives after a failed upgrade and what not though. Still, you can manually install grub and point it to the drive that you want it to install do. Just make sure you are using a uEFI enabled version of grub2

Yes, that’s what I do, to its own btrfs subvolume. Before btrfs, it had its own partition. I used to get failed boots after some install updated or the grub rescue prompt, and after making grub independent those troubles were banished.

I don’t know why people who dual-boot on a single drive don’t think to buy a USB thumb drive, or a SD card and place their bootloader, /boot partition and maybe /boot/efi partition if applicable there. Keep the motherboard’s 1st boot to USB and 2nd to internal drive. You plug the USB, you boot into Linux. You unplug it, you boot to Windows. Easy as that.

The /boot partition rarely gets written to, so you’re mostly doing reads, so anyone should be fine with /boot on a USB stick. Heck, my old workplace’s HP ProLiant MicroServers Gen 8 and 10 were incapable of booting from anything other than an internal SD card slot and the USB ports. Don’t even get me started about that.

Bonus point for using a full-sized SD card as your boot partition on your PC: you can make the card read-only, so even if you somehow manage to boot into windows with it plugged in, it will not get overwritten by Windows updates. But then you would have to unmount your /boot partition, unplug it, set the SD to write-mode, plug it back in, mount it, then do updates to your Linux system. Well, you don’t have to do that for all updates, just for kernel or bootloader updates, so that either grub gets a new version, or your kernel gets updated and your system needs to regenerate the initramfs and place your new kernel image in the boot drive.

Bonus bonus: you can’t boot to your Linux system without that SD or USB, so if your partition is encrypted, nobody can access it. You need both the encryption key and your boot drive.

2 Likes