Ugrade tmux from 1.8 to 1.9 on Ubuntu 14.04 - ubuntu-14.04

I was just adding tmux plugins to my .tmux.conf file to find out that one of the plugins (tmux-copycat I think) requires tmux 1.9. When I start tmux I get the message `Error: Tmux version unsupported. Please install tmux version 1.9 or greater!".
So, what is the best way to upgrade tmux 1.8 to 1.9 on Ubuntu 14.04?

Update: due to new tmux version and changes in package repository, this answer is updated to show how to install tmux 2.0 (which is better, no reason to use 1.9 anymore).
Here are the steps to update "blank" ubuntu - version 14.04 only (see below for other ubuntu versions):
sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository -y ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install -y tmux=2.0-1~ppa1~t
now if you do tmux -V it should show tmux 2.0 which is a good version for tmux plugins
I verified the above steps on a new digitalocean droplet.
Basically, it's adding the pi-rho/dev repository, updating and then installing tmux from there.
If you have another ubuntu version you might want to install a different tmux version from the same repo. So:
ubuntu 12.04 (Precise Pangolin) step 5: sudo apt-get install -y tmux=1.9a-1~ppa1~p (installs tmux 1.9, no package for tmux 2.0 yet)
ubuntu 13.10 (Saucy Salamander) step 5: sudo apt-get install -y tmux=1.9a-1~ppa1~s (installs tmux 1.9, no package for tmux 2.0 yet)
ubuntu 14.10 (Utopic Unicorn) step 5: sudo apt-get install -y tmux=2.0-1~ppa1~u
ubuntu 15.04 (Vivid Vervet) step 5: sudo apt-get install -y tmux=2.0-1~ppa1~v

If you don't want to add a PPA, you can just build it from source. It's explained in the README on tmux's GitHub page:
To build tmux from a release tarball, do:
$ ./configure && make
$ sudo make install
You might need to install some extra packages to build it. On Ubuntu I needed to install these packages before it would successfully build:
exuberant-ctags
cmake
libevent-dev
libncurses5-dev

Another way to do #3 above (especially if you are using a corporate proxy that might break ppa).
sudo add-apt-repository -y http://ppa.launchpad.net/pi-rho/dev/ubuntu
If using a tool like Artifactory to act as a caching package proxy
sudo add-apt-repository -y http://my.artifactory.site/ppa.launchpad.net/pi-rho/dev/ubuntu
or
sudo add-apt-repository -y http://my.domain/artifactory/ppa.launchpad.net/pi-rho/dev/ubuntu

Related

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 "%"

How to Install an older version of php using apt-get?

I have this older package in this exact version that I want to install on Ubuntu.
https://launchpad.net/ubuntu/+source/php5/5.3.10-1ubuntu3.20
How can I install it using apt-get ? Thank you
For those looking for an earlier version of php 7.
List all php 7 versions:
apt-cache policy php7.*
Specify and install a specific php 7 version, in example 7.4.3:
sudo apt install php7.4-fpm=7.4.3-4ubuntu2.2
^ ^
| |
(left) pkgname / (right) version part
to find out what different versions of a package is available in the enabled repository
apt-cache policy <package-name>
in your case
apt-cache policy php5
select the version that you want to install and then type
sudo apt-get install pkgname=version
in your case
sudo apt-get install php5=5.3.10-1ubuntu3.20
before running any of the above commands, it is better to update the apt-cache first. To do it, run
sudo apt-get update
Try:
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install phpX.Y # E.g. 7.4
Source: How to Install PHP 7.4 on Ubuntu 20.04 LTS.

Docker - Unable to locate package docker-engine

I am trying to install docker in Ubuntu 16.04. I am following this link for docker installation. I am ending up with Unable to locate package docker-engine
My current kernal version - 4.4.0-38-generic
Ubuntu version - 16.04
The docker package already inside Ubuntu is called docker.io [1] so just do
sudo apt-get install docker.io
But if you follow that link you gave and do steps 7, 8, 9 then your installation will know about the package at the docker repo and also find docker-engine.
Your call. I run the Ubuntu version (currently 0.11.2 on Ubuntu 16.04) on some machines, and the one from Docker on others (as I was curious about some 0.12 features). Both will work just fine.
[1] As docker is used for a desktop launcher application 'docking' icons.
I faced the same issue on AWS-EC2 with ubuntu-18.04 server...
running apt-get update does the trick for me....
Once update runs fine then run apt-get install docker.io
Docker-compose-plugin is put into the docker.io repo.
Running sudo apt install docker.io ,or apt-get in older Ubuntu versions, will also get you the files you need. First you will need to run update to make sure you have most recent versions. sudo apt update
The main solution which solved most of the issues in docker is installing 64-bit version of ubuntu. I was running with 32-bit(i686). Hope it helps ! !
I wasn't able to install docker with the current other solutions but managed to get rid of the "Unable to locate package docker-engine" error with a solution mentioned on the GitHub repo issues (issue of May 31, 2020).
The solution was to run these commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

Install GCC5 in Linux Mint LMDE 2

I'm new in Linux and I would like to unistall gcc 4.9 which is installed in my distro Linux Mint LMDE 2 and install gcc 5. I tried to used the following command:
sudo apt-get install gcc5
but it didn't worked. Can someone please help me with this? Please provide all steps to follow. Thank you in advance
Try this.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
apt-get autoremove
This should work in Linux Mint if I'm not mistaken, as its still using the same respository.
sudo apt-get respository ppa:ubntu-toolchain-r/test
This will install you the correct respositories you need for the computer. Some packages are not automatically known to the computer so you need to install the respositories so the computer can install it.
sudo apt-get update
This will update your computer and all packages and the respoitory, this wil ensure it will now work
sudo apt-get install gcc-5 g++-5
This will install the gcc-5 version you wanted.
sudo apt-get autoremove
When you install certain stuff, some things are no longer needed. Maybe a required package from a previous version that you no longer need, do this to conserve space.

Unable to update Git on Ubuntu

I am trying to set up Git on an Ubuntu Machine (I'm using a Samsung Chromebook running Ubuntu 12.04).
When I entered "sudo apt-get install git" and it successfully installed Git 1.79
user#ChrUbuntu:~$ git --version
git version 1.7.9.5
I can't figure out what I am doing wrong here. Any suggestions?
For new installations of Ubuntu I would first try this to get the latest updates
sudo apt-get dist-upgrade
For more info on this see https://askubuntu.com/questions/81585/what-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade
That should solve it but if not, add the repository from these guys https://launchpad.net/~git-core/+archive/ppa
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
This way you don't have to build it, etc.
Perhaps you need to build for
the newest version
wget git-core.googlecode.com/files/git-1.8.1.1.tar.gz
tar -zxf git-1.8.1.1.tar.gz
cd git-1.8.1.1
make prefix=/usr/local all
sudo make prefix=/usr/local install
If you are trying to upgrade to the latest version of Git, you should do:
sudo apt-get update
sudo apt-get upgrade
This will update all your packages, as well as Git.
BTW, latest version of Git on my Kubuntu 12.10 is 1.7.10.4.
A combination of some of the answers worked for me. I did...
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get upgrade
Have you tried to do an apt-get update?
You might have an outdated package list.
In ubuntu 14.04 I tried the terminal code:
sudo apt-get update
sudo apt-get upgrade
step to upgrade git.
1.) git --version
*to know what git version you had in your computer
2.) sudo apt-get update
*update ubuntu
3.) sudo apt-get upgrade
*to upgrade software including git
4.) try to git --version
that's it :)

Resources