Ubuntu 16.04 LTS - Can't enable xterm_clipboard in VIM - linux

I use VIM a lot, and have previously been able to get +xterm_clipboard support working by using a script provided in a separate post on StackOverflow. I've re-installed Ubuntu on my machine, and have since migrated from Ubuntu 14.04.4 LTS (Wily) to Ubuntu 16.04 LTS (Xenial).
# Get the compile-dependencies of vim
sudo apt-get build-dep vim
# If you haven't got mercurial, get it
sudo apt-get install mercurial
# Get the source
hg clone https://vim.googlecode.com/hg/ vim_source
# Compile it
cd vim_source
./configure \
--enable-perlinterp=dynamic \
--enable-pythoninterp=dynamic \
--enable-rubyinterp=dynamic \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-features=huge \
--with-x \
--with-compiledby="Your Name <youremail#domain.com>" \
--with-python-config-dir=/usr/lib/python2.7/config
make && sudo make install
However, this no longer works, and I can't make use of ",+,y to yank buffers to the system clipboard. I don't see anything obvious in the .configure output, but vim --version always shows -xterm_clipboard when I build it. How do I fix this?

You should have noticed that the source is no longer hosted on Google code via mercurial (hg) anymore, and has migrated to GitHub in the error messages generated by the provided script.
You'll need to use the new source tree, git, and some developer libraries will need to be installed in advance.
Code Listing (Updated for Ubuntu 18.04 and onward)
# Get the compile-dependencies of vim
sudo apt-get -y build-dep vim
# Install the "checkinstall" tool so the "make install" step is
# wrapped and the result is a .deb file that can be removed later by
# your package manager rather than having to hunt down every file deployed
# by "make install", which might not be possible if it overwrites existing
# system files.
sudo apt-get -y install checkinstall
# Install python dev
sudo apt-get -y install python3-dev
# Install xorg dev
sudo apt-get -y install xorg-dev
# Install git
sudo apt-get -y install git
# Get the source
git clone https://github.com/vim/vim.git vim_source
# Remove ./configure cache in case we have to run this twice due to permissions
# related issues.
rm vim_source/src/auto/config.cache
# Compile it
cd vim_source
make clean distclean
./configure \
--enable-perlinterp=yes \
--enable-python3interp=yes \
--enable-rubyinterp=yes \
--with-python3-command=python3.6 \
--with-python3-config-dir=$(python3.6-config --configdir) \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-features=huge \
--with-x \
--with-compiledby="DevNull <darkstar#/dev/null>"
# Build quickly (parallel jobs).
make -j$(nproc)
# Need root to install
sudo checkinstall

Related

apk not found error while changing to node-buster from Alpine base image

I have changed my image in docker from Alpine base image to node:14.16-buster, While running the code I am getting 'apk not found' error.
Sharing the codes snippet :
FROM node:14.16-buster
# ========= steps for Oracle instant client installation (start) ===============
RUN apk --no-cache add libaio libnsl libc6-compat curl && \
cd /tmp && \
curl -o instantclient-basiclite.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip -SL && \
unzip instantclient-basiclite.zip && \
mv instantclient*/ /usr/lib/instantclient && \
rm instantclient-basiclite.zip
Can you please help here, what do I need to change?
The issue comes from the fact that you're changing your base image from Alpine based to Debian based.
Debian based Linux distributions use apt as their package manager (Alpine uses apk).
That is the reason why you get apk not found. Use apt install, but also keep in mind that the package names could differ and you might need to look that up. After all, apt is a different piece of software with it's own capabilities.
Buster images are based on the Debian version.
It doesn't support the APK default package manger is APT
For example you can do :
FROM node:15.14.0-buster-slim
RUN apt-get update && \
apt-get install -y \
curl \
jq \
git \
wget \
openssl \
bash \
tar \
net-tools && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /app && \
chown node:node /app
APK is part of the Linux alpine version you have to change the base version if you want to use the APK.
The buster node images are Debian based. buster is the release name for Debian 10 (11 will be bullseye).
Debian uses APT for packaging. apt-get can be used from scripts
apt-get update && apt-get install libaio1 curl
libnsl2 is not available in Buster, but you might not need it

ERROR: SvtAv1Enc not found using pkg-config

