Installing .NET SDK on Ubuntu produces no executable dotnet file - linux

Installing .NET SDK on Ubuntu 20.04 with the commands listed in the Install .NET on Ubuntu docs:
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
produces no dotnet executable.
Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk
Listing files from the package:
dpkg -L dotnet-sdk-6.0 | grep -P "dotnet$"
gives
/usr/share/dotnet
The /usr/share/dotnet directory contains no executable. I compared this result with my other Ubuntu installation where I installed dotnet ages ago, and there it is installed in /usr/share/dotnet but there exists a /usr/share/dotnet/dotnet executable.
What am I doing wrong? How to install dotnet on Ubuntu with APT?
Using snap is not an option.

sudo apt reinstall dotnet-host and then sudo apt install dotnet-sdk-6.0 fixed the issue.
See: https://github.com/dotnet/installer/issues/12939

dpkg -S /usr/bin/dotnet says that it was created by dotnet-host.
So maybe that package is missing in dotnet-sdk-6.0 and must be installed separately. I imagine they will fix it in some future version.
tl;dr $ sudo apt install dotnet-host

Related

Getting an error when installing the .Net 5 Runtime on Armbian (on an Orange Pi Zero)

I'm trying to install the .Net 5 Runtime on Armbian Focal (Ubuntu 20.04) or Buster (Debian 10), running on an Orange Pi Zero.
So I followed Microsoft's instructions here:
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
but on the last step:
sudo apt-get install -y aspnetcore-runtime-5.0
I get this error:
E: Unable to locate package aspnetcore-runtime-5.0
E: Couldn't find any package by glob 'aspnetcore-runtime-5.0'
E: Couldn't find any package by regex 'aspnetcore-runtime-5.0'
I then followed Microsoft's suggestion for installing it manually from here:
https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#apt-troubleshooting
But on the last step, again I get the same error.
Any ideas?
In summary, these are the steps I tried first:
wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-5.0
and these are the steps I tried when the above failed:
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y gpg
wget -O - https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/{os-version}/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-5.0
EDIT:
I've previously installed the .Net Core 3.1 Runtime on this exact same setup without any issues. I'm not sure if there is something in .Net 5 that is different which won't allow me to install it
From the first URL you linked: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
Package manager installs are only supported on the x64 architecture. Other architectures, such as ARM, must install .NET by some other means such as with Snap, an installer script, or through a manual binary installation.
A Pi is an ARM device, so the installation method you are trying to use is not supported.

Setting Up a Debian Docker image with older boost library

I have an already compiled Linux app which has become dated. To use it, I want to create a Docker image and an appropriate environment to work with. My problem is that is app requires an older version of the boost libraries. 1.57.0 to be specific.
I have been able to get boost installed (I believe correctly) but the app errors out.
The error that I am getting is:
undefined symbol: _ZN5boost15program_options3argE
I am hoping someone has experience with this. Briefly, my pipeline is:
get the rocker/verse Docker image that has Debian and R and some more goodies I need.
Bash in to it, apt-get install ... etc.
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev libboost-all-dev
cd home
wget -O boost_1_57_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download
tar xzvf boost_1_57_0.tar.gz
cd boost_1_57_0
./bootstrap.sh --with-libraries=atomic,chrono,context,coroutine,container,date_time,exception,filesystem,graph,graph_parallel,iostreams,locale,log,math,mpi,program_options,python,random,regex,serialization,signals,system,test,thread,timer,wave
./b2 toolset=gcc cxxflags=-std=gnu++0x
sudo ./b2 install
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
-----Edit: added additional bash code that was missing here
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf’

How to reinstall the latest cmake version?

