Pages

Showing posts with label dnf5. Show all posts
Showing posts with label dnf5. Show all posts

Saturday, October 26, 2024

Fedora 42 : ... testing Advanced Intrusion Detection Environment (AIDE).

Advanced Intrusion Detection Environment (AIDE) is a utility that creates a database of files on the system, and then uses that database to ensure file integrity and detect system intrusions.. See more on the official fedora documentation webpage.
NOTE : The documentation and translations on the official page are in progress due to ongoing development and resource management ...
I used the DNF tool to install:
[mythcat@fedora ~]$ sudo dnf install aide
... aide      x86_64      0.18.6-5.fc41        rawhide      
Make sure the AIDE database file exists and is accessible:
[mythcat@fedora ~]$ sudo ls -l /var/lib/aide/aide.db.gz
Ensure that the user running AIDE has the necessary permissions:
[mythcat@fedora ~]$ sudo ls -l /var/lib/aide/
Check the AIDE configuration file:
[mythcat@fedora ~]$ sudo cat /etc/aide.conf | grep DBDIR
Check if the AIDE service file exists:
[mythcat@fedora ~]$ sudo ls /usr/lib/systemd/system/ | grep aide
If the service exists then check the status:
[mythcat@fedora ~]$ sudo systemctl status aide
Unit aide.service could not be found.
If the service not exist then take some time to run first time ...
[mythcat@fedora ~]$ sudo /sbin/aide --init
...
End timestamp: 2024-10-26 14:10:00 +0300 (run time: 98m 41s)
You can check each time you want ...
[mythcat@fedora ~]$ sudo /sbin/aide --check
If you want and your Fedora linux need to use this tool, then you can use it like service:
sudo nano /usr/lib/systemd/system/aide.service
Fill with the basic service source code like any unit service :
[Unit]
   Description=Advanced Intrusion Detection Environment
   After=network.target

   [Service]
   Type=simple
   ExecStart=/sbin/aide --init
   ExecStop=/sbin/aide --check
   Restart=on-failure

   [Install]
   WantedBy=multi-user.target
This is a simple tutorial about how to start with AIDE tool ...

Sunday, October 13, 2024

Fedora 42 : The cvxpy python module ... part 001.

We are building a CVXPY community on Discord. Join the conversation! CVXPY is an open source Python-embedded modeling language for convex optimization problems. It lets you express your problem in a natural way that follows the math, rather than in the restrictive standard form required by solvers.
Today I install the cvxpy python module ...
You can see on the official website - www.cvxpy.org .
NOTE: I don't understand why the blogger don't have a a code tag , I used a div - pre - code into txt file to wrote my posts ...
[mythcat@fedora ~]$ nano tutoriale.txt 
Let's see ...
[mythcat@fedora home]# dnf5 upgrade
[mythcat@fedora home]# dnf5 install openblas-devel
[mythcat@fedora home]# dnf5 install blas-devel
...
$ ldconfig -p | grep openblas
$ ldconfig -p | grep blas
...
[mythcat@fedora home]$ pip install cvxpy
...
Successfully built cvxpy ecos scs qdldl
Installing collected packages: scipy, scs, qdldl, ecos, clarabel, osqp, cvxpy
Successfully installed clarabel-0.9.0 cvxpy-1.5.2 ecos-2.0.14 osqp-0.6.7.post3 qdldl-0.1.7.post4 scipy-1.14.1 scs-3.2.7

Thursday, October 10, 2024