I am trying to compile FFmpeg with SVT-AV1 codec, following instructions from here: https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin
Everything goes well, but when I try to run
./configure --enable-libsvtav1
I am getting
ERROR: SvtAv1Enc not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
The content of the ffbuild/config.log: https://pastebin.com/euPriFAp
There is an exact issue on the github: https://github.com/OpenVisualCloud/SVT-AV1/issues/35, but is closed as solved.
I have tried both on my Mac and in the Docker container with Ubuntu 18.04, but getting the same result.
Could anyone please help, what am I doing wrong?
The problem was in the lack of requred libraries. Please find the complete installation instruction below.
Installing packages required for compiling:
sudo apt-get update
sudo apt-get install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
zlib1g-dev
Installing assemblers used by some libraries:
sudo apt-get install nasm
sudo apt-get install yasm
Build and install SVT-AV1:
git clone --depth=1 https://github.com/OpenVisualCloud/SVT-AV1
cd SVT-AV1
cd Build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j $(nproc)
sudo make install
Apply SVT-AV1 plugin and enable libsvtav1 to FFmpeg:
cd ~
git clone -b release/4.2 --depth=1 https://github.com/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
export LD_LIBRARY_PATH+=":/usr/local/lib"
export PKG_CONFIG_PATH+=":/usr/local/lib/pkgconfig"
git apply ../SVT-AV1/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
./configure --enable-libsvtav1
(Note: if you want other codecs to be supported please add the required flags to the ./configure command)
Build FFmpeg:
make
make install
hash -r
source ~/.profile
Now you should have ffmpeg command working and have svt-av1 in encoders list:
ffmpeg -encoders
...
V..... libsvt_av1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
...
I used next docs a reference:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

How to refresh your shell when using a Dockerfile?

I am trying to build a Dockerfile that can make use of Azure functions. After unsuccessfully trying to build it using alpine:3.9 because of library issues, I swapped to ubuntu:18.04. Now I have a problem in that I can't install nvm (node version manager) in such a way that I can install node. My Dockerfile is below. I have managed to install nvm but now, while trying to use nvm, I cannot install the node version I want. The problem probably has to do with refreshing the shell but that is tricky to do as it appears that Docker continues to use the original shell it entered to run the next build stages. Any suggestions on how to refresh the shell so nvm can work effectively?
FROM ubuntu:18.04
RUN apt update && apt upgrade -y && apt install -qq -y --no-install-recommends \
python-pip \
python-setuptools \
wget \
build-essential \
libssl-dev
RUN pip install azure-cli
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
RUN . /root/.nvm/nvm.sh && nvm install 10.14.1 && node
ENTRYPOINT ["/bin/bash"]
After install nvm command put:
SHELL ["/bin/bash", "--login" , "-c"]
RUN nvm install 17
SHELL ["/bin/sh", "-c"]
Default shell is sh and first command switches it to bash. Parameter --login is required as you want to source .bashrc.
As all subsequent commands would be executed with changed shell it's good to switch it back to sh if you don't need it anymore.
You usually don't need version managers like nvm in a Docker image. Since a Docker image packages only a single application, and since it has its own isolated filesystem, you can just install the single version of Node you need.
The first thing I'd try is to just install whatever version of Node the standard Ubuntu package has (in Ubuntu 18.04, looks like 8.11). While there are some changes between Node versions, for the most part the language and core library have been pretty stable.
RUN apt update && apt-install nodejs
Or, if you need something newer, there are official Debian packages:
RUN curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_10.x cosmic main" > /etc/apt/sources.list.d/nodesource.list \
&& apt update \
&& apt install nodejs
This will give you a current version of that major version of Node (as of this writing, 10.15.1).
If you really need that specific version of Node, there are official binary packages. I might write:
FROM ubuntu:18.04
ARG node_version=10.14.1
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends --assume-yes \
ca-certificates \
curl \
xz-utils
RUN cd /usr/local \
&& curl -o- https://nodejs.org/dist/v${node_version}/node-v${node_version}-linux-x64.tar.xz \
| tar xJf - --strip 1
...where the last couple of lines unpack the Node tarball directly into /usr/local.

implement CVE-2017-7494 (samba cry) on ubuntu server 16.04

