cvs command on Ubuntu 11.10 seems broken? - linux

I have a clean install of Ubuntu 11.10 on my laptop. I installed CVS with the command "sudo apt-get install cvs". I have never had any trouble with the CVS command before, but in this case, I get this:
$ cvs
cvs checkout: No CVSROOT specified! Please use the `-d' option
cvs [checkout aborted]: or set the CVSROOT environment variable.
The real puzzle to me is why it is assuming the "checkout" command. That doesn't happen in other installations, where it just gives a usage message. But, OK, there is no CVSROOT defined, so if I define one, say like this:
$ export CVSROOT=:pserver:me#abc.com:/cvsroot
I then get another very strange message, which again indicates that it is assuming "checkout":
$ cvs
co: invalid option -- 'z'
Usage:
cvs checkout [-ANPRcflnps] [-r rev] [-D date] [-d dir]
[-j rev1] [-j rev2] [-k kopt] modules...
This isn't just with the plain "cvs" command, by the way - cvs login, cvs checkout, cvs update and cvs someGobbledegook all give the same result.
Any ideas what to try next?

1) CVS should be installable and should work fine on any version of Ubuntu (and Debian, and Fedora, etc etc)
2) Your "export" syntax (at least what you posted) is incorrect:
# BAD
export CVSROOT=export CVSROOT=:pserver:me#abc.com:/cvsroot
# BETTER
export CVSROOT=:pserver:me#abc.com:/cvsroot
3) Make sure /cvsroot exists and has appropriate permissions.
Since you're using pserver (not really a good idea, but...) make sure user "me.abc.com" is defined in your /cvsroot/passwd file
4) Make sure the "cvs" command isn't aliased
5) Make sure the pserver service is configured, enabled and running (again, pserver isn't necessarily a good idea)
6) This link is probably still applicable to your version of Ubuntu:
https://help.ubuntu.com/10.04/serverguide/C/cvs-server.html
ADDENDUM:
7) Check your firewall (port 2401)
8) Take a Wireshark trace: see if there's any attempted connections

Related

Build MPICH2 from source

As a follow-up of this question, I started building MPICH2 from source. I found this tutorial: Installing MPICH2 on a Single Machine and so far what I did is this:
./configure --disable-f77 --disable-fc --disable-fortran
[seems to be OK]
make; sudo make install
[long output with one warning]
libtool: warning: relinking 'lib/libmpicxx.la'
root#pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found
What am I doing wrong? Notice that I had first installed MPICH2 with apt-get and in order to remove it, I did:
apt-get remove --purge mpich2
apt-get autoremove // which might removed something that I need now
Tomorrow, I am going to try this: Getting And Building MPICH (which with first attempt failed to work in the autogen.sh part).
EDIT_1:
I couldn't get it to work, will try a combination of the two tutorials and report back. I did a configure and then the make from the other tutorial, failed too.
EDIT_2
This may shade some light about where it got installed (by following the first tutorial):
root#pythagoras:/home/gsamaras/mpich-3.1.4# which mpiexec
/usr/local/bin/mpiexec
root#pythagoras:/home/gsamaras/mpich-3.1.4# which mpirun
/usr/local/bin/mpirun
You installed into /usr/local, which is an OK way to do things. The README instructions you followed suggests another way which will not require administrative privileges.
I like to install into /home/robl/soft/mpich-whatever , so I can have different compilers, versions, configurations, etc. such flexibility is probably overkill for you, but it's one strategy.
To your question:
root#pythagoras:/home/gsamaras/mpich-3.1.4# mpich2version
bash: mpich2version: command not found
First, the command is now mpichversion, not mpich2version -- it's possible you were following an old tutorial.
Second, your shell might not know about the newly installed binaries. hash -r (at least on bash and tcsh) will tell the shell "forget about what you think you know about my file system and look harder".
I found this mpich-3.0.4-README, who seems to provided the solution.
Long story short, it says (it assumes you want to build 3.0.4 version, I did it with 3.1.4 (available here)):
tar xzf mpich-3.0.4.tar.gz
cd mpich-3.0.4
// you might want to disable fortran compiler (see the README I linked above)
./configure --prefix=/home/<USERNAME>/mpich-install 2>&1 | tee c.txt
make 2>&1 | tee m.txt
make install 2>&1 | tee mi.txt
PATH=/home/<USERNAME>/mpich-install/bin:$PATH ; export PATH
which mpicc
// should return something reasonable (with your directory)
mpiexec -n 2 ./examples/cpi
Now, the option with the machinefile does not work, because ssh needs a password, but that's another question.

sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

Please suggest a solution for solving this issue?? While giving the command:
sqlplus /nolog
the error that occurred:
sqlplus: error while loading shared libraries:
libsqlplus.so: cannot open shared object file: No such file or directory
The minimum configuration to properly run sqlplus from the shell is to set ORACLE_HOME and LD_LIBRARY_PATH. For ease of use, you might want to set the PATH accordingly too.
Assuming you have unzipped the required archives in /opt/oracle/instantclient_11_1:
$ export ORACLE_HOME=/opt/oracle/instantclient_11_1
$ export LD_LIBRARY_PATH="$ORACLE_HOME"
$ export PATH="$ORACLE_HOME:$PATH"
$ sqlplus
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Dec 31 14:06:06 2014
...
sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf";sudo ldconfig
from https://help.ubuntu.com/community/Oracle%20Instant%20Client
I did solve this error by setting
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME
yes, not only $ORACLE_HOME/lib but $ORACLE_HOME too.
You should already have all needed variables in /etc/profile.d/oracle.sh. Make sure you source it:
$ source /etc/profile.d/oracle.sh
The file's content looks like:
ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
If you don't have it, create it and source it.
I know it's an old thread, but I got into this once again with Oracle 12c and LD_LIBRARY_PATH has been set correctly.
I have used strace to see what exactly it was looking for and why it failed:
strace sqlplus /nolog
sqlplus tries to load this lib from different dirs, some didn't exist in my install. Then it tried the one I already had on my LD_LIBRARY_PATH:
open("/oracle/product/12.1.0/db_1/lib/libsqlplus.so", O_RDONLY) = -1
EACCES (Permission denied)
So in my case the lib had 740 permissions, and since my user wasn't an owner or didn't have oracle group assigned I couldn't read it. So simple chmod +r helped.
On Ubuntu Server 20.04 and using instant client version 19.10.0.0, I used alien to install the rpm package. I got this error when I just used the -i option. However when, I added -c I did not have this issue. from the man page for alien:
-c, --scripts
Try to convert the scripts that are meant to be run when the package is installed and removed. Use this with caution,
because these scripts might be designed to work on a system unlike
your own, and could cause problems. It is recommended that you
examine the scripts by hand and check to see what they do before using
this option.
So it seems the correct configuration (in 19c) or the environment variables (in earlier versions) are set in these scripts which are not generated unless you run alien like this. (Thanks #Christopher Jones for correcting me on this)
sudo alien -i -c BasicPackage.rpm
sudo alien -i -c SqlPlus.rpm
PERMISSIONS:
I want to stress the importance of permissions for "sqlplus".
For any "Other" UNIX user other than the Owner/Group to be able to run sqlplus and access an ORACLE database , read/execute permissions are required (rx) for these 4 directories :
$ORACLE_HOME/bin , $ORACLE_HOME/lib, $ORACLE_HOME/oracore, $ORACLE_HOME/sqlplus
Environment. Set those properly:
A. ORACLE_HOME
(example: ORACLE_HOME=/u01/app/oranpgm/product/12.1.0/PRMNRDEV/)
B. LD_LIBRARY_PATH
(example: ORACLE_HOME=/u01/app/oranpgm/product/12.1.0/PRMNRDEV/lib)
C. ORACLE_SID
D. PATH
export PATH="$ORACLE_HOME/bin:$PATH"
You can try usage:
# echo "/usr/lib/oracle/12.2/client64/lib" > /etc/ld.so.conf.d/oracle.conf
# ldconfig
This problem are because oracleinstant client not configure shared library.
Could you please check if LD_LIBRARY_PATH points to the oracle libs
Don't forget
apt-get install libaio1 libaio-dev
or
yum install libaio
On Oracle's own Linux (Version 7.7, PRETTY_NAME="Oracle Linux Server 7.7"
in /etc/os-release), if you installed the 18.3 client libraries with
sudo yum install oracle-instantclient18.3-basic.x86_64
sudo yum install oracle-instantclient18.3-sqlplus.x86_64
then you need to put the following in your .bash_profile:
export ORACLE_HOME=/usr/lib/oracle/18.3/client64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME
in order to be able to invoke the SQLPlus client, which, incidentally, is called sqlplus64 on this platform.
This worked for me: sudo dnf install libnsl
It means you didn't set ORACLE_HOME and ORACLE_SID variables. Kindly set proper working $ORACLE_HOME and $ORACLE_SID and after that execute sqlplus /nolog command. It will be working.
#laryx-decidua: I think you are only seeing the 18.x instant client releases that are in the ol7_oci_included repo. The 19.x instant client RPMs, at the moment, are only in the ol7_oracle_instantclient repo. Easiest way to access that repo is:
yum install oracle-release-el7

Subversion CLI default text editor on Linux

While there is no shortage of information on how to set a text editor for the Subversion Command Line Interface to use (see here, here, and here for example), I can't figure out where my local system is getting the text editor information from.
On my system, when I perform an svn commit, it opens vim for a commit message. Since this is what I want, I never really thought about it. This has always just worked. However, recently a co-worker was trying to commit, and it failed with an error saying the editor was not set. I never went out of my way to set an editor, so I am very confused about this.
I am running Ubuntu 12.04 and I have compiled and installed the Subversion CLI client version 1.8.10 from source code. Previous to that, I was using whatever Ubuntu's Canonical system installed with apt-get install subversion.
The Using External Editors section of the Subversion Book states the following possibilities for setting the text editor:
--editor-cmd command-line option
SVN_EDITOR environment variable
editor-cmd runtime configuration option
VISUAL environment variable
EDITOR environment variable
Possibly, a fallback value built into the Subversion libraries (not present in the official builds)
I have investigated these places and have not found how the default text editor is set on my computer:
Not using --editor-cmd option when committing
SVN_EDITOR environment variable not set
editor-cmd is not set in either my ~/.subversion/config, nor in /etc/subversion/config. Both of these files exist, but the line is commented out.
VISUAL environment variable not set
EDITOR environment variable not set
I'm downloading the official repository, so there should be no fallback.
There must be another place where the default can be set. Does anybody know?
Edit: There was a suggestion that Subversion might be calling /usr/bin/editor, and this is not set up on my co-worker's machine. I discovered that /usr/bin/editor is set up the same on both my system and my co-worker's system.
When you download the source directly (and build it - assuming you have the build dependencies met) you specify (or you can omit it) the default fallback editor. Normally source builds are done with something like this on Ubuntu (assume I have extracted/downloaded the subversion 1.8.10 source from here):
./configure
make
sudo make install
Notice the ./configure command above doesn't specify any options. The defaults will install to the prefix /usr/local . Prior to issuing those commands (on Ubuntu 12.04) I ran sudo apt-get build-dep subversion . I then did the commands above to build and install. I made sure that options 1-5 (In the OPs question) were not satisfied and then tried to commit a change to a repository. I got this as a response:
svn: E205007: Commit failed (details follow):
svn: E205007: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: E205007: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found
Since I didn't remove the official Ubuntu subversion I had to run mine as /usr/local/bin/svn to make sure I was using the one I built. I could have used sudo apt-get remove subversion to remove the official one as well just to make sure.
Now if one runs these commands to rebuild the source:
make clean
./configure --with-editor=/usr/bin/editor
make
sudo make install
One should find that if options 1 to 5 are not satisfied and this version of subversion is run it should default to running whatever /usr/bin/editor points to. On Ubuntu that will depend on what alternative is being used.
So when Ubuntu does an official build where does their fallback editor come from? I went to the 12.04 source repository for subversion at this link . On the right hand side I downloaded the diff file subversion_1.6.17dfsg-3ubuntu3.4.diff.gz . I opened up the diff file Ubuntu uses and scrolling down you can find they use this set of ./configure options (flags):
confflags := \
--prefix=/usr \
--libdir=$(libdir) \
--mandir=\$${prefix}/share/man \
--with-apr=/usr \
--with-apr-util=/usr \
--with-neon=/usr \
--with-serf=/usr \
--with-berkeley-db=:::db \
--with-sasl=/usr \
--with-editor=/usr/bin/editor \
--with-ruby-sitedir=/usr/lib/ruby \
--with-swig=/usr \
--with-kwallet \
--with-gnome-keyring
The bold entry shows that they use /usr/bin/editor as their fallback.
I have built subversion 1.8.10 from source on Ubuntu 12.04 and got the expected behavior. This suggests one of these possibilities:
On one of the systems the options 1 through 5 is actually met.
One version of subversion was built with the --with-editor configure flag (either directly or indirectly). The fallback would point to whatever the --with-editor configure flag was set to.
On one of the systems the wrong version of subversion is being run. One possibility is that the official subversion on Ubuntu is in fact being used. If that is the case it was built to use /usr/bin/editor as a fallback.
On one of your systems you have an alias (or equivalent) for svn that specifies an editor. Aliases would be specified in a startup script like ~/.bashrc, ~/.bash_profile, /etc/bash.bashrc for example.
I think the normal way to specify this on Linux and other Unix-like systems, is to set the VISUAL environment variable (for GUI editors) or the EDITOR variable (for editors running in a terminal).
Try this:
update-alternatives --display editor
Run strings on your svn binary to see if it mentions Vim or any related env vars inside.
Also committing under strace -f may reveal something.
Set this in your .bashrc file.
Don't forget to "source .bashrc" or reopen terminal.
export SVN_EDITOR='vim'

How to install SQL * PLUS client in linux

I am working on AWS services. I have an ec2 ( centos ) instance. I need to configure SQL*Plus client on this centos machine.
The server with whom I want to connect is at some remote area. The server version is oracle-se(11.2.0.2)
How can I get the client installed on the CentOS machine?
Go to Oracle Linux x86-64 instant clients download page
Download the matching client
oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Install
rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Set environment variables in your ~/.bash_profile
ORACLE_HOME=/usr/lib/oracle/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
Reload your .bash_profile by simply typing source ~/.bash_profile (suggested by jbass) or Log-out user and log-in again.
Now you're ready to use SQL*Plus and connect your server. Type in :
sqlplus "username/pass#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.1)(PORT=1521))(CONNECT_DATA=(SID=YOURSID)))"
The solution by #ChamaraKeragala is good, but it is unnecessary to logout/login. Instead type:
source ~/.bash_profile
For everyone still getting the following error:
sqlplus command not found
The original post refers to a set of environment variables, the most important of which is ORACLE_HOME. This is the parent directory where the oracle binaries get installed.
Depending on what version of oracle you downloaded you'll have to change the ORACLE_HOME accordingly. For example, the original question's ORACLE_HOME was set to:
ORACLE_HOME=/usr/lib/oracle/11.2/client64
My version of Oracle happens to be 12.1, so my ORACLE_HOME is set to:
ORACLE_HOME=/usr/lib/oracle/12.1/client64
If you are unsure of the version that you downloaded, you can:
cd /usr/lib/oracle after the installation and find the version.
Look at the RPM file oracle-instantclient12.1, where the bolded bits would refer to the version number.
There's a good blog post[1] on $subject. setup oracle client in ubuntu with minimum effort. Following are the main steps on how to step up the client.
In my case, I was installing rpm files using alien package.
Install alien and related packages
sudo apt-get install alien
Install oracle client packages using alien.
sudo alien -i oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
sudo alien -i oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
In my opinion these two steps are the easiest way to install oracle client rpm's on your ubuntu system. (I'm not going to mention about export oracle specific variables as it's already clearly explained in above answers)
Hope it helps someone.
[1] http://pumuduruhunage.blogspot.com/2016/04/setup-oracle-sql-plus-client-on-aws.html
For any one who is using proxy, you'd need to add an extra line to the bash profile. At least this is what made it work for me. I'm using cntlm.
export no_proxy=
Install via zip (tried with 12_2)
First of all there is no need to set ORACLE_HOME.
Simply download the .zip files from here starting with the first one Basic: followed by SQL*Plus: and any additional zips you may need.
Extract them all under /opt/oracle
You will then have a directory: /opt/oracle/instantclient_x_y
On ubuntu I had to do also:
sudo apt install libaio1
To run:
# This can be also done by adding only the path below in: /etc/ld.so.conf.d/oracle-instantclient.conf
export LD_LIBRARY_PATH=/opt/oracle/instantclient_x_y:$LD_LIBRARY_PATH
# This can be added in ~/.profile or ~/.bashrc
export ORACLE_HOME=/opt/oracle/instantclient_x_y
/opt/oracle/instantclient_x_y/sqlplus user/pass#hostname:1521/sidorservicename
At the bottom of the the above link page there are more details.

debootstrap through authenticated proxy

I am to install debian on my PC by 'from other linux' method and I run into problem with debootsrapt not being able to go through our proxy. As I understand the debootstrap doesnt have config file neither takes arguments on command line (relating to proxy), so I set following two environment variables:
ftp_proxy=http://myname:mypasswd#proxy.bla.bla.com:4128
http_proxy=http://myname:mypasswd#proxy.bla.bla.com:4128
Still I am getting:
# /usr/sbin/debootstrap --arch i386 wheezy /mnt/debinst http://ftp.cz.debian.org/debian
I: Retrieving Release
E: Failed getting release file http://ftp.cz.debian.org/debian/dists/wheezy/Release
the Release file can be get via browser, so it exists and so on...
I wonder if this can be done at all
Thanks
Well, I am to answer my question by myself.
With strace I found that debootstrap calls wget to fetch files from repositories. Obviously environment variables were somehow ignored but I edited /etc/wgetrc and put there all proxy related settings.
So it works.
BTW: debootstrap itself is just a script so maybe other workarounds would be possible.
You need to export the environment variables after setting them.
# ftp_proxy=http://myname:mypasswd#proxy.bla.bla.com:4128
# http_proxy=http://myname:mypasswd#proxy.bla.bla.com:4128
# export ftp_proxy http_proxy
# /usr/sbin/debootstrap --arch i386 wheezy /mnt/debinst http://ftp.cz.debian.org/debian
Also, if you try to set them from a user shell and then use sudo to run debootstrap, those variables may not pass through so it's better to set them after getting to a root shell.
Try changing APT proxy things :
$ cat /etc/apt/apt.conf.d/30proxy
Acquire::http::proxy "http://proxy:4128";
Acquire::https::proxy "https://proxy:4128";

Resources