I would like to install cmake the latest version, on Linux environment. I have cmake version 3.5 installed and is not supported by some applications. I tried to upgrade it by uninstalling the current version. But when I reinstall with sudo apt-get install cmake, I get the same version 3.5 re-installed. How do I install the latest version with sudo apt-get install ....?
As far as I know the best way to get the latest CMake version installed on any Linux is not by apt but using pip.
Remove the apt cmake and install the latest version from pip which can easily keep up-to-date.
apt remove cmake -y
pip install cmake --upgrade
Edit: As GNUton has pointed out, the following only works on Ubuntu 16.04 and 18.04(Checked on June 2019).
Now CMake developer team in Kitware Inc provides APT repositiory. It allows you to install latest CMake via apt-get.
If you are using a minimal Ubuntu image or a Docker image, you may need to install the following packages:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg \
software-properties-common wget
Obtain a copy of our signing key:
wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc |
sudo apt-key add -
Add the repository to your sources list and update.
For Ubuntu Bionic Beaver (18.04):
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt-get update
For Ubuntu Xenial Xerus (16.04):
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt-get update
... Optional steps. See details in reference.
... Optional steps. See details in reference.
Now call
sudo apt-get install cmake
Reference: Kitware APT Repository.
You can try the following steps that have worked for me on Ubuntu 18.04.3 LTS as OS of the NVIDIA jetson Nano to get the last version of cmake "cmake-3.14.0" from https://cmake.org/download/.
Delete the installed version in your system
sudo apt purge cmake
Download cmake3.13.4 source
wget https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4.tar.gz
Extract files
tar zxvf cmake-3.13.4.tar.gz
Execute the following commands in this order to build it
cd cmake-3.13.4
sudo ./bootstrap
sudo make
sudo make install
Verify the version is installed correctly
cmake --version
Following the comments made on how to Install the latest CMake version and to post the answer for this question:
Ans:
This depends with Ubuntu OS version currently installed on your PC or Mac. If you have the following Ubuntu OS version then you have this CMake installed or that you could install and reinstall with "sudo apt-get install cmake". Even if you uninstall your version and try to reinstall later version.
Ubuntu 16.04 ships with cmake-3.5.1
Ubuntu 17.10 ships with cmake-3.9.1
Ubuntu 18.04 ships with cmake-3.10.2
Ubuntu 20.04 ships with cmake-3.16.3
Ubuntu 21.04 ships with cmake-3.18.4
Now if you have Ubuntu 16.04 installed and you want cmake-3.10, there is OS problem since you can only install and reinstalled cmake-3.5.1. To get cmake-3.10 or any other version, you have to download and install the package from https://packages.ubuntu.com/. Once you find the latest version of cmake .targz files, you have to build it yourself from the command line.
For CentOS/RHEL you can help these following steps:
yum -y install python-pip
pip install cmake --upgrade
If you are using Google Colab like me and wanted a higher version of cmake in it. Then do the following,
!pip uninstall cmake
!pip install cmake
This will install cmake 3.22 instead of the default version 3.12
pip install cmake --upgrade
if the following occurs after cmake .. :
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/.../.../...
CMake Error: Error executing cmake::LoadCache(). Aborting.
then try
hash -r
the following worked for me:
sudo apt remove cmake
pip install cmake --upgrade
then, I exited the terminal and again entered to check the version with cmake --version command
3.20.5 in ubuntu 16.04
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
sudo apt install cmake cmake-qt-gui cmake-curses-gui
yum remove cmake
wget https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4.tar.gz
tar zxvf cmake-3.13.4.tar.gz
cd cmake-3.13.4
sudo ./bootstrap --prefix=/usr/local
sudo make
sudo make install
vi ~/.bash_profile
...
# PATH=$PATH:$HOME/bin
PATH=/usr/local/bin:$PATH:$HOME/bin
export PATH
source ~/.bash_profile
cmake --version
vi ~/.bash_profile
centos7 it help me
In case someone still finds it hard to remove cmake from their machine.
This command works for me (requires sudo permissions):
$ sudo find / -name "cmake" | xargs -I % sudo rm -rf "%"

Ubuntu 16.04 error with apt-get

Yesterday I updated Ubuntu from 14.04 to 16.04, when I tried to install git, I got this error:
The package linux-headers-4.4.0-65 needs to be reinstalled, but I
can't find an archive for it.
Then I tried to install another software, to the same error.
First you need to
sudo apt-get update
Then
sudo apt-get install git
I had a similar problem on Kali-Linux once. The thing that worked for me was:
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update && sudo apt-get dist-upgrade

Wine 1.9.24 on Centos 7

The problem
When I try to start any windows program I get no error and nothing happens. I tried on 3 different machines with Centos 7. Also tried older versions of Wine. Tested with winbox.exe from Mikrotik and with putty.exe. What could be the problem?
$ ./wine winbox.exe
$
CentOS 7 version
$ cat /etc/*elease | grep "release" | head -1
CentOS Linux release 7.3.1611 (Core)
Kernel version
$ uname -r
3.10.0-514.2.2.el7.x86_64
Openbox version
$ openbox --version | grep "Openbox"
Openbox 3.5.2
Wine install steps
sudo yum clean all
sudo yum update -y
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y libX11-devel freetype-devel zlib-devel libxcb-devel libxml2-devel libxslt-devel libjpeg-devel gnutls-devel flex bison
cd /tmp
wget http://dl.winehq.org/wine/source/1.9/wine-1.9.24.tar.bz2
tar xjf wine-1.9.24.tar.bz2
cd wine-1.9.24
./configure --enable-win64
make -j4
and the executable is working
$ ./wine --version
wine-1.9.24
wine-2.0-rc3
Had no time to try the latest Wine 2.0 version, but all my problems are gone with wine-2.0-rc3. Tested only 32bit install. Step by step:
sudo yum clean all
sudo yum update -y
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y libX11-devel freetype-devel zlib-devel libxcb-devel libxml2-devel libxslt-devel libjpeg-devel gnutls-devel flex bison
sudo yum install -y samba-winbind samba-winbind-clients samba-winbind-modules libwbclient-devel mod_auth_ntlm_winbind
# OpenGL support
sudo yum install mesa-dri-drivers.i686 mesa-libGL.i686
mkdir ~/bin && cd ~/bin
wget http://dl.winehq.org/wine/source/2.0/wine-2.0-rc3.tar.bz2
tar xjf wine-2.0-rc3.tar.bz2 && cd wine-2.0-rc3
# run provided install tool and write the output to file
./tools/wineinstall | tee output.file
# get the winetricks tool
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
WINE=~/bin/wine-2.0-rc3/wine sh winetricks corefonts vcrun6 mfc40 ie8 ie7
# start the downloaded windows program
./wine ~/Downloads/winbox.exe
winbox from Mikrotik
SketchUp

Resources