The small linux problem thread

Yeah I installed the GNOME spin, but manually installed the XFCE desktop from the command line. It was pretty easy, but I can’t recall the exact command off the top of my head. GNOME is still sitting around if the inclination to switch back takes me.

That said, I’m not particularly married to XFCE. If KDE or GNOME has better stylus support, I’ll go ahead and switch on just that one device.

Gnome does have stylus support out of the box, but if you need to flick a switch to toggle screen compositing I think KDE is your better bet.

Fwiw since gnome version 46 there’s a toggle in dconf editor to enable variable refresh rate.

So, when you execute a command as sudo, why can’t you redirect the output to a file that which your user doesn’t have permission to write to? For example,

sudo blkid >> /root/blkid.txt

The redirection is not done by sudo (running as root) but by the shell (running as your user). In the above example you can use:

sudo blkid | sudo tee -a /root/blkid.txt >/dev/null

You can omit the redirection to /dev/null if you want to see the blkid output.

1 Like

Well the question is more like why does it work like that? I’m kinda wanting a more interesting answer than a high-level how to work around it. I already know how to do that. I used

sudo bash -c "blkid >> /root/blkid.txt" instead of tee.

Because sudo elevates the command you give it, not your whole shell session (that would be dangerous and exploitable). The redirection done by the shell is consequently not elevated.

1 Like

Here’s an excellent explanation, it’s the same underlying technicality:

2 Likes

Because it’s essentially 2 separate operations, you need to split them up mentally anytime any kind of piping is involved.

You have sudo blkid, and then separately after that >> /root/blkid.txt (which I’m hoping was just an example because writing to /root isn’t really something you wanna do), handled by the shell.

That is just how pipes work, it’s also why the example with tee requires sudo 2 separate times:
It runs sudo blkid, then takes that output and separately runs tee, which because of the target location also requires sudo.

On the other hand because of this - depending on what you do - you don’t even need sudo for the first command.

Say you have a binary in your personal .local/bin, and you want to pipe its output to a root-only location, say /etc. You can run your-binary-name | sudo tee /etc/your-file and that will also work perfectly fine, because you don’t need sudo for your own binary, only for the writing part.

1 Like

sudo (or any other command) doesn’t have any way to even know where you are redirecting its output to. Pipes and redirection are not implemented by the command (if it was, many programs wouldn’t have done the coding work to allow/support it).

1 Like

Why not? It’s just the root user’s home directory. I use it to dump stuff quite a bit. For instance, on my homelab, a backup service that I run with systemd timers compresses everything in /home down to a tarball in /root. Realistically, in this case, it was an example, as a file like that is better put in /tmp because I only use it for when I am editing /etc/fstab for side-by-side viewing and yanking in vim.

I just installed Linux Mint Cinnamon and something really bothering me is that my mouse doesn’t lock at the top right corner of screens to allow me to hit the close button like it does on windows, instead zooming past the close button to the next monitor. Is there a way to enable this or another distro that does this cause this is a dealbreaker for me.
Edit: Specifically it will lock similar to how I want it on the main monitor, but not on any of the others

Ubuntu 22.04 6.8.0-44 / 45
Set up amdgpu-dkms and rocm as per AMD instructions.
After reboot, top 10% of Monitor is flickering to white and I can’t open any programs, Ubuntu wants to make a crash report.
Doesn’t seem to be to do with rocm just amdgpu-dkms, can’t get it to work on kernel version 44 or 45 apparently these are supported.
Any suggestions?

Fixed my own problem at last -
sudo apt autoremove… had some old packages floating around.

1 Like

That’s called “edge resistance”, though more often in the context of windows, while you want mouse/cursor.

I don’t run Cinnamon so can’t direct you to to the correct option, but you should probably look through the output of dconf dump / or run dconf-editor.

compl

Man, I’m wishing I’d put this in its own thread now.

Anyway, turns out that I messed up the drive somehow and wasn’t able to recover everything on the backup drive. When I try to read certain directories, they give me an error that it couldn’t be read (OSError 61). When I google it, I get a lot of junk results. The disk is an HDD with a single XFS partition. I’d like to figure out what caused that that way I can avoid it. I think it’s because I forgot to unmount the partition before I unplugged its USB connection at one point.

I just installed Fedora Silverblue in my laptop. How does one go about toolbx again?

Specifically:

I want to install the Protonmail bridge .rpm file (and other apps).

Does anyone have any good youtube videos of it?

I have seen the official Fedora documentarion and it isnt so clear…

I haven’t used Silverblue or Toolbx but as far as I know just toolbx create and toolbx enter and then install it there?
Unless you want it on the host, in which case toolbx is no use to you.

1 Like

So its just that?

You enter the container amd make changes from there?

Do I have have to enter the container to run the things from there or is that what the export command is for?

Do these containers update by themselves?

I have a full day to learn tommorrow, barring all life interruptions… :pensive:

1 Like

You’re gonna love it, toolbox & distrobox really are the bees knees.
(I’m just assuming about toolbox lmao, never used it but it’s the same as distrobox).

QoL tip, set a custom shortcut to launch the chroot session.
I.e I’m used to launching a default terminal with super+enter so I set super+alt+enter for the default ‘distrobox enter’ hosts clone.

And any GUI apps you want in your hosts launcher yes just export them.
Easy way to get that Davinci Resolve from the AUR on any distro.

1 Like

Gonna ask here as well because in the Fedora Matrix-Channel I’m just getting answers from someone who doesn’t even know what I’m asking (bless their soul).


Is there any way for dnf history undo to use only the package name for the undo instead of the entire NEVRA identifier…?
I installed like 15 packages (+ dependencies) that I needed for some dev work a couple weeks ago (the AppImage stuff)… obviously there were updates since then and when I try to undo the transaction now it can’t find any of the RPM NEVRA

man page just mentions that “If it is not possible to undo some operations due to the current state of RPMDB, it will not undo the transaction.”, but no other alternative

history rollback doesn’t work either because that would require installing old packages, which requires the versions to still be in the repo, which… they are not anymore.

 sudo dnf history undo 69 # also: nice.
Last metadata expiration check: 3:06:31 ago on Tue 08 Oct 2024 05:02:02 CEST.
Error: The following problems occurred while running a transaction:
  Cannot find rpm nevra "gcc-14.2.1-1.fc40.x86_64".
  Cannot find rpm nevra "gcc-plugin-annobin-14.2.1-1.fc40.x86_64".
...

It’s the same for all of them because they have been updated since they were installed:

 dnf list installed gcc
Installed Packages
gcc.x86_64                                            14.2.1-3.fc40                                             @updates

I mean yeah I can dump the transaction into a text file, remove all the useless text from 250(!) package installs manually (because writing a RegEx that fits all packages would probably take me longer then that), and pipe that back into dnf remove, but… what’s the point of dnf history undo then… :confused:


Holy shit… I think I’m poppin’ a vein.

rant time:

After taking an hour to explain to them how none of their ideas make any sense, they come back at me with:

it is not working way you think it should get over it

THAT is just next level rude.

Don’t get me wrong, I appreciate when people try to help. But when they very clearly know less about the issue then I do (because I already did my research), I’m just explaining to them why their ideas won’t work because they run into the exact issue I’m already having. When it takes them an hour of back and forth to come to the exact same conclusion I was at in my very first message, I get a little frustrated…

I knew from their first message that they had no idea what I was even asking, and I still took the time to explain it to them so they could learn as well, and that’s what I get.

Anyway… /rant

2 Likes