High version qemu-mipsel could not find libs automatically - mips

System info
kernel:Linux ubuntu 5.4.0-121-generic #137~18.04.1-Ubuntu SMP Mon Jun 20 07:25:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
Default version of qemu installed by apt will cause system error when using gdb-multiarch to debug mips executable files. So i'm trying to compile the source codes.
I've installed re2c, ninja and some packages, which are the dependency of qemu.
wget https://github.com/skvadrik/re2c/releases/download/3.0/re2c-3.0.tar.xz
tar -xvzf re2c-1.0.1.tar.gz
cd re2c-1.0.1/
./configure
make -j4
sudo make install
cd ..
git clone https://github.com/ninja-build/ninja.git
cd ninja
./configure.py --bootstrap
sudo cp ninja /usr/bin/
ninja --version
cd ..
sudo apt install build-essential zlib1g-dev pkg-config
sudo apt install libglib2.0-dev binutils-dev libboost-all-dev libssl-dev
sudo apt install libpixman-1-dev libfdt-dev libsdl2-dev
Then i'd like to build qemu statically and get executable like qemu-mipsel(which are static linked so i rename the files with -static suffix). But when i was trying to run any mips executable file, i got error below.
$ ./qemu-mipsel-static (mips_file_name)
qemu-mipsel-static: Could not open '/lib/ld.so.1': No such file or directory
I'm sure that the arch and endian is right. And i copied related lib files in /usr/mipsel-linux-gnu/lib to current directory and using option -L to specify the lib file path. I got the same result.
And i tried the version installed by apt, It can run smoothly.
Commands for installing qemu via apt are as followed.
sudo apt-get install qemu
sudo apt-get install qemu-user-static
sudo apt-get install qemu-system
sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
However, as for the higher version of qemu compiled by source code, when i was tring commands below, it can run smoothly.
chroot . ./qemu-mipsel-static (mips file)
I wonder the reason and how to correctly run the file using ./ and chroot two ways. Thanks for your help!

Related

Can't install older version 1.8.27 of Geth on Ubuntu 16.04

I have tried
sudo apt-get install ethereum
sudo apt-get install ethereum=VERSION
And
sudo apt-get upgrade ethereum
To install a specific version of Geth but I can't.
An older version of Geth can be installed using tar file, here I am using version 1.8.16. To download the required Geth file, we need to check the OS version using the following command.
> dpkg --print-architecture
amd64
Once you have your OS information, download (amd64 tar in our case) file from the Geth website.
Upload downloaded tar file on a server and extract using the following command:
sudo tar -xvf <filename>
In our case,
sudo tar -xvf geth-linux-amd64-1.8.16-477eb093.tar.gz
Step into extracted folder
cd geth-linux-amd64-1.8.16-477eb093
It should contain the geth file, make it executable with the below command.
sudo chmod +x geth
Copy file to the user bin.
sudo cp geth /usr/local/bin/
Check the Geth version with the following command
> geth version
Version: 1.8.16-stable
Geth is now installed successfully on the system
Ref: How To Install Geth On A Linux Machine
You can get the older versions from here:
https://github.com/ethereum/go-ethereum/releases
To install ethereum on Ubuntu type the following commands into your CLI:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt update
Once this is done type:
sudo apt install ethereum

Installing Connector C for Mariadb