Fedora 42 : First test with red language - part 001.

Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single ~1MB file!
I download and change to be executable:
[mythcat@fedora ~]$ cd red-lang/
[mythcat@fedora red-lang]$ ls
red-03oct24-920dd0452  red-toolchain-03oct24-920dd0452  red-view-03oct24-920dd0452
[mythcat@fedora red-lang]$ ls -l
total 4444
-rw-r--r--. 1 mythcat mythcat 1347348 Oct  4 23:56 red-03oct24-920dd0452
-rw-r--r--. 1 mythcat mythcat 1611781 Oct  4 23:55 red-toolchain-03oct24-920dd0452
-rw-r--r--. 1 mythcat mythcat 1589092 Oct  4 23:55 red-view-03oct24-920dd0452
[mythcat@fedora red-lang]$ chmod 760 red*
[mythcat@fedora red-lang]$ ls -l
total 4444
-rwxrw----. 1 mythcat mythcat 1347348 Oct  4 23:56 red-03oct24-920dd0452
-rwxrw----. 1 mythcat mythcat 1611781 Oct  4 23:55 red-toolchain-03oct24-920dd0452
-rwxrw----. 1 mythcat mythcat 1589092 Oct  4 23:55 red-view-03oct24-920dd0452
I check and install these supporting libraries:
sudo yum install glibc.i686
sudo yum install libcurl.i686
sudo yum install gtk3.i686
I start with the basic intro example from the official website.
Then I need to check the missing files with the DNF tool and install Fedora packages for each error on runtime with executable result
dnf provides \*/libgtk-3.so.0
The result is this:

Saturday, September 28, 2024

Fedora 42 : testing programming for ARM - part 001.

Today I tested the creation of a program that works on ARM processors and tested with QEMU emulator in Fedora 42.
I install with dnf5 these fedora packages:
[root@fedora mythcat]# dnf5 clean all
[root@fedora mythcat]# dnf5 install qemu-system-arm
[root@fedora mythcat]# dnf5 install arm-none-eabi-gcc gcc-arm-linux-gnu gcc-c++-arm-linux-gnu
[root@fedora mythcat]# dnf5 install arm-none-eabi-newlib.noarch 
...
[root@fedora mythcat]# dnf5 install binutils-devel
I create a new folder into may pagure account to test this issue with QEMU:
[mythcat@fedora mythcat]$ mkdir ARMProjects
[mythcat@fedora mythcat]$ cd ARMProjects/
[mythcat@fedora ARMProjects]$ qemu-system-arm --version
QEMU emulator version 9.1.0 (qemu-9.1.0-2.fc42)
I create a default assembly file for ARM named hello.s:
[mythcat@fedora ARMProjects]$ cat hello.s 
.global _start

_start:
    mov r0, #1     
    mov r7, #4     
    str r0, [r7]
    bx lr
Let's see how this means:
  • global _start: This declares the _start label as global, making it accessible from outside the file.
  • _start:: This marks the beginning of the program.
  • mov r0, #1: Moves the immediate value 1 into register R0.
  • mov r7, #4: Moves the immediate value 4 into register R7. This represents the system call number for write().
  • str r0, [r7]: Stores the contents of R0 (which contains 1) into the memory address pointed to by R7.
  • bx lr: Branches to the address in Link Register (LR). In this case, it loops indefinitely because there's no return instruction.
The compile of the file:
[mythcat@fedora ARMProjects]$ arm-none-eabi-gcc -nostartfiles -lc hello.s -o hello.o
[mythcat@fedora ARMProjects]$ ls
hello.o  hello.s
Let's see the hello.o file:
[mythcat@fedora ARMProjects]$ nm hello.o
00008000 t $a
00009010 T __bss_end__
00009010 T _bss_end__
00009010 T __bss_start
00009010 T __bss_start__
00009010 T __data_start
00009010 T _edata
00009010 T __end__
00009010 T _end
00080000 B _stack
00008000 T _start
[mythcat@fedora ARMProjects]$ objdump -f hello.o

hello.o:     file format elf32-little
architecture: UNKNOWN!, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00008000

Fedora 42 : ima: Error Communicating to TPM chip ... cannot be fixed.