Recently my experiment needs to implement CVE-2017-7494 (the so called sambacry), and I am trying to rebuild the vulnerable environment
I am new to this, not very sure how to set all the path and conf right
here is what I did:
# wget https://download.samba.org/pub/samba/stable/samba-4.5.9.tar.gz
# apt-get install acl attr autoconf bison build-essential \
debhelper dnsutils docbook-xml docbook-xsl flex gdb krb5-user \
libacl1-dev libaio-dev libattr1-dev libblkid-dev libbsd-dev \
libcap-dev libcups2-dev libgnutls-dev libjson-perl \
libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl \
libpopt-dev libreadline-dev perl perl-modules pkg-config \
python-all-dev python-dev python-dnspython python-crypto \
xsltproc zlib1g-dev
Reference about the above package.
# tar -xvf samba-4.5.9.tar.gz
# cd samba-4.5.9
# ./configure
# make
# make install
after that I found it installed under /local, and cannot start samba normally because, say, smbd not found, etc
I think it's a problem of path and config file then I tried this to fix it.
But didn't get well realizing.
Would anyone please help?
Since you did not specify a path in your configure parameters, it should be by default at /usr/local/samba/sbin/smbd.
You can try running this in your shell (and add it to your profile) to add it to your path:
export PATH=/usr/local/samba/bin/:/usr/local/samba/sbin/:$PATH

Build Vim with lua on Linux Mint

This is what I did:
# Install lua
curl -R -O http://www.lua.org/ftp/lua-5.2.2.tar.gz
tar zxf lua-5.2.2.tar.gz
cd lua-5.2.2
sudo make linux install
# build vim
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial
sudo apt-get remove vim vim-runtime gvim
sudo apt-get remove vim-tiny vim-common vim-gui-common
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7-config \
--enable-perlinterp \
--enable-gui=gtk2 --enable-cscope --prefix=/usr \
--enable-luainterp \
--with-lua-prefix=/usr/local/bin/lua
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install
But the ./configure step returns:
checking --enable-luainterp argument... yes
checking --with-lua-prefix argument... /usr/local/bin/lua
checking --with-luajit... no
checking for lua... (cached) /usr/local/bin/lua
checking Lua version... (cached) 5.2
checking if lua.h can be found in /usr/local/bin/lua/include... no
checking if lua.h can be found in /usr/local/bin/lua/include/lua5.2... no
I can verify that lua.h can't be found in those locations, but I don't know where it can be found.
Edit
I tried this again, ran into problems, and discovered a package vim-nox that already has vim support.
Original answer
I'm not entirely sure how I did this in the end, but thanks to #wrikken for the tip about headers.
# Install lua from binaries (these are out-of-date but at least they worked).
sudo apt-get install lua50 liblua50-dev liblualib50-dev
# Remove old vims
sudo apt-get remove vim vim-runtime gvim
sudo apt-get remove vim-tiny vim-common vim-gui-common
# Download and build a new vim
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial
cd ~
hg clone https://code.google.com/p/vim/
cd vim
cd ~/vim
./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7-config \
--enable-perlinterp \
--enable-gui=gtk2 --enable-cscope --prefix=/usr \
--enable-luainterp \
--with-lua-prefix=/usr/local
At this point, check the output of ./configure to see that it found lua.h. If not, find out where it is (I'm afraid I can't remember where it was). Symlink to it in /usr/local with e.g. sudo ln -s ../lua.h and rerun ./configure.
Finally:
sudo make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install
If it still won't work, post on a forum somewhere and go for a walk in the outdoors. You'll find it suddenly starts to behave.
What worked for me:
sudo apt-get install liblua5.1-dev
copy all files from /usr/include/lua5.1/ to /usr/include/lua5.1/include/
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/local/lib/liblua.so
Go to the vim source folder
cd src
make distclean
clear
./configure --with-features=huge --enable-cscope --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-multibyte --enable-fontset --enable-gui=gnome2 --disable-netbeans --enable-luainterp=yes --with-lua-prefix=/usr/include/lua5.1 --enable-largefile --enable-rubyinterp
sudo make
sudo make install
This will also install the GUI version, remove the --enable-gui=gnome2 if you will only use it in the command line.
Most of these I found it in here

Resources