general/other How can I install the rpm package management within the centos/linuxulator

Hello to everyone.

recently,thanks to the help of @darkbeer,I've been able to run the stable diffusion webui of automatic1111. You can read the post and the tutorial that has been created reading on this thread :


what's the problem now ? the problem that I have is that it runs only with the original centos distro and package. To make a sum,the commands that I use to ran that are the following :

Code:
bash
cd /compat
source /usr/home/marietto/miniconda3/etc/profile.d/conda.sh
conda activate
cd /compat/linux/home/marietto/Desktop/stable-diffusion/stable-diffusion-webui
conda activate automatic
LD_PRELOAD=/compat/dummy-uvm.so  python3 launch.py

as I said,to run it I'm forced to use the centos package installed on /compat/linux. But I have also installed ubuntu on /compat/ubuntu with some important applications inside that I use from time to time,like the brave browser,chrome,firefox,spotify,Sikulix,etc. As you probably know,we can't use two linux layers simultaneously. So,if I want to run stable diffusion I can't run at the same time the linux version of firefox,useful when I want to watch some DRM protected content. But what happens when I try to run the commands above using ubuntu instead of centos ? this :

Code:
service ubuntu onestop && sysctl compat.linux.emul_path=/compat/ubuntu && service ubuntu onestart
cd /compat
source /usr/home/marietto/miniconda3/etc/profile.d/conda.sh
conda activate
cd /compat/ubuntu/home/marietto/stable-diffusion-webui
conda activate automatic
LD_PRELOAD=/compat/dummy-uvm.so  python3 launch.py

Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
Commit hash: 360feed9b55fb03060c236773867b08b4265645d
Traceback (most recent call last):
  File "/compat/ubuntu/home/marietto/stable-diffusion-webui/launch.py", line 294, in <module>
    prepare_environment()
  File "/compat/ubuntu/home/marietto/stable-diffusion-webui/launch.py", line 209, in prepare_environ
ment
    run_python("import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add -
-skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'")
  File "/compat/ubuntu/home/marietto/stable-diffusion-webui/launch.py", line 73, in run_python
    return run(f'"{python}" -c "{code}"', desc, errdesc)
  File "/compat/ubuntu/home/marietto/stable-diffusion-webui/launch.py", line 49, in run
    raise RuntimeError(message)
RuntimeError: Error running command.
Command: "/home/marietto/miniconda3/envs/automatic/bin/python3" -c "import torch; assert torch.cuda.
is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variab
le to disable this check'"
Error code: 1
stdout: <empty>
stderr: Traceback (most recent call last):
  File "<string>", line 1, in <module>
AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variabl
e to disable this check

I don't know why that error happens,but I know that it does not happens if I use centos instead of ubuntu and I have issued the same commands included in the tutorial to both "distros". I suspect that centos has some different software mechanism than ubuntu. But I want to use one only "distro" and I would like that it was ubuntu,because I have a better familiarity with it than with the centos. What you suggest to me to do in this kind of scenario ? I also see that inside the centos there isn't any package management installed. I can't use yum or dnf. And it's hard for me to learn how to add it without a detailed tutorial. At worst I might consider using only centos if I can install the same software that I have installed within the ubuntu "distro". Maybe I can install a more complete centos "distro" (where there is yum and dnf and where I have configured succesfully the stable diffusion webui) on a bhyve VM and I can use that,instead of the default centos offered by FreeBSD as a package ? Do you think that it will work ?
 
Work in progress :

Upgrading CentOS 7 to CentOS 8

Code:
chroot /compat/linux /bin/bash

bash-4.2# dnf upgrade

bash-4.2# wget --no-check-certificate https://archive.kernel.org/centos-vault/8.5.2111/BaseOS/x86_64
/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm

bash-4.2# wget --no-check-certificate https://archive.kernel.org/centos-vault/8.5.2111/BaseOS/x86_64
/os/Packages/centos-linux-release-8.5-1.2111.el8.noarch.rpm

bash-4.2# wget --no-check-certificate https://archive.kernel.org/centos-vault/8.5.2111/BaseOS/x86_64
/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm

bash-4.2# dnf install {centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noa
rch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}

bash-4.2# wget --no-check-certificate https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.no
arch.rpm

bash-4.2# dnf -y upgrade epel-release-latest-8.noarch.rpm

bash-4.2# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