TPM stands for Trusted Platform Module. It's a hardware security chip designed to provide cryptographic capabilities and perform platform authentication.
I found this error and I tried to fix on my laptop HP 6710b:
[mythcat@fedora ~]$ sudo dmesg | grep Error
[    1.274790] tpm tpm0: [Hardware Error]: Adjusting reported timeouts: A 750->750000us B 2000->2000000us C 750->750000us D 750->750000us
[    2.240276] ima: Error Communicating to TPM chip
[    2.243913] ima: Error Communicating to TPM chip
[    2.246923] ima: Error Communicating to TPM chip
[    2.249919] ima: Error Communicating to TPM chip
[    2.253088] ima: Error Communicating to TPM chip
[    2.255923] ima: Error Communicating to TPM chip
[    2.258921] ima: Error Communicating to TPM chip
[    2.261938] ima: Error Communicating to TPM chip
[    2.415255] RAS: Correctable Errors collector initia
I update and nistall with the dnf5 tool
[root@fedora mythcat]# dnf5 upgrade 
...
[root@fedora mythcat]# dnf install tpm-tools
...
I reboot the Fedora and I try to test it:
[mythcat@fedora ~]$ ls /dev/tpm*
/dev/tpm0
[mythcat@fedora ~]$ lsmod | grep tpm
tpm_infineon           20480  0
To see all commands, use:
[mythcat@fedora ~]$ tpm_
tpm_changeownerauth  tpm_nvwrite          tpm_setclearable
tpm_clear            tpm_resetdalock      tpm_setenable
tpm_createek         tpm_restrictpubek    tpm_setoperatorauth
tpm_getpubek         tpm_restrictsrk      tpm_setownable
tpm_nvdefine         tpm_revokeek         tpm_setpresence
tpm_nvinfo           tpm_sealdata         tpm_takeownership
tpm_nvread           tpm_selftest         tpm_unsealdata
tpm_nvrelease        tpm_setactive        tpm_version
I install tcsd
[root@fedora mythcat]#  dnf install tcsd
...
[mythcat@fedora ~]$ sudo usermod -a -G tss $USER
[root@fedora mythcat]# systemctl daemon-reload
[root@fedora mythcat]# systemctl start tcsd
[root@fedora mythcat]#  systemctl status tcsd
I check the tpm version vith:
[mythcat@fedora ~]$ tpm_version
  TPM 1.2 Version Info:
  Chip Version:        1.2.1.2
  Spec Level:          2
  Errata Revision:     0
  TPM Vendor ID:       IFX
  TPM Version:         01010000
  Manufacturer Info:   49465800
[mythcat@fedora ~]$ sudo dnf5 search tpm2-tools
Updating and loading repositories:
Repositories loaded.
Matched fields: name (exact)
 tpm2-tools.x86_64: A bunch of TPM testing toolS build upon tpm2-tss
[mythcat@fedora ~]$ sudo dnf5 install tpm2-tools
...
Package "tpm2-tools-5.7-2.fc41.x86_64" is already installed.
The last error :
[mythcat@fedora ~]$ sudo tpm2_startup
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpmrm0: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpm0: Device or resource busy 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
ERROR:tcti:src/tss2-tcti/tcti-device.c:455:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tcm0: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-device.so.0 
WARNING:tcti:src/util-io/io.c:262:socket_connect() Failed to connect to host 127.0.0.1, port 2321: errno 111: Connection refused 
ERROR:tcti:src/tss2-tcti/tcti-swtpm.c:617:Tss2_Tcti_Swtpm_Init() Cannot connect to swtpm TPM socket 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-swtpm.so.0 
WARNING:tcti:src/util-io/io.c:262:socket_connect() Failed to connect to host 127.0.0.1, port 2321: errno 111: Connection refused 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: libtss2-tcti-mssim.so.0 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:263:tctildr_get_default() No standard TCTI could be loaded 
ERROR:tcti:src/tss2-tcti/tctildr.c:477:tctildr_init_context_data() Failed to instantiate TCTI 
ERROR: Could not load tcti, got: "(null)"

Wednesday, January 31, 2024

Fedora 40 : Find version and GlibC flaw !

Because today I saw a video about the GlibC flaw that lets attackers get root on major distros, I will show an easy way to find the version of this lib with dnf and dnf5 tools:
[root@fedora var]# dnf in glibc
Last metadata expiration check: 0:04:06 ago on Wed 31 Jan 2024 10:25:13 PM EET.
Package glibc-2.38.9000-35.fc40.x86_64 is already installed.
Package glibc-2.38.9000-35.fc40.i686 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@fedora var]# dnf5 in glibc
Updating and loading repositories:
Repositories loaded.
Package "glibc-2.38.9000-35.fc40.x86_64" is already installed.
Package "glibc-2.38.9000-35.fc40.i686" is already installed.
You can see in the name is add the version: 2.38.9000-35.fc40.x86_64.
This is the video about GlibC from Bits inside by René Rebe.

