Installing files in Ubuntu - linux

I need to download the NVIDIA CUDA tool kit. I am running on Ubuntu server, I don't know which one to download. I checked the ubuntu version, below is the output.
root#ubuserver3:/home/admin# uname -m && cat /etc/*release
i686
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"
NAME="Ubuntu"
VERSION="12.04.4 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.4 LTS)"
VERSION_ID="12.04"
The download link is this - https://developer.nvidia.com/cuda-downloads
Which one should I download? There are 2 files .run and .deb under 32 bit of Ubuntu 12.04. I have no idea.

They are both work, but there is a little difference.
For the deb package, you can use
$ sudo dpkg -i cuda_deb_file.deb
the .run package, just
$ chmod +x cuda_run_file.run
$ ./cuda_run_file.run
The first one install the file to /usr/bin/ /usr/include/ /usr/lib/, but
the second one need you specify the path before installation.

Related

Need to get Linux Dist name from different Dists

want to code a script that is for multiple linux distributions.
Also want to add commands that check, and if not exist install some packages.. So, need a solution to ckeck Dist name (like Debian or RedHat) to execute the right command for this Dist.
I have tryed "lsb_release" but is this working all the follow dists? : Debian / Ubuntu | Red Hat / Fedora / Suse / Cent OS" If yes, any idea where i can get the lsb_release output from all the Dists above?
in Debian I get this from lsb_release -a 2>/dev/null | grep Distributor:
Distributor ID: Debian
at Rasberry, I get this:
Distributor ID: Raspbian
but what about other Distributions?
Yes, the lsb_release should print the distribution information after installing the required package.
e,g:
On debian based distro:
apt-get install lsb-release
On RHEL based distro:
yum install redhat-lsb-core
or
yum install redhat-lsb
Alernative method : You can get the distribution information through:
On debian based disto
cat /proc/version
cat /etc/issue
cat /etc/issue.net
cat /etc/lsb-release
cat /etc/os-release
On RHEL based distro :
cat /proc/version
cat /etc/centos-release
cat /etc/lsb-release
cat /etc/redhat-release
cat /etc/system-release
seems that all modern linux distributions have /etc/os-release file with ID=distribution (unfortunately have no Raspberry around to test).

How to install Neovim on a remote server as a non-sudoer?

If I am not a sudoer of a remote server, I am wondering whether it is possible for me to install Neovim. Here is the server release:
$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
This might be an overkill if you just wish to install a single programm, but you can use Junest to install most command line software without root. It uses an Arch-based Linux distribution inside your home folder.
Another way would be to build Neovim from source and set the prefix to a folder you have write access (Neovim wiki). But this would require your remote server to have all dependencies + CMake installed.

Oprofile install on ubuntu 15.04 - no binary found in /usr/bin

I am trying to install oprofile on my ubuntu 15.04 by following the link:
Getting started with oprofile on Ubuntu
On my the other laptop whcih is running on ubuntu 14.04, it works well.
I can find the binary under /usb/bin directory.
However, I dont know why after typing the apt-get command
sudo apt-get update && sudo apt-get install oprofile
My ubuntu 15.04 still doesn't have oprofiled & opcontrol binary in /usr/bin.
Is there anyway I could check with?
Thanks
===================post updated =======================
Ubuntu 15.04 comes with oprofile 1.0.0, which no longer uses the opcontrol and oprofiled commands. If you want to follow that tutorial, install 0.9.9 from source code. oprofile download page on SourceForge.

Docker container won't run 32 bit iperf executable copied with wget

Though iperf is successfully installed inside the container, Docker doesn't recognize it:
Docker version:
$ sudo docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a
Image inf.
root#15cb22522f30:/#uname -a && cat /etc/lsb-release
Linux f93f33213b2a 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
iperf package installation:
root#15cb22522f30:/#wget https://iperf.fr/download/iperf_2.0.2/iperf_2.0.2-4_i386
root#15cb22522f30:/#chmod +x iperf_2.0.2-4_i386
root#15cb22522f30:/#sudo mv iperf_2.0.2-4_i386 /usr/bin/iperf
File located:
root#15cb22522f30:/# which iperf
/usr/bin/iperf
Docker doesn't recognize it:
root#15cb22522f30:/# iperf
bash: /usr/bin/iperf: No such file or directory
You are trying to execute a 32 bit binary on a 64 bit system.
Docker runs on 64 bit systems, and produces 64 bit containers [*]
The copied iperf file is a 32 bit binary.
file /usr/bin/iperf
/usr/bin/iperf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
After hunting around, I found if you install these 32 bit libs in the docker container:
apt-get update && apt-get install libc-i386 lib32stdc++6
Then it will at least load iperf:
iperf
Usage: iperf [-s|-c host] [options]
Try `iperf --help' for more information.
[*] A few people have hacked dockers tools to run on 32 bit systems, so it can be done -- but it isn't the norm and appears to have been rejected by the docker leaders in favor of a single standard.
Paul's answer solved the issue. I additionally had to install i386 architecture for 32-bit packages to be installed automatically:
dpkg --add-architecture i386
apt-get update
apt-get install libc6-dbg
apt-get install libc6-dbg:i386
apt-get install lib32stdc++6

How do I know which Linux package to install for my Linux AMI

Ubuntu/Debian
Red Hat/Fedora/CentOS
Mac OS X
openSUSE
FreeBSD
OpenBSD
Gentoo
I have an application which has been natively packed on the above platforms, how do I know which one to install on my Linux AMI on EC2.
uname -a displays the following
Linux ip-10-315-48-29 3.7.31.31-83.9.amzn1.i686 #1 SMP Sat Feb 18 20:11:16
UTC 2011 i686 i686 i386 GNU/Linux
It's obviously some kind of Linux, so look for a file in /etc that ends in -release or _version:
ls /etc/*-release /etc/*_version
That should help you determine which Linux distribution you have. lsb-release is usually Ubuntu, while fedora-release, redhat-release indicate Fedora, RedHat, or CentOS. You can find a more complete listing here.
Alternatively, you can see if rpm or dpkg are installed by trying to run those commands:
rpm --version
dpkg --version
If dpkg is installed, it's probably Ubuntu/Debian based. If rpm is installed, it's probably RedHat/CentOS or openSUSE based.

Resources