You are not logged in.

#1 2023-11-21 14:31:42

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 409
Website

[SOLVED] screwed up os-release i guess

I use neofetch and wanted to change what the line for os said.
I manually change the os-release file and now neofetch looks like this:

        #####           demo@mail
       #######          ---------
       ##O#O##          OS: n/a
       #######          Host: PowerEdge T30
     ###########        Kernel: 6.1.63-1-lts
    #############       Uptime: 27 mins
   ###############      Packages: 856 (pacman)
   ################     Shell: bash 5.2.15
  #################     Resolution: 1920x1080
#####################   DE: Xfce 4.18
#####################   WM: Xfwm4
  #################     WM Theme: Default
                        Theme: Adwaita [GTK2/3]
                        Icons: elementary [GTK2], Adwaita [GTK3]
                        Terminal: alacritty
                        CPU: Intel Pentium G4400 (2) @ 3.300GHz
                        GPU: Intel HD Graphics 510
                        Memory: 5.32GiB / 31.22GiB (17%)
                        GPU Driver: Dell HD Graphics 510 [1028:07c5]
                        CPU Usage: 40%
                        Disk (/): 19G / 40G (51%)
                        Font: Sans 10 [GTK2], Cantarell 11 [GTK3]
                        Public IP: 47.200.48.82

How do I fix the os line.
This is what is in my os-release file

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

Last edited by MAYBL8 (2023-11-21 22:02:30)

Offline

#2 2023-11-21 14:41:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] screwed up os-release i guess

How did you manually change the file?  What, exactly, did you do?  Did you edit the target of the link, or replace the link at /etc/os-release with a new file?

What is the output of `stat /etc/os-release`?

Last edited by Trilby (2023-11-21 14:42:10)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-11-21 15:21:47

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 409
Website

Re: [SOLVED] screwed up os-release i guess

I opened up the link /etc/os-release first and changed the first three lines.
I then noticed the link and went to the file it was linking to /usr/lib/os-release

After i noticed it caused the problem I put it back the way it was but that didn't fix it.

[demo@mail ~]$ stat /etc/os-release
  File: /etc/os-release -> ../usr/lib/os-release
  Size: 21        	Blocks: 0          IO Block: 4096   symbolic link
Device: 8,9	Inode: 1835012     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-11-21 08:55:38.422858887 -0500
Modify: 2023-04-21 03:13:29.000000000 -0400
Change: 2023-05-06 11:30:38.579791020 -0400
 Birth: 2023-05-06 11:30:38.579791020 -0400

Offline

#4 2023-11-21 15:44:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] screwed up os-release i guess

What's the output of `pacman -Qkk filesystem 2>&1 | grep os-release`?

I doubt this is an os-release issue as that all looks good so far.  Have you done anything with lsb-release (i.e., did you install it)?  There's no reason you should, but if you did that could impact neofetch's output.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-11-21 15:49:59

Gosi
Member
From: Vienna, Austria
Registered: 2010-02-25
Posts: 103

Re: [SOLVED] screwed up os-release i guess

MAYBL8 wrote:

I opened up the link /etc/os-release first and changed the first three lines.
I then noticed the link and went to the file it was linking to /usr/lib/os-release

After i noticed it caused the problem I put it back the way it was but that didn't fix it.

That is because /etc/lsb-release is used for the OS name in neofetch.

Offline

#6 2023-11-21 15:59:54

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 409
Website

Re: [SOLVED] screwed up os-release i guess

Trilby wrote:

What's the output of `pacman -Qkk filesystem 2>&1 | grep os-release`?

I doubt this is an os-release issue as that all looks good so far.  Have you done anything with lsb-release (i.e., did you install it)?  There's no reason you should, but if you did that could impact neofetch's output.

I didn't install it .
I did edit it and put it back the way I found it thinking it had to match os-release with what it had.

[demo@mail ~]$ pacman -Qkk filesystem 2>&1 | grep os-release
[sudo] password for demo:
warning: filesystem: /usr/lib/os-release (Modification time mismatch)
DISTRIB_ID=Arch Linux
DISTRIB_RELEASE="rolling"
DISTRIB_DESCRIPTION="Arch Linux"

I checked another Arch install I have and it doesn't have a lsb-release file and neofetch is also installed on it.

Sorry I screwed all this up.
Once this is fixed I will not mess with it ever again.

Offline

#7 2023-11-21 20:42:38

stanczew
Member
Registered: 2021-03-02
Posts: 114

Re: [SOLVED] screwed up os-release i guess

MAYBL8 wrote:

I checked another Arch install I have and it doesn't have a lsb-release file and neofetch is also installed on it.

https://github.com/dylanaraps/neofetch/ … istro-name
> When Neofetch detects a Linux distro it first looks for the lsb_release command before searching for the /etc/os-release file.

The code for reading OS name from LSB (first through lsb_release command, and if it's not available, directly from /etc/lsb-release file):
https://github.com/dylanaraps/neofetch/ … 991..L1015

I have to assume your neofetch runs with distro_shorthand option. In this case it will call lsb_release with -si flags. And using your /etc/lsb-release file, it does indeed produce "n/a" as the output:

$ lsb_release -si
/etc/lsb-release: line 1: Linux: command not found
n/a

This is because of lack of quotes in assignment of DISTRIB_ID variable – notice that the other variables are quoted.
You can either add the quotes, or just grab the original file from the lsb-release package (from the cache, or from here: https://gitlab.archlinux.org/archlinux/ … sb-release).

Offline

#8 2023-11-21 22:02:05

MAYBL8
Member
From: Florida USA
Registered: 2022-01-14
Posts: 409
Website

Re: [SOLVED] screwed up os-release i guess

It was the Quotes .  Thanks
I did not find that solution. I did look for a solution before I posted here.
I need to learn a better way of finding answers.
Thanks for all the help.

Offline

Board footer

Powered by FluxBB