Wednesday, December 27, 2023

Fedora 39 : Fixing common upgrade issues.

The most common issue is that the Linux system hangs due to disk space and upgrades.
Here's what you need to do:
Ensure you have root access by editing the boot sequence from the boot menu with the word single and entering the root password.
... start the network in the maintenance environment with the command:
# systemctl restart NetworkManager
Check if you can update with the DNF5 tool or DNF , see this webpage:
# dnf5 upgrade --refresh
If the update tool tells you that you have no space available, then you can clean up with:
# journalctl --disk-usage
# journalctl --vacuum-size=16M
The size of 16M is a relative size related to how the resource is allocated!
Another possibility would be to reallocate the space.
NOTE: If you are using a virtual disk with .vdi extension on Windows OS, then I don't have a solution.
Although virtualbox has an interface that would allow resizing the virtual disk, it didn't work for me.

Thursday, December 14, 2023

Fedora 39 : Foot - the sway terminal.

Today, I will show how to use a fast, lightweight, and minimalistic Wayland terminal emulator named Foot.
You can install it easily with the DNF5 tool :
The project can be found on this codeberg repo.
On the sawy desktop environment, you can use Win+D keys just to type a command to start an application.
You can start easily by typing foot or you can type on an open terminal, see:
[mythcat@fedora ~]$ foot
warn: wayland.c:1509: fractional scaling not available
warn: wayland.c:1512: no server-side cursors available, falling back to client-side cursors
warn: fcft.c:583: failed to get full font name
warn: fcft.c:583: failed to get full font name
I used updatedb and locate commands to find the foot.ini file and change some settings like font size, and more :

Sunday, September 3, 2023

Fedora 39 : Issues in Fedora with PyGobject and sway-tests.

Today I wanted to test this repo named sway-tests.
I followed the steps there and received an error from gi.repository.
This error is related to another issue related to PyGobject.
In Fedora Linux distro, installing PyGobject is done with pip like this:
$ pip install PyGobject
In order to have no errors, the dnf or dnf5 tool should be used like this ...
I tested the functionality of this installation with a simple example:
import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
It worked very well.
After solving this issue, I returned to the initial one and tested the sway-tests.
$ whereis sway
$ env/bin/pytest --sway=/usr/bin/sway
$ sudo env/bin/pytest --sway=/usr/bin/sway
I used the command both with and without sudo.
Both generated the same errors.
For the following command I had to install ... xorg-x11-server-Xephyr:
Xephyr is an X server which has been implemented as an ordinary X application. It runs in a window just like other X applications, but it is an X server ...
... the fixed centered black window specific to the xorg runtime appeared and somewhere on the side the terminal showed me a bunch of errors.
... obviously, I don't know how well sway-tests is implemented, now it's an archived repo, but I solved the use of PyGobject in python on the Fedora linux distribution.

Saturday, August 26, 2023

Fedora 39 : testing Godot on Laptop and VirtualBox.

Today I watched a bit of the video series on the YouTube channel Fedora.
It's a whole team that maintains the Fedora packages and their development. I thought to check if I have the possibility to effectively use it in the development of software on Linux that has multiple functionalities. And because I currently work on Windows with Godot version 4.1.1 and C#, I took the first steps for installation and testing.
Let's install the Godot game engine tool on Fedora Distro Linux.
$ sudo su 
# dnf5 search godot
# dnf5 install godot.x86_64
# exit
Let's open and test with this command:
$ godot
The Godot interface comes with version 4.0.3 and is functional on my laptop with Fedora. Obviously, I have not tested all the implemented functionalities, but they seem to be good and ready to work.
On the other hand, testing on Virtualbox, it seems that it can't start the Godot interface.
It seems that Godot depends on OpenGL and needs some minimum requirements to work properly starting with OpenGL version 3.3.

Fedora 39 : How to start using cockpit tool in firefox.

