yocto - User-Agent: falling back to 'libdnf': could not detect OS or basearch - embedded-linux

I am using Yocto (Hardknott) to build an image and to create the package-feed(rpm packages). One of the image dependencies is u-boot-karo (it's a custom u-boot for karo modules) and it seems this recipe has some issue with the libdnf. Could anyone help me with this, below you will find more details about the error from the do_rootfs.log
NOTE: ###### Generate rootfs #######
NOTE: Executing '/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/recipe-sysroot-native/usr/bin/createrepo_c --update -q /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo' ...
NOTE: Running /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/yum.repos.d --installroot=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs --setopt=logdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/temp --repofrompath=oe-repo,/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo makecache --refresh
DEBUG: DNF version: 4.6.0
cachedir: /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo
Making cache files for all metadata files.
oe-repo: has expired and will be refreshed.
repo: downloading from remote: oe-repo
oe-repo 343 MB/s | 1.2 MB 00:00
oe-repo: using metadata from Thu 14 Apr 2022 12:20:13 PM UTC.
Last metadata expiration check: 0:00:01 ago on Thu 14 Apr 2022 12:20:13 PM UTC.
User-Agent: falling back to 'libdnf': could not detect OS or basearch
Metadata cache created.
NOTE: Running /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/yum.repos.d --installroot=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs --setopt=logdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/temp --repofrompath=oe-repo,/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo --nogpgcheck install alsa-utils-alsamixer alsa-utils-amixer alsa-utils-aplay amr-ipconfig avahi-daemon avahi-utils avahiservice bash canutils coreutils dhcpcd dosfstools e2fsprogs e2fsprogs-resize2fs file gdbserver i2c-tools initscript kernel-modules kmod ldd less libgpiod libgpiod-tools libstdc++ lsof mmc-utils ncurses nfs-utils nginx ntp ntpdate packagegroup-base-extended packagegroup-core-boot packagegroup-core-ssh-openssh parted psplash rauc rsync run-postinsts ssh-keys strace sudo systemd tcp-wrappers tzdata u-boot-karo ufw util-linux util-linux-fsck util-linux-mkfs util-linux-mount util-linux-setterm locale-base-de-de
ERROR: Could not invoke dnf. Command '/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/etc/yum.repos.d --installroot=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs --setopt=logdir=/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/temp --repofrompath=oe-repo,/amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo --nogpgcheck install alsa-utils-alsamixer alsa-utils-amixer alsa-utils-aplay amr-ipconfig avahi-daemon avahi-utils avahiservice bash canutils coreutils dhcpcd dosfstools e2fsprogs e2fsprogs-resize2fs file gdbserver i2c-tools initscript kernel-modules kmod ldd less libgpiod libgpiod-tools libstdc++ lsof mmc-utils ncurses nfs-utils nginx ntp ntpdate packagegroup-base-extended packagegroup-core-boot packagegroup-core-ssh-openssh parted psplash rauc rsync run-postinsts ssh-keys strace sudo systemd tcp-wrappers tzdata u-boot-karo ufw util-linux util-linux-fsck util-linux-mkfs util-linux-mount util-linux-setterm locale-base-de-de' returned 1:
DNF version: 4.6.0
cachedir: /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /amr-bsp/build/tmp/work/amr1-poky-linux-gnueabi/amr-image-dev/1.0-r0/oe-rootfs-repo
User-Agent: falling back to 'libdnf': could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Thu 14 Apr 2022 12:20:13 PM UTC.
Last metadata expiration check: 0:00:01 ago on Thu 14 Apr 2022 12:20:13 PM UTC.
No match for argument: u-boot-karo
Error: Unable to find a match: u-boot-karo

Related

Docker Ubuntu image can't find /bin/sh

I'm trying to run a script in a docker image and I keep getting the following error
Step 4/4 : RUN ./config.sh /config.sh
---> Running in a0739624bcb7
failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
My docker file is based upon Ubuntu, so I'm unsure why this error even occurs, I found a lot of these issues because people use scratch
FROM ubuntu:20.04
ENV ACCESS_TOKEN ""
COPY ./config.sh /config.sh
RUN /config.sh $ACCESS_TOKEN
I tried so many things, and it just doesn't make sense, I tried docker rmi ubuntu and docker system prune in case this would be a corruption of the image, but to no avail.
With that being said, I'm still able to do the following, so any insight is welcome
docker run -it ubuntu:20.04 /bin/sh
docker run -it ubuntu:20.04 /bin/bash
Also, my script has a shebang for /bin/bash, so why is the issue with /bin/sh
I'm now running into the same problem when using FROM ubuntu:20.04.
Using FROM ubuntu:18.04 or FROM phusion/baseimage:18.04-1.0.0-amd64 both work OK with my dockerfile.
Output when creating the docker image:
Sending build context to Docker daemon 301.5MB
Step 1/3 : FROM ubuntu:20.04
20.04: Pulling from library/ubuntu
eaead16dc43b: Pull complete
Digest: sha256:450e066588f42ebe1551f3b1a535034b6aa46cd936fe7f2c6b0d72997ec61dbd
Status: Downloaded newer image for ubuntu:20.04
---> 680e5dfb52c7
Step 2/3 : COPY . /
---> 8623e2ab9bb0
Step 3/3 : RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y --no-install-recommends libprotobuf17 libjson-c4 libpcap0.8 iproute2 ethtool pciutils inotify-tools python3-pip libnuma1 gdb libgoogle-perftools-dev rsyslog && pip3 install requests && ln -s /usr/bin/python3 /usr/bin/python && apt-get clean && rm -rf /var/lib/apt/lists/* && echo apt-get DONE
---> Running in 3e0fffb2b1fd
failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
From docker info:
Server Version: 20.10.17
Kernel Version: 5.4.0-131-generic
Operating System: Ubuntu Core 18
Running on a VM with:
Linux ubuntu-dev3 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
ixia#ubuntu-dev3:~/git/GSC/next_gen_gsc/GscApp$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
As MathieuAuclair stated, I can also just run the ubuntu:20.04 image by itself and it it is OK.
I can execute /bin/sh and /bin/bash from inside the container.

Clickhouse is not starting

After installing clickhouse using rpm packages ,we got an issue with starting of clickhouse.
Below are the steps we followed for installation:
Download all the required packages on one particular location for eg: /opt/clickhouse using below commands
# mkdir /opt/clickhouse
# cd /opt/clickhouse # wget http://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-common-static-18.12.17-2.x86_64.rpm #wget http://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-server-base-18.12.17-2.x86_64.rpm #wget http://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-server-common-18.12.17-2.noarch.rpm #wget http://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-server-18.12.17-2.noarch.rpm #wget http://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-client-18.12.17-2.noarch.rpm
Now the above 5 packages will be available in the given location. Then we have to install the packages one after the other in the below order with the following commands.
# rpm -ivh clickhouse-common-static-18.12.17-2.x86_64.rpm
# rpm -ivh clickhouse-server-base-18.12.17-2.x86_64.rpm
# rpm -ivh clickhouse-server-common-18.12.17-2.noarch.rpm
# rpm -ivh clickhouse-server-18.12.17-2.noarch.rpm
# rpm -ivh clickhouse-client-18.12.17-2.noarch.rpm
Below is the error message.
systemctl status clickhouse-server
clickhouse-server.service - ClickHouse Server (analytic DBMS for big
data) Loaded: loaded (/etc/systemd/system/clickhouse-server.service;
disabled; vendor preset: disabled) Active: failed (Result: exit-code)
since Mon 2019-07-08 19:36:24 +08; 54min ago Process: 23939
ExecStart=/etc/init.d/clickhouse-server
--config=/etc/clickhouse-server/config.xml (code=exited, status=2)
Please help us
It worked for me by using the below command and the logs are also generating now:
sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml
The following command solved the problem for me:
sudo ./clickhouse install
This command rebuilds damaged or lost clickhouse files

Iptables v1.6.1 can't initialize iptables table `filter' Ubuntu 18.04 Bash Windows

I'm running Ubuntu 18.04 from Windows Bash:
uname -a
Linux DESKTOP-M87DGAS 4.4.0-17134-Microsoft #112-Microsoft Thu Jun 07 22:57:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
I need to open some port with:
sudo ufw allow 22/tcp
But I get the following error:
ERROR: initcaps
[Errno 2] iptables v1.6.1: can't initialize iptables table `filter': Table
does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
I get the same error by typing:
iptables -L
I've already upgrade my kernel with:
sudo apt-get update
sudo apt-get full-upgrade
I've tried to reboot the system but it didn't work.
How can I initiate the iptable filter?
According to the Microsoft WSL page on github.com, iptables isn't supported.
https://github.com/Microsoft/WSL/issues/767
There is a uservoice page for requesting support at
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/32025199-support-iptables
Windows restrict that command in WSL without authorization from administrator.
You just have to run WSL on CMD/Powershell/Ubuntu.exe as administator, then try this command again:
sudo iptables -L -v
I tested on WSL v1, but it should also work on WSL v2.

How to upgrade OpenSSH from 6.6.1p1 to version 7.2p2 on Amazon Linux?

How to upgrade OpenSSH from 6.6.1p1 to version 7.2p2 on Amazon Linux?
The upgrade is required to fix "OpenSSH Xauth Command Injection" vulnerability.
Pasting from Scan results from https://pci.qualys.com:
Result: SSH-2.0-OpenSSH_6.6.1 detected on port 22 over TCP.
Proposed Solution: "Users are advised to upgrade to the latest version of the software available. Refer to OpenSSH 7.2p2 Release Notes for further information."
1)Linux version
ec2-user#demotair.arabidopsis.org$ uname -a
Linux ip-172-31-24-127 4.9.38-16.33.amzn1.x86_64 #1 SMP Thu Jul 20 01:31:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
2) Current ssh version on it:
ec2-user#demotair.arabidopsis.org$ ssh -V
OpenSSH_6.6.1p1, OpenSSL 1.0.1k-fips 8 Jan 2015
ec2-user#demotair.arabidopsis.org$ yum list | grep openssh
openssh.x86_64 6.6.1p1-33.66.amzn1 #amzn-updates
openssh-clients.x86_64 6.6.1p1-33.66.amzn1 #amzn-updates
openssh-server.x86_64 6.6.1p1-33.66.amzn1 #amzn-updates
openssh-keycat.x86_64 6.6.1p1-33.66.amzn1 amzn-main
openssh-ldap.x86_64 6.6.1p1-33.66.amzn1 amzn-main
3) Attempt to update results in "No packages marked for update"
ec2-user#demotair.arabidopsis.org$ sudo yum update openssh
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.3 kB 00:00:00
No packages marked for update
PS Below links did not help me to upgrade:
https://forums.aws.amazon.com/thread.jspa?messageID=679779#679779 "OpenSSH 7 is not available via yum update"
https://serverfault.com/questions/749199/updating-openssh-on-amazon-linux-amazon-repository-out-of-date
quote: "Until Amazon updates its package, you can stop the bug from affecting you by adding the line UseRoaming no to /etc/ssh/ssh_config on any machine from which you will be using the ssh client."
There's no need. As was stated in the question to which you have linked, Amazon backports security fixes, and your scanner is giving a false positive by testing for the version number rather than actually testing for the presence of the vulnerability. CVE-2016-3115 was fixed in Amazon openssh version 6.6.1p1-23.60 on 16 March 2016.

Installing mongodb in mac

I am trying to install mongodb on my system and following these steps(http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/) in doing so. I have installed Homebrew and MacPorts and have installed the mongodb using both Homebrew and MacPorts. But when i type mongod:
I get this:
mongod --help for help and startup options
Sun Sep 9 20:58:35 [initandlisten] MongoDB starting : pid=6381 port=27017 dbpath=/data/db/ 64-bit host=Cs-MacBook-Pro.local
Sun Sep 9 20:58:35 [initandlisten] db version v2.0.7, pdfile version 4.5
Sun Sep 9 20:58:35 [initandlisten] git version: nogitversion
Sun Sep 9 20:58:35 [initandlisten] build info: Darwin Cs-MacBook-Pro.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Sun Sep 9 20:58:35 [initandlisten] options: {}
Sun Sep 9 20:58:35 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
Sun Sep 9 20:58:35 dbexit:
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to close listening sockets...
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to flush diaglog...
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to close sockets...
Sun Sep 9 20:58:35 [initandlisten] shutdown: waiting for fs preallocator...
Sun Sep 9 20:58:35 [initandlisten] shutdown: lock for final commit...
Sun Sep 9 20:58:35 [initandlisten] shutdown: final commit...
Sun Sep 9 20:58:35 [initandlisten] shutdown: closing all files...
Sun Sep 9 20:58:35 [initandlisten] closeAllFiles() finished
Sun Sep 9 20:58:35 dbexit: really exiting now
When i type mongo, i get this:
MongoDB shell version: 2.0.7
connecting to: test
Sun Sep 9 20:58:39 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed
Need some help on this...
Create a folder /data/db/ in /. This is where MongoDB stores all its data. Then make sure it’s readable and writable by MongoDB using chown or ⌘I in the Finder.
I hate to add another answer because the current answer works, but I can't comment that answer so..
You can create the required data directory and give it the same permissions as the user you are logged into OS X as using the following:
sudo mkdir -p /data/db
sudo chown `id -u` /data/db
Then you can fire up mongod using
./path/to/mongod
The other answers did not have the data directory for me (Mac OS Mavericks, Mongo (2.4.x)
The mongo data directory in Mac OS is located
/usr/local/var/mongodb
The answers above are surely good enough but I would also like to give a tip here.
What I would do is:
Download the respective binaries from mongodb site's download section.
Unarchive it in some folder, like /opt/mongo
Then add the path to the $PATH variable by adding the below line in .bashrc file PATH="$PATH:/opt/mongo/bin"
Now you can fire up mongod or mongo or mongoexport etc. from command line just like any other command.
I spent quite a while trying to figure out how to install MongoDB and Mongoose. My problem with the new macOS Catalina update, the folder /data/db is read-only, you cannot modify it, so you have to store your database files somewhere else. I had to go through the MongoDB Installation Documentation, which is summarized below.
1. To install xcode, run in your macOS Terminal:
$ xcode-select --install
2. To install brew use the official Homebrew Installation Instructions.
3. To tap the MongoDB Homebrew Tap, run in your macOS Terminal:
$ brew tap mongodb/brew
4. To update Homebrew and all existing formulae:
$ brew update
5. To install MongoDB:
$ brew install mongodb-community#5.0
To start MongoDB, run:
$ brew services start mongodb-community#5.0
To stop MongoDB, run:
$ brew services stop mongodb-community#5.0
To verify that MongoDB is running:
$ brew services list
See How to Start MongoDB on Mac for more help.
To check where your database files are being stored run:
$ sudo lsof -p `ps aux | grep mongodb | head -n1 | tr -s ' ' | cut -d' ' -f 2` | grep REG
When I ran this command it showed that my files are being stored in a hidden file in my harddrive, Macintosh HD. In Finder you can push SHFT + CMD + . to show hidden files. If this command returns file names with a folder called mongodb, then you are good to go.
If your files are still read-only, you can try to overwrite the default storage path with:
$ mongod --dbpath /System/Volumes/Data/data/db
To verify your MongoDB version:
$ mongod --version
Alternative method:
If you don’t like the default /data/db folder, just specify an alternate path with --dbpath
$ mongod --dbpath /any-directory
Here is step which help you to install mongodb on your mac.
1.Download mongodb-osx-x86_64-3.2.6.tgz from server.
https://www.mongodb.org/downloads#production
2.Open terminal.
3.Extract that folder
$ tar xvf mongodb-osx-x86_64-3.2.6.tgz
4.Go to that folder
$ cd mongodb-osx-x86_64-3.2.6
5.$ cd bin
Now goes to root level & enter password
$ sudo bash
Then create data folder
whoami
root
mkdir -p /data/db
chmod 777 /data/db
ls -l /data/db
ls -ld /data/db
drwxrwxrwx 2 root wheel 68 Apr 28 15:04 /data/db
Then exit that root
exit
So now you are in bin folder again, So execute this command
$ ./mongod
So, It will waiting for connection.
Now you can open 2nd new terminal, Go to bin folder
$ cd mongodb-osx-x86_64-3.2.6
$ cd bin
Then try to connect mongo
$ ./mongo
It will connect your DB, So you can insert data
db.names.insert({'name':'piyush'})
Also, Retrive it by
db.names.find()
https://piyushkachariya111.wordpress.com/2016/04/28/installing-mongodb-on-a-mac/
Even I faced the same issue while running the mongodb server.
Process 1: Run the activity monitor and find for the mongodb instance and kill the process and run the command again.
or
Process 2 : Find the \data\db\ data-directory\mongod.lock file, and delete it and run the command
mongod --repair
After that you`ll see the information log with the following message
shutdown: removing fs lock...
Now run the mongodb command.
Hope this will helpful.
Here is the Manual Method to install MongoDB in MAC
1.Download mongodb "mongodb-osx-ssl-x86_64-3.6.5.tgz" file
2.Extract it using the command
$ tar -zxvf mongodb-osx-ssl-x86_64-3.6.5.tgz
3.Create a directory and copy the extracted contents to that
$ mkdir mongodb
$ cp -R -n mongodb-osx-ssl-x86_64-3.6.5.tgz/ mongodb
4.Create a file in home directory named .bash_profile and add the bin path to the same as shown below
export PATH=<mongodb-install-directory>/bin:$PATH
5.Create directory data/db in any root location and add permission to the loggedin user using chown
$ sudo mkdir -p /data/db
$ whoami
LoggedInUser
$ sudo chown LoggedInUser /data/db
If we are using different dbpath instead of /data/db (Developer need to add this each time while execution if we are using different location)
mongod --dbpath <path to data directory>
6.Close and open terminal and verify the working using mongod
$ mongod
7.Connect to mongo using mongo command
$ mongo
You can easily install mongoDB on your local machine using the following steps:
Go to the official website of mongoDB
MongoDB download center
Download the community or enterprise server but make sure to select your operating system for mac it's macOS x64
After downloading the package put it in a folder of your choice preferably in home directory but you can put it in a folder on your desktop but you should not move it if you move it after setting the path you need to change the path again in the following steps I have the downloaded folder in my home directory if you have it somewhere else you need to change the path accordingly
Open your terminal make sure it's bash
In this step you need to tell your machine where it can find the MongoDB commands you have downloaded to do that you need to give the path to your downloaded MongoDB folder it's easy just run in your terminal sudo nano /etc/paths the contents of your paths should appear go to the folder containing your MongoDB folder and right click on this MongoDB folder and click on copy to copy the path to this folder then go to the terminal and paste the copied path in the paths file and add at the end of it /bin because bin will contain all MongoDB shell commands you will be using then press control + x then y(this means you are telling the terminal save my file) to save the changes then enter to quit nano.
close your terminal and reopen it then run mongo --nodb this should start your MongoDB shell and you will have successfully installed MongoDB
To exit the MongoDB shell write exit and press enter

Resources