How to install libapt-pkg.so.5.0 on Ubuntu 20.04 - c

I have a dynamic library that I want to use. However, one of its dependencies is not available on my system:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
I tried installing libapt-pkg, and it seemed to work. Here is the output for installing:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
apt apt-utils libapt-pkg6.0
3 upgraded, 0 newly installed, 0 to remove and 307 not upgraded.
Need to get 2346 kB of archives.
After this operation, 42.0 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.9 [839 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.9 [1294 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt-utils amd64 2.0.9 [213 kB]
Fetched 2346 kB in 2s (1474 kB/s)
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.9_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.9) over (2.0.2) ...
Setting up libapt-pkg6.0:amd64 (2.0.9) ...
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.9_amd64.deb ...
Unpacking apt (2.0.9) over (2.0.2) ...
Setting up apt (2.0.9) ...
Removing obsolete conffile /etc/kernel/postinst.d/apt-auto-removal ...
(Reading database ... 54240 files and directories currently installed.)
Preparing to unpack .../apt-utils_2.0.9_amd64.deb ...
Unpacking apt-utils (2.0.9) over (2.0.2) ...
Setting up apt-utils (2.0.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Note that it says no packages were newly installed, and also note that it lists libapt-pkg6.0 in the output.
However, then I still see that the dependency is not found:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
Also, when I grep for my installed packages, libapt-pkg5.0 does not appear, but for some reason libapt-pkg6.0 does appear:
$ apt list --installed | grep libapt
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapt-pkg6.0/focal-updates,now 2.0.9 amd64 [installed]
If I try to install libapt-pkg5.0 again, it fails, mentioning that it is referred to by another package:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapt-pkg5.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapt-pkg5.0' has no installation candidate
How can I correctly install libapt-pkg5.0 on my Ubuntu 20.04 system?

Related

How to install allure on ubuntu 20 using selenium with python?

I have tried this
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
and get the following results
Reading package lists... Done
Building dependency tree
Reading state information... Done
allure is already the newest version (0.8.3.0-3build3).
The following packages were automatically installed and are no longer required:
gir1.2-dee-1.0 gnome-software-common libaec0 libappstream-glib8 libapt-pkg5.90 libenchant1c2a libfprint0 libgfortran5 libgpod4 libgspell-1-1 libisl21 liblouis17 liboauth0 libqt5script5 librsync2
libwxgtk3.0-0v5 libx265-176 libxmlb1 python3-markupsafe python3-monotonic shim syslinux-legacy
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
version of allure it gives no command found
allure --version
allure: command not found
I had the exact same problem and this solved it for me:
Credit -> allure: command not found on linux
The solution in just three steps:
sudo apt-get install default-jre
wget https://github.com/allure-framework/allure2/releases/download/2.18.1/allure_2.18.1-1_all.deb
sudo dpkg -i allure_2.18.1-1_all.deb

RHEL 8 Container MSSQL ODBC Driver e2fsprogs

I'm trying to build a custom docker container using the RHEL 8 UBI. As part of this I want to install the MSSQL 17 ODBC driver.
I've followed the steps outlined in Microsofts Documentation here:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17
And added the Microsoft repo to my yum.repos.d directory however when I try to build the container I get the following error: nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
When I dug a bit further into this it looks as though it looks as though for RHEL-7 Microsoft suggest installing e2fsprogs manually you can see that here: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#offline-installation
This unfortunately isn't possible in RHEL-8 as e2fsprogs-static has been removed: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
The full output from the build is:
$ docker build -f ./test.dockerfile -t daark:1 .
Sending build context to Docker daemon 25.77MB
Step 1/7 : FROM registry.redhat.io/ubi8/ubi
---> a1f8c9699786
Step 2/7 : RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
---> Using cache
---> 90b3e1514239
Step 3/7 : RUN yum search odbc
---> Using cache
---> b26f78d0da28
Step 4/7 : RUN yum search msodbcsql17
---> Using cache
---> c6f7751b97dc
Step 5/7 : ENV ACCEPT_EULA=Y
---> Using cache
---> 2b0003944673
Step 6/7 : RUN yum install -y unixODBC unixODBC-devel
---> Using cache
---> 1d0b8c594905
Step 7/7 : RUN yum install -y msodbcsql17
---> Running in 67c30e75fb42
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:08:11 ago on Wed Aug 5 09:36:32 2020.
Error:
Problem: cannot install the best candidate for the job
- nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
The command '/bin/sh -c yum install -y msodbcsql17' returned a non-zero code: 1
This error is pretty reproducible here is the test dockerfile i'm using to debug
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum install -y msodbcsql17
Has anyone managed to get this ODBC driver installed on an RHEL 8 UBI based container?
I found a work around that I hope will help the next person to hit this.
Rather than running yum install -y msodbcsql17 I instead used yum to download the RPM
yum download -y msodbcsql17
then used rpm -Uvh --nodeps msodbcsql17*rpm to install it.
You can use this docker file:
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum download -y msodbcsql17
RUN rpm -Uvh --nodeps msodbcsql17*rpm
#daark thank you for posting your solution. Your solution got me over the problem I was facing. I ended modifying your solution to the following (in case it helps anyone else):
FROM registry.access.redhat.com/ubi8/python-38
USER root
RUN yum update --assumeyes && \
yum install --assumeyes \
unixODBC-devel \
&& yum clean all
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum download -y msodbcsql17
RUN ACCEPT_EULA=y rpm -Uvh --nodeps msodbcsql17*rpm
I tried to add this to the #daark's solution as a comment, but it was too difficult to display the code properly.
Good luck to anyone else facing this issue 🍀
Latest msodbcsql17 release fixes this issue. The documentation steps work smooth once again. See docs issue
I can confirm that installation on redhat/ubi8 works with msodbcsql17-17.8.1.2-1.x86_64.rpm.
FROM redhat/ubi8
COPY msodbcsql17-17.8.1.2-1.x86_64.rpm /tmp
RUN MSSQL_PID=Developer ACCEPT_EULA=Y yum -y localinstall /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm; rm /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm

Unable install SQLserver tool in ubuntu 20

I installed SQLserver in my ubuntu. But when I install sqlserver-tool something happened.
type
sudo apt-get install unixodbc-dev
return
eading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc-dev : Depends: unixodbc (= 2.3.7)
Depends: odbcinst1debian2 (= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.
so that I tried below
sudo apt-get install unixodbc
returns
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
Depends: libodbc1 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.
and lastly
sudo apt-get install odbcinst1debian2
return
eading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
odbcinst1debian2 : PreDepends: multiarch-support but it is not installable
E: Unable to correct problems, you have held broken packages.
I completely stacked and have no idea at all.
Dose anybody can help for me. Thanks.
User rim96 has right, the reason is that Microsoft's source list includes unixodbc in higer version (2.3.7) that depends on multi-arch (unlike Ubuntu's version 2.3.6)
I think that unixodbc 2.3.6 is good enough. In my case the follow steps helped me.
Remove Microsoft's source list.
mv /etc/apt/sources.list.d/mssql-tools.list ~/
Update sources
sudo apt-get update
Install unixodbc 2.3.6 from Ubuntu repository
sudo apt-get install unixodbc
Move Microsoft's source list back
mv ~/mssql-tools.list /etc/apt/sources.list.d/
Update sources again
sudo apt-get update
Install mssq-tools (or whatever you want) from Microsoft's repository
sudo apt-get install mssql-tools
User Jiří Chmiel's answer helped a lot, though I changed two lines to:
sudo mv /etc/apt/sources.list.d/msprod.list ~/
and:
sudo mv ~/msprod.list /etc/apt/sources.list.d/
was what worked for me
(Ubuntu 20.04 in Dec '20)
This problems looks like you forgot to run sudo apt-get update before installing odbcinst1debian2. On focal this package does not depend on multiarch-support.
From https://askubuntu.com/questions/1232332/installing-odbcins1debian2-broken-dependency-on-ubuntu-20-04-lts
If you follow Microsoft install guide for SQL Server Tools, for Ubuntu it says
If you are using Ubuntu 18.04 or Ubuntu 20.04, change the repository path in step 2 below from /ubuntu/16.04 to /ubuntu/18.04 or /ubuntu/20.04
So in step 2, you should do
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
instead of
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Installing TinyTeX in a Singularity container

I'm writing a paper in RMarkdown and for better reproducibility, I want to containerize all required software in a singularity container. Unfortunately, when I try to install TinyTeX (which is recommended for Rmarkdown and I would prefer over TeXLive to not inflate the container more than needed), it fails with the following error message (the full build log is pasted here):
Can't locate TeXLive/TLConfig.pm in #INC (you may need to install the TeXLive::TLConfig module) (#INC contains: /~/.TinyTeX/texmf-dist/scripts/texlive /~/.TinyTeX/tlpkg /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
BEGIN failed--compilation aborted at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
This is the build definition file, basically it uses a very slimmed down ubuntu 18.04 and then executes the %post section to install software
BootStrap: library
From: ubuntu:18.04
%post
# Add universe repository
echo "deb http://us.archive.ubuntu.com/ubuntu bionic universe" >> /etc/apt/sources.list
apt -y update
# Install utilites
apt install -y wget
# Install R
apt install -y r-base-core
## Install RMarkdown and TinyTeX
R --slave -e 'install.packages(c("rmarkdown","tinytex")); tinytex::install_tinytex()'
# Clean
apt-get clean
%environment
export LC_ALL="en_US.UTF-8"
%labels
Author DP
I have also tried tinytex::install_tinytex(dir="/opt/tinytex") but that didn't seem to change anything. Does anyone have an idea what's wrong?
That error message is complaining that your image (or, more likely, your path) is missing the TeXLive::TLConfig perl module.
My guess is that the path contents are not being rehashed with the installed modules after the install. The simplest solution is to break it into two commands:
R --slave -e 'install.packages(c("rmarkdown","tinytex"))'
R --slave -e 'tinytex::install_tinytex()'
Installation succeeds when I try that locally.
A potentially useful alternative, if the image is just for document generation, could be converting a docker image with rmarkdown and tex (e.g. https://hub.docker.com/r/rocker/verse) to a singularity one.
With singularity pull docker://rocker/verse you can do that for the latest version, or for a specific version with verse:version_number.

Unable to locate package mssql-server

I'm trying to install MSSQL # Ubuntu 16.04 (as recommended # https://learn.microsoft.com/en-US/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017)
But that's the error I'm currently facing E: Unable to locate package mssql-server
test#test-VirtualBox:~$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
test#test-VirtualBox:~$ sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
test#test-VirtualBox:~$ sudo apt-get update
Hit:1 http://pl.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://pl.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://pl.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017 xenial InRelease
Reading package lists... Done
test#test-VirtualBox:~$ sudo apt-get install -y mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mssql-server
What I'm doing wrong?
I've been trying many various Google queries like unable to locate package *mssql-server* site:github.com but nothing really solves my problem.
Thanks in advance
You may need to check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit. The packages for mssql-server are 64-bit only, and will be ignored on a 32-bit install.
check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit or ARM The packages for mssql-server are 64-bit only and it wont works with any ARM or 32 bit

Resources