Use lie any default installation like any Fedora Linux Distro package for cockpit tool with DNF or DNF5 tool.
$ sudo su
# dnf5 install cockpit
# systemctl enable --now cockpit.socket
# firewall-cmd --add-service=cockpit
# firewall-cmd --add-service=cockpit --permanent
# exit
The next step is to test if this runs well.
Get your ip address with netstat:
$ netstat nr
Because I used an virtual box for testing Fedora I get this ip 10.0.2.0
Use with firefox in the terminal:
$ firefox http://10.0.2.0:9090
The result will be the online cockpit tool.

Wednesday, August 16, 2023

Saturday, July 29, 2023

Fedora 39 : DNF, DNF-3 and DNF5

Before installing DNF5 you should know that your installations with this tool in the fedora distribution may not work correctly
After implementation of dnf5 module install dnf and dnf5 cannot share the same location for storing state of modules, because dnf5 will store additional information about installed profiles (braking change). Modules enabled by DNF5 (dnf5 module enable <module>) will be not seen as enabled in DNF. Module profile installed by DNF5 will be not sees as installed in DNF. DNF will only see installed RPMs.
More details on this official webpage.
You can fix it with the dnf-3 tool if you accidentally modified or deleted the dnf tool.
A simple example is installing Deepin Desktop, which I could only install with DNF-3:
# dnf-3 install @deepin-desktop
The other dnf and dnf5 tools didn't work, I didn't wait to check if it's because of the repos. but it did not bring me the packets from the web and shows me transactions of 0 B.

Tuesday, July 25, 2023

Fedora 39 : Install and fix error with dotnet and copr.

Copr is an easy-to-use automatic build system providing a package repository as its output.
Free/Open source software that is harder to include in Fedora (usually because it is developed in a way that makes it difficult to package while implementing the Fedora packaging guidelines) is temporarily provided in an extra COPR repository, see the official webpage.
I tried to install dotnet following a tutorial on Fedora Magazine:
# dnf copr enable @dotnet-sig/dotnet
I obviously received errors related to copr, because is not install and I used Fedora 39, since Fedora 39 is still Rawhide.
I try to install copr with dnf5:
# dnf5 install copr
I got some errors on python-request-2.28.2-2.fc39.noarch conflicts with new one requested by dnf5 and I remove this package and I let to install the new one.
I try again with same command:
# dnf5 install copr
The next command was:
$ sudo dnf copr enable @dotnet-sig/dotnet fedora-38-x86_64
This allow me to use fedora-38-x86_64 and warn me about copr.
Enabling a Copr repository. Please note that this repository is not part
of the main distribution, and quality may vary ...
The last one is to install .NET Core:
# dnf5 install dotnet
This install all packages for .NET Core with SDK version 6.0 .
I tested with a simple project:
$ dotnet new console -o mythcat_console
$ cd mythcat_console
$ dotnet run 
Hello, World!
This is the way that can use Fedora packages with copr.

Saturday, July 8, 2023

Fedora 39 : DNF5 error update.

Sometimes errors may occur when installing Fedora packages using the dnf or dnf5 utility. One of the reasons may result from the coincidence of the package installation process. If you know how to build packages, how to develop the Fedora team, and how many repositories you have set up in your Linux distribution, then such an error can be easily fixed. Here is the error:
First, install the dnf5 and dnf5-plugins with this command:
sudo dnf install dnf5 dnf5-plugins
One good way to fix error is to have defined settings in : /etc/dnf/dnf.conf in order to have a good installation flow and how to link packages to the interconnected job.
See my example that fix this error:
Some packages may conflict in the repo and you can check with the dnf info fedora_repo_package command.
For example, you can use exclude=*.noarch in the [main] area.

Monday, June 26, 2023

News : The new DNF5 tool is on Fedora .

The new DNF5 will provide a significant improvement in user experiences and performance. The replacement is the second step in upgrade of Fedora Software Management stack. Without the change there will be multiple software management tool (DNF5, old Microdnf, PackageKit, and DNF) based on different libraries (libdnf, libdnf5), providing a different behavior, and not sharing a history and module state. We can also expect that DNF will have only limited support from upstream. The DNF5 development was announced on Fedora-Devel list in 2020.
You can read more on the official webpage on Fedora area.