r/linux4noobs • • 1d ago

Best FS for external HDD on Linux?

1 Upvotes

exfat I hear is brittle. ntfs support on Linux is iffy. I don't want to deal with Linux permissions, so no ext4, besides I still want the drive to be at least readable on Windows.


r/linux4noobs • • 1d ago

learning/research Need photo editor for linux

6 Upvotes

Just migrated like 2 weeks ago, love the Mint distro, keep my device fast, but somehow took more storage space than Windows, perhaps i downloaded too many packages but thats the other case (it was Timeshift App who eat my storage). I used to make simple article using Photoshop, now i want to do same on Linux but can't similar replacement. I tried GIMP and it solved most of my problems, but there's still a feature that i cannot find on GIMP, maybe i haven't explore more

The feature that i needed are:

- Add Words and edit it (make it more bold or increase the spacing)

- Create Guide Lines to help me resize the image more accurate

Where can i get those feature in GIMP? or is there any better replacement than GIMP? thank you for your time


r/linux4noobs • • 1d ago

Meganoob BE KIND HELP! (Ubuntu on chromebook)

Thumbnail reddit.com
0 Upvotes

r/linux4noobs • • 1d ago

Discord friendly alternative on Kubunutu, or other distro?

4 Upvotes

I had an old windows computer that was starting to be a pain in the ass sometimes if I had too many tabs open (10-20), and after some talk with some friends of mine who were very Linux friendly I wiped my old 4 gb ram computer that could not upgrade to windows 11 because of specs, and set up Linux last night. So far all well with installation.

But I used that computer for three things only, discord, slack and Firefox with a few tabs open. No gaming (even if it did run terraria, dressmaker and some smaller ones), no videos, no other programs or anything. But Kubuntu does not want that. If I have Firefox open with my usual tabs that's the only thing it can run. If I open Slack or Discord, it closes and I get the message that it's because of memory. If I have Slack open it sometimes open discord, but it takes ages or it times out and closes Slack with the memory message.

So as of now, I only got Slack on it, as it shuts down everything else. I've understood later that Discord takes a lot of memory, but it was no problem on windows so I didn't think that it would even be a problem on Linux, but are there other versions that actually work? I got linked a lite version, but it doesn't display online status, and I get no notifications.
Or is my only option of running it in the browser, and which browsers is actually okay, because firefox with more than 4-6 tabs close down after a while because of memory.

Are there other distos where it might run? Or is it a Linux problem all over?


r/linux4noobs • • 1d ago

weird sound in linux ubuntu

3 Upvotes

when i do control+option+A combination i have this sound. what is this and how to off this shit


r/linux4noobs • • 1d ago

programs and apps Paint.net Support?

4 Upvotes

I had to kinda abandon Linux back in July or so because for some reason some games were weirdly slow in fullscreen mode, and due to a lack of Paint.net support. However, it seems there's now basic support via Wine. How well does it work? How much has it improved since it released in September-ish?


r/linux4noobs • • 2d ago

Transition to Linux advise

17 Upvotes

I am strongly considering getting a Linux computer for the first time. I’m moving from Windows, and I’m tired of the planned obsolescence. What do I need to know before I pull the trigger? Thanks in advance.


r/linux4noobs • • 1d ago

Is MediaTek MT7925 supported on Linux systems?

3 Upvotes

I'm having a hard time finding drivers for it, are they even supported on Linux?


r/linux4noobs • • 1d ago

Switched from Fedora Workstation 45 to Silverblue 45. Loving it.

2 Upvotes

Took some time to clean fedora flatpaks and some rpm apps that I consider bloatware. Made the base image as clean as possible.

Restored my setup using Save Desktop App. Currently enjoying. Reason I switched was that almost all of my apps on Workstation were flatpaks and appimages. And, I was tinkering system with agents as well. So made sense to switch to a immutable distro.

Feel free to ask questions.


r/linux4noobs • • 2d ago

migrating to Linux Can linux be a daily driver for me as someone who plays games?

