SpiralLinux / SpiralLinux-project

SpiralLinux project
https://spirallinux.github.io/
134 stars 5 forks source link

Remove nvidia-driver from APT pin priority and patch live-build to prevent unwanted nvidia-* packages #141

Closed CicadaSeventeen closed 9 months ago

CicadaSeventeen commented 1 year ago

SpiralLinux cannot install Nvidia driver as vanilla debian, 1, Try apt install nvidia-driver, not work because of conflict. 2, Try aptitude install nvidia-driver, the conflict is solved but return error when installing. 3, Try apt install -t bullesys-backporst nvidia-driver, no conflict but return error when installing. 4, Try apt install -t bullseye nvidia-driver, seems to be OK now. I need more time to find out if any thing wrong here.

I guess this problem is because backport is enabled and apt or aptitude tends to use backport packages. However there are still old 5.10 kernel and somehow make mistake here. Debian Wiki says sometimes default kernel with backport Nv driver can make mistake.

I will try removing 5.10 kernel to find out what happens here, and I will also take some time finding out if installing driver with the approach above really works.

geckolinux commented 1 year ago

Hi there, sorry for the trouble. Actually apt does not prefer Backport package versions, which have a lower priority. However, a special rule was added for the Nvidia drivers, which apparently needs to be removed. Could you please try editing /etc/apt/preferences.d/99backports as root and modifying this section?


##### NVIDIA proprietary drivers

#Package: nvidia-driver
#Pin: release a=bullseye-backports
#Pin-Priority: 600
CicadaSeventeen commented 1 year ago

Hi there, sorry for the trouble. Actually apt does not prefer Backport package versions, which have a lower priority. However, a special rule was added for the Nvidia drivers, which apparently needs to be removed. Could you please try editing /etc/apt/preferences.d/99backports as root and modifying this section?

##### NVIDIA proprietary drivers

#Package: nvidia-driver
#Pin: release a=bullseye-backports
#Pin-Priority: 600

Your words are correct but only a half. By editing this file truly there will not be any conflict when installing but Nvidia driver just not work after installation. I spend some time to find out that you somehow pre-install 6 packages relating to Nvidia, and some of them break the driver. I check them and find that they are all free software, but distros like debian or ubuntu do not pre-install them. I try to remove all of six and find that no other packages relaying on them, so I am confused that why they are installed. In my opinion, if you are not worried about pre-installing non-free packages you can just install the whole driver. Otherwise, please remove all there six packages. Though they break the driver, apt does not see it as conflict, which took me a lot time to realize such problem. Maybe we should report to debian about it.

CicadaSeventeen commented 1 year ago

image These are the packages I suggest you to remove. Please also think about why you install them. To install some meaningless and harmful packages are just so terrifying. Thanks

CicadaSeventeen commented 1 year ago

Also I would like to ask your opinion about Asian language support. I ask this in another issue but you do not reply. Surely it is not an emergency right now. But we can not just thinking about that.

CicadaSeventeen commented 1 year ago

Now I still find after installing Nvidia driver, somehow gui cannot start at all. This problem comes from nvidia-xconfig, which default setting can crash graphics. It gives an Nvidia-only config as default so will break gui in hybrid graphic systemd. This is not a bug o SpiralLinux but should be cautious.

geckolinux commented 1 year ago

image These are the packages I suggest you to remove. Please also think about why you install them. To install some meaningless and harmful packages are just so terrifying. Thanks

Hi, none of those package are preinstalled in SpiralLinux. There are no packages installed containing *nvidia* by default in SpiralLinux. I imagine they were automatically installed during your attempts to install the Nvidia driver.

CicadaSeventeen commented 1 year ago

image These are the packages I suggest you to remove. Please also think about why you install them. To install some meaningless and harmful packages are just so terrifying. Thanks

Hi, none of those package are preinstalled in SpiralLinux. There are no packages installed containing *nvidia* by default in SpiralLinux. I imagine they were automatically installed during your attempts to install the Nvidia driver.

But I find these packages in livecd of xfce. And I will check for other flavor.

geckolinux commented 1 year ago

Thanks for catching this problem, I confirm that those 6 packages are present only in the most recent SpiralLinux release 11.220925. As mentioned, these were not explicitly installed by my SpiralLinux requested package list, but rather they are the result of this bug in the Debian live-build tool that is used to generate the SpiralLinux ISO images: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018873 For the next release I'll patch the live-build scripts and release ISOs without those 6 Nvidia packages.

Additionally, I will remove the APT pin priority for nvidia-driver

CicadaSeventeen commented 1 year ago

So the workaround now:

sudo apt update
sudo apt upgrade
sudo apt remove nvidia*
sudo apt install -t bullseye nvidia-driver
sudo apt install nvidia-smi nvidia-settings

Please not to install nvidia-xconfig

I will add it to discussions for anyone need helps.

CicadaSeventeen commented 1 year ago

Still problematic. I found old kernel 5.10 cannot run nvidia driver. I am working to understand it. Please give me some time.

geckolinux commented 1 year ago

So the workaround now:

sudo apt update
sudo apt upgrade
sudo apt remove nvidia*
sudo apt install -t bullseye nvidia-driver
sudo apt install nvidia-smi nvidia-settings

Please not to install nvidia-xconfig

I will add it to discussions for anyone need helps.

Also removing the pin priorities from /etc/apt/preferences.d/99backports

geckolinux commented 1 year ago

https://github.com/SpiralLinux/SpiralLinux-project/discussions/146#discussioncomment-3891489

methanoid commented 11 months ago

@geckolinux

FYI, was messing with plain Debian today and some borrowed ideas from Spiral such as not installing recommends by default. Had problems with "nvidia-tesla-470-driver" install until I added "--install-recommends" and problem went away. So maybe the issue is actually there and not the Debian bug? Just an idea

Happy to test the Debian 12 Spiral :-)

geckolinux commented 9 months ago

Implemented in https://github.com/SpiralLinux/SpiralLinux-project/releases/tag/12.231001