So, I want to use Mariadb. There is this Connector-C for it.
https://downloads.mariadb.org/connector-c/
How do I install it? Quiet frankly, the documentation for it is horrible. Even the src file for 3.0.5 is linked to 3.0.4 page.
I did not find a way to install the binary, and the documentation for building from src is quiet vague. I would prefer to know how to install both ways (binary and build from source)
I'm using CentOS7 64bit.
The easiest way to install it would be to use the MariaDB package repository.
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo yum -y install MariaDB-devel
As for building from source, these steps should work on CentOS 7.
sudo yum -y install git gcc openssl-devel make cmake
git clone https://github.com/MariaDB/mariadb-connector-c.git
mkdir build && cd build
cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
And for Ubuntu 20.04...
sudo apt-get install libmariadb3 libmariadb-dev
Raspberry Pi OS
cd to preferred build location. Then install (thanks to #markusjm!):
sudo apt install git gcc make cmake libssl-dev
git clone https://github.com/MariaDB/mariadb-connector-c.git
mkdir build && cd build
cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
Then add installation directory to LD_LIBRARY_PATH. Note: my installation directory is /usr/lib/mariadb. If you cannot find this after your installation, search for e.g. libmariadb.so, a file that should reside in your installation folder.
export LD_LIBRARY_PATH=/usr/lib/mariadb:$LD_LIBRARY_PATH
Afterwards you can finally pip3 install mariadb, if, like me, you tried to do that in the first place.
After you download MariaDB Connector/C, untar and cd. Then mv the executable first.
sudo mv -f bin/mariadb_config /usr/bin/
Now you can execute mariadb_config and will know where to put header and library files to build wheel for mariadb.
For example,
Ubuntu 18.04
sudo mv -f include/mariadb /usr/local/include/
sudo mv -f lib/mariadb /usr/local/lib/
CentOS 7 & Ubuntu 20.04
sudo mv -f include/mariadb /usr/include/
sudo mv -f lib/mariadb /usr/lib/
Finally, you could pip install mariadb. (Or, export CFLAGS=-std=c99 may help.)
After, in the case you cannot import mariadb,
export LD_LIBRARY_PATH=/PATH/TO/where/you/mv/lib/mariadb

cuda 9 packages no longer required after installation

I installed CUDA 9 from the local deb but afterwards apt reports:
The following packages were automatically installed and are no longer required:
cuda-command-line-tools-9-0 cuda-core-9-0 cuda-cublas-9-0 cuda-cublas-dev-9-0 cuda-cudart-9-0 cuda-cudart-dev-9-0
cuda-cufft-9-0 cuda-cufft-dev-9-0 cuda-curand-9-0 cuda-curand-dev-9-0 cuda-cusolver-9-0 cuda-cusolver-dev-9-0
cuda-cusparse-9-0 cuda-cusparse-dev-9-0 cuda-documentation-9-0 cuda-driver-dev-9-0 cuda-libraries-9-0
cuda-libraries-dev-9-0 cuda-license-9-0 cuda-misc-headers-9-0 cuda-npp-9-0 cuda-npp-dev-9-0 cuda-nvgraph-9-0
cuda-nvgraph-dev-9-0 cuda-nvml-dev-9-0 cuda-nvrtc-9-0 cuda-nvrtc-dev-9-0 cuda-samples-9-0 cuda-toolkit-9-0
cuda-visual-tools-9-0 freeglut3 freeglut3-dev libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libx11-xcb-dev
libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-shape0-dev
libxcb-sync-dev libxcb-xfixes0-dev libxmu-dev libxmu-headers libxshmfence-dev libxxf86vm-dev linux-headers-4.10.0-38
linux-headers-4.10.0-38-generic linux-image-4.10.0-38-generic linux-image-extra-4.10.0-38-generic mesa-common-dev
nvidia-modprobe x11proto-dri2-dev x11proto-gl-dev x11proto-xf86vidmode-dev
Use 'sudo apt autoremove' to remove them.
nvcc --version reports V9.0.176 and I have the following in /usr/local:
$ ls /usr/local/cuda-*
/usr/local/cuda-8.0:
bin samples
/usr/local/cuda-9.0:
bin extras lib64 libnvvp nsightee_plugins nvvm samples src tools
doc include libnsight LICENSE nvml README share targets version.txt
What did I do wrong?
I could not determine why the CUDA 9.0 packages were "no longer required", but I went ahead and removed all old packages and then installed CUDA 9.1 from the local deb linked in my question.
sudo apt autoremove
sudo apt --purge remove cuda-repo-ubuntu1704-9-0-local
sudo dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub
sudo apt update
sudo apt install cuda
And then I verified /usr/local/cuda-9.1/bin was in my $PATH, and I added export PATH=$PATH:/usr/local/cuda-9.1/bin to my ~/.bashrc.

Error installing MYSQL 5.7 using Yum

I am beginner in installing mysql using YUM and I have looked into various forums, I don't understand why I am getting the following error.
Loaded plugins: fastestmirror, langpacks
Cannot open: mysql57-community-release-el7-3.10.0-229.el7.x86_64.noarch.rpm.
Skipping.
Nothing to do
I did further analysis by executing following commands but still it didnt work.
sudo rm -f /var/lib/rpm/__*
sudo rpm --rebuilddb -v -v
Some further details:
Linux version: Linux lptxukgcs06 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
The user which I am using has sudo priviledges.
Yum Command: sudo yum localinstall mysql57-community-release-el7-3.10.0-229.el7.x86_64.noarch.rpm
Thank you for your time.
The command for installing RPM packages is:
rpm -ivh mysql57-community-release-el7-3.10.0-229.el7.x86_64.noarch.rpm
or
sudo rpm -ivh mysql57-community-release-el7-3.10.0-229.el7.x86_64.noarch.rpm (root password required)
to uninstall, it is:
sudo rpm -e
And to see if package is installed:
rpm -q
Issue was: The .rpm file should be renamed with your linux server version number after you download from mysql website. Rename the file and execute the command: sudo yum localinstall mysql57-community-release-el7-3.10.0-229.el7.x86_64.noarch.rpm.
You can get the version from linux using: uname -a

Unable to install the Elastic Beanstalk CLI on Ubuntu

I am trying to install the Elastic Beanstalk CLI (awsebcli) on a fresh Ubuntu 14.04 (on Linux subsystem for Windows) using sudo pip install awsebcli, but launching the eb command just returns the following error:
flavien#XPS-FLAVIEN:~$ eb
Traceback (most recent call last):
File "/usr/local/bin/eb", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3036, in <module>
#_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 654, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'termcolor==1.1.0' distribution was not found and is required by awsebcli
Any idea what might be going wrong?
You can reinstall awsebcli with below command if you have issues after installing it:
sudo pip3 install awsebcli --force-reinstall --upgrade
Once its installed check where its installed:
which eb
$ /usr/local/bin/eb #i got eb installed in this path
Next set the path:
export PATH=/usr/local/bin:$PATH
Then run
eb --version
EB CLI 3.14.6 (Python 3.5.2) #this is my installed version
First install the pip separably and try with this command
pip install --upgrade --user awsebcli
I had awsebcli being installed for Python 2.7 but for some reason running eb needed them for Python 3.x so doing this worked :
$ sudo -H pip3 install --upgrade --user awsebcli
After installing all the required wheels eb worked fine :
$ eb --version
EB CLI 3.14.3 (Python 3.5.2)
Also don't forget to add ~/.local/bin to your PATH variable in ~/.bash_profile
The previous answer helped me to figure this one out.
My detail, I had to install a newer version of python than 2.7, one that supported the --trusted-host switch to allow me to get all of my dependencies:
What I ran:
pip --cert zxroot.pem --trusted-host pypi.python.org --proxy [ProxyServer] install --upgrade --user awsebcli
Once I ran that reinstall using the --upgrade switch, eb finally worked:
eb --version
EB CLI 3.10.5 (Python 3.3.1)
I know this is very specific to my particulars but it might help someone else.
Good luck.
The problem is you are missing quite a few applications required by the scripts to compile.
The following installation steps are required prior to running the EB CLI scripts.
As I'm a windows user I created a clean VirtualBox VM install of Ubuntu 18.04.2
Update Ubuntu
sudo apt update
sudo apt upgrade
sudo reboot
Install curl,wget
sudo apt install curl
sudo apt install wget
Install zlib
sudo apt-get install zlib1g-dev
Install libffi
sudo apt-get install libffi libffi5-dev
Install OpenSSL
sudo apt-get install libssl-dev
Install gcc
sudo apt-get install build-essential
sudo apt install libx11-dev
gcc --version
make -v
Install Python 3.7
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7
python3.7 --version
alias python='python3.7'
Install Git
sudo apt install git
After this run the EB CLI
You should see these 5 successful progress steps
Creating exclusive virtualenv for EBCLI
Activating virtualenv
Installing EBCLI
Creating EB wrappers
Finishing up
Success!
Try This:
sudo chown -R username:username ~/.local/
# add to ./*shrc
export PATH=$PATH:~/.local/bin/
pip install --upgrade --user awsebcli
eb --version
#EB CLI 3.10.1 (Python 2.7.1)