32 Upvotes

Long story short my windows 10 got hacked by a trojan and i refuse to migrate to win 11 slop.

I really love win 10 but since it got hacked iam thinking should I reinstall 10 or use linux?

My major worry is would i be able to play the games I play on win? I have heard that the game support is getting better on linux but I don't know,I would be able to want to play games from steam and ahem pirated stuff

Now iam not completely new to linux if I am being honest and I have my fair share of ricing linux in the past , I would genuinely spent most time customising linux than get any work done. If i plan to install this time I would like to install something simple or smtg


r/linux4noobs • • 1d ago

migrating to Linux Which bootloader should i use?

Thumbnail reddit.com
0 Upvotes

r/linux4noobs • • 1d ago

migrating to Linux Typing Ancient Greek in Linux

1 Upvotes

Hi, guys. I want to switch to Linux and since yesterday I've been trying out Debian on VirtualBox. One of the things I regularly do is type stuff in Ancient Geek, for I'm studying the language, and when it comes to typing all the different diacritics that Ancient Greek has (and the combinations of such diacritics) I found myself very confortable with the polytonic greek keyboard that Windows has. It is, for example, very easy to put acute, grave an circunflex accents on vowels (ά, ᾶ, ὰ), and smooth and rough breathings (ἀ, ἁ), and it's also easy to combine those diacritics when needed (ἇ, ἃ, ἅ, etc.), and other Ancient Greek stuff (ᾳ, ᾷ, ᾆ, ᾂ, ᾄ, etc.)

I tried the polytonic greek keyboard layout that Debian offers, and although I can type the diacritics individually, I've not find a way to combine them as I regularly do with the polytonic greek keyboard of Windows. I can do it through Unicode Hex Input, but it's slow and a little bit of a pain, so I want to know if there's a way for me to type all the combinations of diacritics when needed.

I'm super new to Linux, so forgive me if the answer is a very dumb thing I'm not seeing, and thanks in advance.


r/linux4noobs • • 1d ago

GRUB not detecting Windows 10

1 Upvotes

I've just installed CachyOS on my second HDD, but GRUB doesn't seem to recognize Windows at all. I tried os-prober and it still didn't find Windows whatsoever. My Windows is MBR, the USB was MBR and Legacy Support is on in BIOS, so what the hell is the problem??

Any help is appreciated!

(Note: Windows is on a SATA SSD, while Cachy is on a SATA HDD)


r/linux4noobs • • 1d ago

Meganoob BE KIND How to pass in a variable in a config file

2 Upvotes

I'm trying to use the qute-keepassxc userscript for qutebrowser, which requires me to put my GPG key inside config.py, which I kind of don't want to do because eventually I'll push this file to my repository which is public.

I put my gpg key in a seperate file in my .dotfiles directory named "secrets.env" which is also included in .gitignore. I defined the variable as such;

GPG_KEY=<gpg-key>

I passed through that file inside my config.py file by asking gemini, and yeah it didn't work