Failed to set locale, defaulting to C
IniParser: Can't open file
IniParser: Can't open file
Extra Packages for Enterprise Linux 8 - x86_64                      0.0  B/s |   0  B     00:00    
CentOS Linux 8 - BaseOS                                             0.0  B/s |   0  B     00:00    
CentOS Linux 8 - AppStream                                          0.0  B/s |   0  B     00:00    
CentOS Linux 8 - Extras                                              73 kB/s |  11 kB     00:00    
Failed to synchronize cache for repo 'epel', ignoring this repo.
Failed to synchronize cache for repo 'baseos', ignoring this repo.
Failed to synchronize cache for repo 'appstream', ignoring this repo.
Dependencies resolved.
====================================================================================================
 Package                    Arch                 Version                 Repository            Size
====================================================================================================
Downgrading:
 epel-release               noarch               8-11.el8                extras                24 k

Transaction Summary
====================================================================================================
Downgrade  1 Package

Total download size: 24 k
Downloading Packages:
epel-release-8-11.el8.noarch.rpm                                    117 kB/s |  24 kB     00:00    
----------------------------------------------------------------------------------------------------
Total                                                                81 kB/s |  24 kB     00:00      
warning: /var/cache/dnf/extras-2770d521ba03e231/packages/epel-release-8-11.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c
65d: NOKEY
CentOS Linux 8 - Extras                                             0.0  B/s |   0  B     00:00    
Importing GPG key 0x8483C65D:
 Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
 Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1  
  Downgrading      : epel-release-8-11.el8.noarch                                               1/2  
  Cleanup          : epel-release-8-18.el8.noarch                                               2/2  
  Verifying        : epel-release-8-11.el8.noarch                                               1/2  
  Verifying        : epel-release-8-18.el8.noarch                                               2/2  

Downgraded:
  epel-release-8-11.el8.noarch                                                                      

Complete!

bash-4.2# dnf -y install kernel-core

Failed to set locale, defaulting to C
IniParser: Can't open file
IniParser: Can't open file
Extra Packages for Enterprise Linux 8 - x86_64                      0.0  B/s |   0  B     00:00   
CentOS Linux 8 - BaseOS                                             0.0  B/s |   0  B     00:00   
Extra Packages for Enterprise Linux Modular 8 - x86_64              0.0  B/s |   0  B     00:00   
CentOS Linux 8 - AppStream                                          0.0  B/s |   0  B     00:00   
Failed to synchronize cache for repo 'epel', ignoring this repo.
Failed to synchronize cache for repo 'baseos', ignoring this repo.
Failed to synchronize cache for repo 'epel-modular', ignoring this repo.
Failed to synchronize cache for repo 'appstream', ignoring this repo.
Last metadata expiration check: 0:01:16 ago on Sun Jan 22 21:33:55 2023.
No match for argument: kernel-core
Error: Unable to find a match: kernel-core
 
Hi dude, i dont know if is useless, or not, but there is a chance to test it, with this Installing CentOS in a chroot under Debian and look this RINSE maybe you can follow this tutorial to install CentOS 8 under FreeBSD, there is a rinse package also there and create a modern /compat/centos with compatibility layer like ubuntu ones...i tried time ago to create chroot, under debian, and look is possible.Well i look inside the sofware and there isn't centos-8 distribution but you can create your own packages list under /usr/local/etc/rinse....and add mirrors inside rinse.conf, look simple how it is work.good 🤞 luck
 
This is nice,but it will not work. We have two roads to follow here :

1) installing Debian in a chroot under CentOS

2) modify the script called "miniconda-installer.sh" changing inside of it the word linux with the word ubuntu

Right now I've been able to run stable diffusion if the linux userland is centos. But if it is ubuntu it does not work. Probably some little modifications are needed within some shell scripts.

I've understood one or one of the many reasons why the darkbeer tutorial does not work with ubuntu as userland instead of centos7. First of all,I have installed ubuntu following this tutorial :


https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/


and then I've started to follow the instructions and I've reached the point where miniconda3 should be installed. This is what happens when I try to do that on a fresh installation of FreeBSD :

Code:
# miniconda-installer.sh
/compat/linux/bin/sh: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

as the error says,it refers to /compat/linux,but I'm using /compat/ubuntu,so,I've thought to make some little modification inside the script,changing the word linux with the word ubuntu. Below you see what happens when I run the modified script :

Code:
Miniconda3 will now be installed into this location:
/home/marietto/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/marietto/miniconda3] >>>
PREFIX=/home/marietto/miniconda3
md5sum: -: No such file or directory
WARNING: md5sum mismatch of tar archive
expected: 81b26c617ffd9011dea96fd57c13e71b
     got:
Unpacking payload ...
                                                                                              
Installing base environment...


Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Executing transaction: done
Miniconda3-latest-Linux-x86_64.sh: 438: [[: not found

Installing * environment...

Miniconda3-latest-Linux-x86_64.sh: 444: [[: not found

CondaFileIOError: '/home/marietto/miniconda3/pkgs/envs/*/env.txt'. [Errno 2] No such file or directory: '/home/marietto/miniconda3/pkgs/envs/*/env.txt

my knowledge of the shell scripting is too low to understand how to fix that error. But I presume that someone can.
 

cracauer@

Developer
Miniconda3-latest-Linux-x86_64.sh: 438: [[: not found

Installing * environment...

Miniconda3-latest-Linux-x86_64.sh: 444: [[: not found

CondaFileIOError: '/home/marietto/miniconda3/pkgs/envs/*/env.txt'. [Errno 2] No such file or directory: '/home/marietto/miniconda3/pkgs/envs/*/env.txt
[/CODE]

my knowledge of the shell scripting is too low to understand how to fix that error. But I presume that someone can.

Looks like a script requiring bash running in plain /bin/sh
 
like this ?

Code:
marietto@marietto:/compat $ bash

[marietto@marietto /compat]$ miniconda-installer

Welcome to Miniconda3 py310_22.11.1-1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
======================================
End User License Agreement - Miniconda
======================================

Copyright 2015-2022, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

This End User License Agreement (the "Agreement") is a legal agreement between you and Anaconda, Inc
. ("Anaconda") and governs your use of Miniconda.

Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transferable
 license to:

  * Install and use the Miniconda,
  * Modify and create derivative works of sample source code delivered in Miniconda subject to the T
erms of Service for the Repository (as defined hereinafter) available at https://www.anaconda.com/te
rms-of-service, and
  * Redistribute code files in source (if provided to you by Anaconda as source) and binary forms, w
ith or without modification subject to the requirements set forth below.

Anaconda may, at its option, make available patches, workarounds or other updates to Miniconda. Unle
ss the updates are provided with their separate governing terms, they are deemed part of Miniconda l
icensed to you as provided in this Agreement. This Agreement does not entitle you to any support for

Do you accept the license terms? [yes|no]
[no] >>> yes

Miniconda3 will now be installed into this location:
/home/marietto/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/marietto/miniconda3] >>> 
PREFIX=/home/marietto/miniconda3
md5sum: -: No such file or directory
WARNING: md5sum mismatch of tar archive
expected: 81b26c617ffd9011dea96fd57c13e71b
     got: 
Unpacking payload ...
                                                                                                    
Installing base environment...


Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Executing transaction: done
Miniconda3-latest-Linux-x86_64.sh: 438: [[: not found

Installing * environment...

Miniconda3-latest-Linux-x86_64.sh: 444: [[: not found

CondaFileIOError: '/home/marietto/miniconda3/pkgs/envs/*/env.txt'. [Errno 2] No such file or directory: '/home/marietto/miniconda3/pkgs/envs/*/env.txt
 
look you are gone to right way to discover a workaround to launch miniconda installer under Ubuntu chroot...
the error had you encountered it look due to wrong path i tried to do same way and when i stay in $home/$user with the installer the path was root/miniconda3 ,so dind'n found the real path. just change the location
 

Attachments

  • miniconda Setup _ The FreeBSD Forums – Mozilla Firefox 26_01_2023 10_24_39.png
    miniconda Setup _ The FreeBSD Forums – Mozilla Firefox 26_01_2023 10_24_39.png
    1 MB · Views: 5
what's the location that worked for you ? can't be root because the script does not work as root.
 
I've found the fix for this problem. I took a look into the directory "/compat/linux/bin" and I saw that it is a link that points to dash,not to bash. While on centos it points to bash. I've changed the link from dash to bash and the script worked. let's move on further.
 
to install conda i just follow the github tutorial but only i was a issue about untar packages look the path was /tmp when limited the space to just one Gb so it said didn't left enough space in the device when my / was almost 40 Gb
 
when you will have fixed the dash/bash link,you will see that it will not work because a lot of nvidia libs are not going to be installed / reinstalled by the package called "linux-nvidia-libs". I'm going to open a new thread to understand why an odd error happens and how to fix.
 
Top