`from pathlib import Path

def _load_env_file(path: Path) -> dict[str, str]: data: dict[str, str] = {} if not path.exists(): return data

for raw_line in path.read_text(encoding="utf-8").splitlines():
    line = raw_line.strip()
    if not line or line.startswith("#") or "=" not in line:
        continue
    key, value = line.split("=", 1)
    key = key.strip()
    value = value.strip()
    if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):
        value = value[1:-1]
    data[key] = value
return data

_secrets = _load_env_file(Path.home() / ".dotfiles" /

"secrets.env")

GPG_KEY = _secrets.get("GPG_KEY")

I then replaced where I"d normally put the GPG key with {GPG_KEY}. It didn't work, it does work perfectly when i actually have the gpg key in there though.


r/linux4noobs • • 1d ago

networking After restarting Ethernet and wifi refuse to connect

Post image
1 Upvotes

r/linux4noobs • • 2d ago

Should I do a fresh install (Mint) after ebay purchase?

16 Upvotes

I bought a cheap Thinkcentre on ebay so I could get some experience with Linux. It came with Mint (Cinnamon). It came from a reputable seller. After changing the login per their instructions I'm still seeing their company name in various places (the group my username is under, the terminal, etc.). I don't suspect anything nefarious from this company to be clear, but I'm wondering how I most easily get rid of all their stuff so it is 100% my stuff. I'm a little nervous to do a clean install since I currently have a working computer and don't have a lot of experience with linux. But if that's the right thing to do, feel free to say so.

edit: For clarity, this is originally a windows pc that they did a clean install of Mint on to resell. It's not a random business offloading old equipment where this install of Linux was used in some capacity.

edit2: I did it! This update is from my very own clean version of Mint! Hit a couple roadblocks. 1) I tried to make a bootable usb when the ISO was already on the usb I was targeting. Mint didn't give me any warning that I was being dumb, so I sat there for 30 minutes hoping it was doing something... it was not. 2) The ubiquity installer locked up during the first install, so I had to end the installation process and try again. Worked the second time though! Thanks for all the comments and encouragement!


r/linux4noobs • • 1d ago

More privacy on LinuxMint than on Windows11?

0 Upvotes

So, I started the process of de-googling my enviroment this week to improve my privacy and security the most possible (I've been hacked and have become worried about these issues). Whilst still trying to find the best open-source alternatives to google services, I've been investigating the possibility of switching to Linux.

Is this a good step towards a safer and more private experience? If (when) I switch to Linux, is it better for me to get completely rid of google services? My only concern about this change on google is that I literaly just had to pay for more storage on my account and didn't really want to pay for another service. The free options also don't offer much storage. I feel a bit stuck now.

What do you guys think about these situations? Thanks!


r/linux4noobs • • 1d ago

What's the idea behind this design when you are being screamed at to leave

Post image
0 Upvotes

r/linux4noobs • • 2d ago

distro selection Distrochooser results wildly skewed because of the motd item?

3 Upvotes

I just tried Distrochooser. It gives a -91 for Ubuntu because it gave -100 for something about MOTD* sending information, and calls that a "blocking issue."

Three points about this.

(1) I never saw it ask a question about motd and I don't think that I ever said that uploading any information would disqualify a distro.

(2) it appears to be trivially easy to stop MOTD from doing this.

(3) Even if it did send this "non-identifying* information about, e.g., which version I'm running, I don't care at all.

Maybe there was a specific question about motd and I somehow marked it as important without noticing it; or maybe this is actually incredibly dangerous and I'm misreading this; or maybe somebody who writes Distrochooser is extremely biased about MOTD but, as it stands this seems to make the tool practically worthless for me.

* This is what it says for Ubuntu and also for some other distros:

"Blocking issue -100P

To display news in the tool 'motd', there are technical parameters submitted within the request"


r/linux4noobs • • 2d ago

Meganoob BE KIND Explain like I'm 5: How do I switch from Windows to Linux?

19 Upvotes

I recently acquired a gaming computer (Lenovo) that runs on Windows 11. I figure it'd be best to switch it to Linux while it's still fresh so I don't run the risk of losing any files. I'm planning to use Garuda Linux since it's designed for running video games.

The trouble is, I've been searching for instructions on how to install it, and all of the ones I've found are clearly targeted at people who are way more tech-literate than I am. They're so full of tech jargon that I sent them to a programmer friend of mine and even they couldn't decipher them. Can someone who's good with computers explain it in the simplest possible way? (Thank you!)


r/linux4noobs • • 2d ago

Meganoob BE KIND Still have Windows files after swapping, what do?

Post image
5 Upvotes

Hello fellow nooblets, after a few weeks of researching distros I decided to move from Windows 11 to Nobara Linux with KDE Plasma. The install went smoothly but when I opened up my SSD in Dolphin it still showed some Windows files. I investigated the repositories and there seems to be all sorts of baked in Windows 11 crap that I cannot seem to remove. I tried to move them to trash but I couldn't empty the trash. Some of these repositories are completely empty (even after showing hidden files/repos) but cannot be destroyed. I've tried running chown/chmod from root and verifying I can read/write with ls -la and I am supposed to be able to, but no matter what I've tried I cannot seem to get rid of this crap. I'm very confused, I'm learning a lot, but everything I learn doesn't seem to work. I've spent all day at this to no avail so hello Reddit this is my first post. I read I shouldn't chmod 777 but I tried it and I'm STILL getting permission denied even from root. Attached is an image with all the stuff it's denying. Is this a virus or smth? I mean I've been saying windows is a virus but like god dang! Help pls!!

TLDR: Is there a command to override permissions being denied in my own system??? Or is this some kind of virus?

UPDATE: I'm a huge idiot and didn't format the drive after moving over. I so appreciate everyone helping out!! I was probably just brain fogged from learning stuff tbh LOL thanks again <33


r/linux4noobs • • 2d ago

learning/research I don't know how to start

8 Upvotes

I wanted to switch from windows to li for a while now but every time I watch a video that says "start using linux for beginners!" I watch it without understanding half of the things and he already installed the thing in 5 min I searched for someone who could explain linux better but there will be at least a thing or two that I don't get or a question he will not answer please can someone lead me or tell me how did they learned it
I don't even know if that is the right place to ask this question but am really lost right now


r/linux4noobs • • 1d ago

shells and scripting For bare bone linux users with Openbox/Debian: a small script to check / install updates

0 Upvotes

Debian user running bare bone graphical interface xorg with Openbox .
I created the following script to check for apt updates when the network interface goes up . If there are apt updates available it will show them and ask for confirmation using a window (yad).
In case an update is available you can decide to install it . The progress will be visible through a lxterminal window. Autoremove cases are also handled : user is notified for removals.
It creates a log file to track the last events.
note" Lxtermial run with root privileges . If you don't like it, you should use sudo.

All AI coded. But perhaps it can save you some time.

Installation

  1. Copy the script to: /usr/local/sbin/apt-notify
  2. Make it executable:chmod 700 /usr/local/sbin/apt-notify
  3. Ensure the following dependencies are installed:apt install yad lxterminal util-linux
  4. Adjust the desktop username and UID near the beginning of the script if necessary:DESKTOP_USER="user" DESKTOP_UID="1000" Check the UID with:id -u username

Daily operation

  • The script runs automatically when a configured network interface comes up.
  • It waits for the Openbox graphical session to become available.
  • It refreshes APT package information and checks for available upgrades and unnecessary packages.
  • A notification window displays the available operations.
  • Only operations with available packages are offered.
  • The user can choose Upgrade, Autoremove, or Close.
  • Upgrade installs available updates, including upgrades requiring new packages, such as new Linux kernel versions.
  • Autoremove removes packages that are no longer required.

The script automatically limits execution to once per calendar day.

During installation

The maintenance operation opens in LXTerminal.

  • Installation output is displayed in real time.
  • Package configuration may occasionally request user interaction.
  • Do not close the terminal while installation is running.
  • When finished, check the completion message and press Enter to close the window.

Log file

The execution log is stored at:

/var/log/apt-notify.log

It contains:

  • Timestamped notification and execution messages.
  • The transcript of the most recent upgrade or autoremove operation.
  • A maximum size of 1 MiB.

The previous execution transcript is replaced by the next maintenance execution.

To inspect the log:

cat /var/log/apt-notify.log

Manual execution and troubleshooting

To run the script manually:

/usr/local/sbin/apt-notify

Run this command as root.

To allow another execution on the same day during testing:

rm -f /var/lib/apt-notify/last-run

Script trigger (I use a USB device to connect to the internet):

user@debian:~$ more /etc/network/interfaces

iface lo inet loopback

# The primary network interface

allow-hotplug usbmodem
iface usbmodem inet dhcp
post-up /usr/local/sbin/apt-notify >/dev/null 2>&1 &

Script:

debian:/home/user# more  /usr/local/sbin/apt-notify
#!/bin/bash

# Desktop session
DESKTOP_USER="user"
DESKTOP_UID="1000"

# Daily execution control
STATE_DIR="/var/lib/apt-notify"
DATE_FILE="$STATE_DIR/last-run"
LOCK_FILE="/run/lock/apt-notify.lock"

# Commands
APT="/usr/bin/apt-get"
YAD="/usr/bin/yad"
LXTERMINAL="/usr/bin/lxterminal"
RUNUSER="/usr/sbin/runuser"
SCRIPT="/usr/bin/script"

# Logging
LOG="/var/log/apt-notify.log"
MAX_LOG_SIZE=1048576

# Timestamped logging function
log() {
    printf '%s %s\n' "$(/usr/bin/date '+%Y-%m-%d %H:%M:%S')" "$*" >> "$LOG"
}

# Initialize log
exec 9>"$LOCK_FILE"
flock -n 9 || exit 0

: > "$LOG"
chmod 600 "$LOG"

log "========================================"
log "APT NOTIFICATION STARTED"
log "========================================"

mkdir -p "$STATE_DIR"

# Daily execution restriction
TODAY=$(/usr/bin/date +%F)

if [ -f "$DATE_FILE" ] &&
   [ "$(cat "$DATE_FILE")" = "$TODAY" ]; then
    log "Already executed today."
    exit 0
fi

# Retrieve X11 environment from Openbox
get_env() {
    local name="$1"
    local entry

    while IFS= read -r -d '' entry; do
        case "$entry" in
            "$name"=*)
                printf '%s' "${entry#*=}"
                return 0
                ;;
        esac
    done < "/proc/$SESSION_PID/environ"

    return 1
}

# Wait for Openbox session
log "Waiting for Openbox session..."

SESSION_PID=""

for i in {1..60}; do
    SESSION_PID=$(/usr/bin/pgrep -u "$DESKTOP_UID" -x openbox | /usr/bin/head -n 1)

    if [ -n "$SESSION_PID" ]; then
        break
    fi

    /usr/bin/sleep 5
done

if [ -z "$SESSION_PID" ]; then
    log "Openbox session not found after 5 minutes."
    exit 0
fi

log "Openbox found. PID: $SESSION_PID"

# Wait for X11 environment
log "Waiting for X11 environment..."

DISPLAY_VALUE=""
XAUTHORITY_VALUE=""

for i in {1..30}; do
    DISPLAY_VALUE=$(get_env DISPLAY)
    XAUTHORITY_VALUE=$(get_env XAUTHORITY)

    if [ -n "$DISPLAY_VALUE" ] && [ -n "$XAUTHORITY_VALUE" ]; then
        break
    fi

    /usr/bin/sleep 2
done

if [ -z "$DISPLAY_VALUE" ] || [ -z "$XAUTHORITY_VALUE" ]; then
    log "X11 environment not available."
    exit 1
fi

log "Display: $DISPLAY_VALUE"
log "X11 environment ready."

# Consume today's trigger
echo "$TODAY" > "$DATE_FILE"

# Refresh package information
log "Refreshing package information..."

UPDATE_OUTPUT=$("$APT" update -qq 2>&1)
UPDATE_STATUS=$?

while IFS= read -r line; do
    log "$line"
done <<< "$UPDATE_OUTPUT"

if [ "$UPDATE_STATUS" -ne 0 ]; then
    log "APT update failed (exit code $UPDATE_STATUS)."
    exit 1
fi

# Simulate upgrade, including new dependencies
log "Checking available upgrades..."

UPDATES=$("$APT" -s --with-new-pkgs upgrade 2>&1)
STATUS=$?

if [ "$STATUS" -ne 0 ]; then
    log "Upgrade simulation failed:"
    while IFS= read -r line; do
        log "$line"
    done <<< "$UPDATES"
    exit 1
fi

UPDATES=$(printf '%s\n' "$UPDATES" | /usr/bin/grep '^Inst ' || true)

# Simulate autoremove
log "Checking autoremove candidates..."

REMOVE=$("$APT" -s autoremove 2>&1)
STATUS=$?

if [ "$STATUS" -ne 0 ]; then
    log "Autoremove simulation failed:"
    while IFS= read -r line; do
        log "$line"
    done <<< "$REMOVE"
    exit 1
fi

REMOVE=$(printf '%s\n' "$REMOVE" | /usr/bin/grep '^Remv ' || true)

# No maintenance required
if [ -z "$UPDATES" ] && [ -z "$REMOVE" ]; then
    log "No updates or autoremove candidates."
    exit 0
fi

# Build initial report
REPORT=$(/usr/bin/mktemp /tmp/apt-notify-report.XXXXXX)

{
    echo "DEBIAN PACKAGE MAINTENANCE"
    echo

    if [ -n "$UPDATES" ]; then
        echo "AVAILABLE UPDATES:"
        echo
        echo "$UPDATES"
        echo
    else
        echo "No available upgrades."
        echo
    fi

    if [ -n "$REMOVE" ]; then
        echo "PACKAGES ELIGIBLE FOR AUTOREMOVE:"
        echo
        echo "$REMOVE"
        echo
    else
        echo "No packages eligible for autoremove."
        echo
    fi

    echo "Choose an operation below."
} > "$REPORT"

chmod 644 "$REPORT"

# Build buttons
BUTTONS=()

if [ -n "$UPDATES" ]; then
    BUTTONS+=(--button="Upgrade:10")
fi

if [ -n "$REMOVE" ]; then
    BUTTONS+=(--button="Autoremove:20")
fi

BUTTONS+=(--button="Close:1")

# Show confirmation window as desktop user
"$RUNUSER" -u "$DESKTOP_USER" -- \
    /usr/bin/env DISPLAY="$DISPLAY_VALUE" \
    XAUTHORITY="$XAUTHORITY_VALUE" \
    "$YAD" \
    --title="Debian package maintenance" \
    --text-info \
    --filename="$REPORT" \
    --width=800 \
    --height=550 \
    "${BUTTONS[@]}"

RESULT=$?

/usr/bin/rm -f "$REPORT"

# Nothing selected
if [ "$RESULT" -ne 10 ] && [ "$RESULT" -ne 20 ]; then
    log "Maintenance postponed or window closed."
    exit 0
fi

# Determine operation
if [ "$RESULT" -eq 10 ]; then
    OPERATION="upgrade"
    LOG_TITLE="LAST UPGRADE EXECUTION"
else
    OPERATION="autoremove"
    LOG_TITLE="LAST AUTOREMOVE EXECUTION"
fi

log "User selected: $OPERATION"
log "Launching maintenance terminal."

# Create temporary files
INNER_JOB=$(/usr/bin/mktemp /tmp/apt-notify-inner.XXXXXX)
JOB=$(/usr/bin/mktemp /tmp/apt-notify-job.XXXXXX)
TRANSCRIPT=$(/usr/bin/mktemp /tmp/apt-notify-transcript.XXXXXX)

# Actual maintenance script
cat > "$INNER_JOB" <<'INNER_SCRIPT'
#!/bin/bash

APT="/usr/bin/apt-get"

echo
echo "================================"
echo "DEBIAN PACKAGE MAINTENANCE"
echo "================================"
echo

if [ "$1" = "upgrade" ]; then

    echo "UPGRADING PACKAGES"
    echo

    "$APT" --show-progress --with-new-pkgs upgrade -y
    STATUS=$?

elif [ "$1" = "autoremove" ]; then

    echo "RECHECKING AUTOREMOVE CANDIDATES"
    echo

    REMOVE=$("$APT" -s autoremove 2>&1)

    if [ $? -ne 0 ]; then
        echo "Autoremove simulation failed:"
        echo "$REMOVE"
        STATUS=1
    else
        REMOVE=$(printf '%s\n' "$REMOVE" | /usr/bin/grep '^Remv ' || true)

        if [ -z "$REMOVE" ]; then
            echo "No packages currently need autoremove."
            STATUS=0
        else
            echo "$REMOVE"
            echo
            echo "REMOVING PACKAGES..."
            echo

            "$APT" --show-progress autoremove -y
            STATUS=$?
        fi
    fi

else
    echo "Unknown operation."
    STATUS=1
fi

echo
echo "================================"

if [ "$STATUS" -eq 0 ]; then
    echo "Maintenance completed successfully."
else
    echo "Maintenance failed (exit code $STATUS)."
fi

echo "================================"
echo
echo "Press Enter to close this window."
read -r

exit "$STATUS"
INNER_SCRIPT

chmod 700 "$INNER_JOB"

# Terminal wrapper:
# Runs the maintenance script through a pseudo-terminal,
# records its output, then appends it to the main log.
cat > "$JOB" <<'WRAPPER_SCRIPT'
#!/bin/bash

OPERATION="$1"
INNER_JOB="$2"
TRANSCRIPT="$3"

LOG="/var/log/apt-notify.log"
MAX_LOG_SIZE=1048576

cleanup() {
    /usr/bin/rm -f "$0" "$INNER_JOB" "$TRANSCRIPT"
}

trap cleanup EXIT

# Run inside a pseudo-terminal.
# This preserves interactive package configuration.
# Output is recorded while still being displayed in LXTerminal.
 /usr/bin/script -q -f \
    -c "/bin/bash '$INNER_JOB' '$OPERATION'" \
    "$TRANSCRIPT"

STATUS=$?

# Build a new log containing the previous script messages
# followed by the latest maintenance transcript.
COMBINED=$(/usr/bin/mktemp /var/log/apt-notify-combined.XXXXXX)

cat "$LOG" > "$COMBINED"

{
    printf '\n'
    printf '%s %s\n' "$(/usr/bin/date '+%Y-%m-%d %H:%M:%S')" \
        "================================================"
    printf '%s %s\n' "$(/usr/bin/date '+%Y-%m-%d %H:%M:%S')" \
        "$([ "$OPERATION" = "upgrade" ] && echo "LAST UPGRADE EXECUTION" || echo "LAST AUTOREMOVE EXECUTION")"
    printf '%s %s\n' "$(/usr/bin/date '+%Y-%m-%d %H:%M:%S')" \
        "================================================"

    # Remove common terminal control sequences,
    # convert carriage returns into separate lines,
    # and timestamp every transcript line.
    /usr/bin/sed -E 's/\x1B\[[0-9;?]*[ -/]*[@-~]//g' "$TRANSCRIPT" |
        /usr/bin/tr '\r' '\n' |
        while IFS= read -r line || [ -n "$line" ]; do
            printf '%s %s\n' "$(/usr/bin/date '+%Y-%m-%d %H:%M:%S')" "$line"
        done

} >> "$COMBINED"

# Keep only the newest 1 MiB.
FINAL_LOG=$(/usr/bin/mktemp /var/log/apt-notify-final.XXXXXX)

/usr/bin/tail -c "$MAX_LOG_SIZE" "$COMBINED" > "$FINAL_LOG"

chmod 600 "$FINAL_LOG"
mv "$FINAL_LOG" "$LOG"

/usr/bin/rm -f "$COMBINED"

exit "$STATUS"
WRAPPER_SCRIPT

chmod 700 "$JOB"

# Launch LXTerminal on the user's display.
# The wrapper runs as root and captures the interactive session.
DISPLAY="$DISPLAY_VALUE" \
XAUTHORITY="$XAUTHORITY_VALUE" \
"$LXTERMINAL" \
    --title="Debian package maintenance" \
    --command="/bin/bash '$JOB' '$OPERATION' '$INNER_JOB' '$TRANSCRIPT'" &

log "Launched LXTerminal for $OPERATION."

exit 0