After reinstall mercurial-server, directory '/var/lib/mercurial-server/' missing
apt-get purge mercurial-server
sudo rm -rf /var/lib/mercurial-server
sudo apt-get update
sudo apt-get install mercurial mercurial-server
i try:
shabak#Ubuntu:/etc/mercurial-server$ cd /var/lib/mercurial-server
-bash: cd: /var/lib/mercurial-server: No such file or directory
I can't find the folder 'repos'.
Please help!
The install script creates and initializes that directory only if the "hg" user doesn't exist. Otherwise it assumes you have an existing setup it should use. Try adding these deluser and delgroup commands to what you're doing:
apt-get purge mercurial-server
deluser --remove-home --system hg
delgroup --system hg
rm -rf /var/lib/mercurial-server
apt-get update
apt-get install mercurial mercurial-server
Alternately, before the "purge", do "dpkg-reconfigure mercurial-server" and set the option that destroys all data.
I'll detect and fix this in a future revision - thanks for reporting it!
Are you aware that mercurial-server isn't part of the mercurial project? It's a poorly maintained, third party application that does very little (nothing?) that mercurial can't already do without it.
If you're just trying to serve mercurial repositories consider using the hgweb program that came with Mercurial, or just use ssh access to the repositories in which case you need no software past the mercurial client at all.
Related
So, I want to use Mariadb. There is this Connector-C for it.
https://downloads.mariadb.org/connector-c/
How do I install it? Quiet frankly, the documentation for it is horrible. Even the src file for 3.0.5 is linked to 3.0.4 page.
I did not find a way to install the binary, and the documentation for building from src is quiet vague. I would prefer to know how to install both ways (binary and build from source)
I'm using CentOS7 64bit.
The easiest way to install it would be to use the MariaDB package repository.
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo yum -y install MariaDB-devel
As for building from source, these steps should work on CentOS 7.
sudo yum -y install git gcc openssl-devel make cmake
git clone https://github.com/MariaDB/mariadb-connector-c.git
mkdir build && cd build
cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
And for Ubuntu 20.04...
sudo apt-get install libmariadb3 libmariadb-dev
Raspberry Pi OS
cd to preferred build location. Then install (thanks to #markusjm!):
sudo apt install git gcc make cmake libssl-dev
git clone https://github.com/MariaDB/mariadb-connector-c.git
mkdir build && cd build
cmake ../mariadb-connector-c/ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
Then add installation directory to LD_LIBRARY_PATH. Note: my installation directory is /usr/lib/mariadb. If you cannot find this after your installation, search for e.g. libmariadb.so, a file that should reside in your installation folder.
export LD_LIBRARY_PATH=/usr/lib/mariadb:$LD_LIBRARY_PATH
Afterwards you can finally pip3 install mariadb, if, like me, you tried to do that in the first place.
After you download MariaDB Connector/C, untar and cd. Then mv the executable first.
sudo mv -f bin/mariadb_config /usr/bin/
Now you can execute mariadb_config and will know where to put header and library files to build wheel for mariadb.
For example,
Ubuntu 18.04
sudo mv -f include/mariadb /usr/local/include/
sudo mv -f lib/mariadb /usr/local/lib/
CentOS 7 & Ubuntu 20.04
sudo mv -f include/mariadb /usr/include/
sudo mv -f lib/mariadb /usr/lib/
Finally, you could pip install mariadb. (Or, export CFLAGS=-std=c99 may help.)
After, in the case you cannot import mariadb,
export LD_LIBRARY_PATH=/PATH/TO/where/you/mv/lib/mariadb
I have a need to run dpkg install, unpack the conf files, but skip running the postinst scripts (if it's included in the deb file).
I've tried to change the SHELL variable to /usr/bin/true, but that didn't work. Any other ideas would be great!
According to its man-page dpkg doesn't have a command-line-option to disable script execution. However, you can achieve what you want with the following commands (taken from this answer from an ubuntu forum):
apt-get download <package>
sudo dpkg --unpack <package>*.deb
sudo rm /var/lib/dpkg/info/<package>.postinst -f
sudo dpkg --configure <package>
sudo apt-get install -yf #To fix dependencies
I made the attempt at enabling EPEL on my Fedora 22 machine by running
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Then
sudo rpm -ivh epel-release-7-5.noarch.rpm
And now when I run
dnf repolist
I get the following
[sinux1#horrible-host ~]$ sudo dnf repolist
Extra Packages for Enterprise Linux 7 - x86_64 1.8 MB/s | 9.0 MB 00:05
Failed to open: /var/cache/dnf/epel-2b6dfc5904c26562/repodata/49c4e3bd54f19136521be9b254830c954369cc22ce1b661db502ebef13b0004c-updateinfo.xml.bz2.
[sinux1#horrible-host ~]$
I'm stuck and not sure what my next step is. How can I reverse what I did, and what would have been the proper way of enabling EPEL?
Thanks for any input
This is what appears to have worked for me.
Remove the epel repo
rm -rf /etc/yum.repos.d/epel*
then try install epel via dnf
dnf clean all
dnf install epel-release
I did the same as Sinux Tine and ended up in some sort of deadlock.
First try to do like Rup says.
If everything fails, try the following as a last resort. It worked for me.
> su
> cd /var/cache/dnf/epel-2b6dfc5904c26562/repodata
> mkdir throwaway
> mv 49c4e3bd54f19136521be9b254830c954369cc22ce1b661db502ebef13b0004c-updateinfo.xml.bz2 throwaway
That effectively deletes the file which dnf says it cannot open.
When and if the problem is solved, you can delete the throwaway directory and its contents.
Current libsolv version does not have bz2 compression.
Solution: enable bunzip2 compression in libsolv, Basically 'yum update libsolv', then reinstall epel-release.
To complement the answer for Centos 7, I followed the next steps:
Download the libsolv-0.6.14-1.el7 wich was patched
Install it
sudo rpm -ivh libsolv-0.6.14-1.el7.centos.x86_64.rpm
If we get a conflict with the previous version
warning: libsolv-0.6.14-1.el7.centos.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 1b6f9f55: NOKEY
Preparing... ################################# [100%]
file /usr/lib64/libsolv.so.0 from install of libsolv-0.6.14-1.el7.centos.x86_64 conflicts with file from package libsolv-0.6.11-1.el7.x86_64
file /usr/lib64/libsolvext.so.0 from install of libsolv-0.6.14-1.el7.centos.x86_64 conflicts with file from package libsolv-0.6.11-1.el7.x86_64
We proceed to remove the previous version
sudo yum erase libsolv-0.6.11-1.el7.x86_64
and install the patched libsolv package
sudo rpm -ivh libsolv-0.6.14-1.el7.centos.x86_64.rpm
We need to reinstall the dnf package manager, because it was removed after to remove the libsolv so we install with the following command.
sudo yum install dnf
We validate it using sudo dnf repolist now it, give us the right output.
Using metadata from Mon Jun 13 10:53:11 2016
repo id repo name status
base CentOS-7 - Base 9,007
How can I get bitcoin balance by using PHP?
Keen to get a step by step tutorial.
My server is shared Linux.
Json rpc Client might be the solution but do I need to install daemon on my server. If yes, how can I do that, by SSH?
You can easily do this. To learn how to install bitcoind on ubuntu, check the tutorial here: https://github.com/kyledrake/coinpunk/blob/master/docs/INSTALL.md#install-and-configure-bitcoind
Make sure you do sudo apt-get update && sudo apt-get upgrade first!
It is also reccomended to run these commands:
sudo apt-get install git autoconf libtool ntp build-essential
and
sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
You can then use http://jsonrpcphp.org/ (for php) to connect to the daemon and execute daemon commands.
I'm trying to install mercurial-server. After adding my keys to keys/root and refreshing auth, I tried to clone hgadmin-repo but I get the following error:
$ hg clone ssh://hg#<domain>/hgadmin
remote: mercurial-server: no such repository hgadmin
abort: no suitable response from remote hg!
Anyone know what's the problem?
I had this same problem and for me it was a problem with the installation of the hgadmin repository. When I installed the package, I got errors from python saying the mercurial package wasn't installed. I assume that happened when mercurial-server tried to initialize the hgadmin repository. So when I went to checkout the hgadmin respistory, there was no .hg directory:
root#myshost:/var/lib/mercurial-server/repos# cd hgadmin/
root#myshost:/var/lib/mercurial-server/repos/hgadmin# ls -a
. ..
In order to resolve this, I did:
easy_install mercurial
sudo apt-get purge mercurial-server
sudo rm -rf /var/lib/mercurial-server
sudo apt-get install mercurial-server
And then continued on with the directions here:
http://kurtgrandis.com/blog/2010/03/20/gitosis-for-mercurial/
Thanks a lot Randy for exposing the exact issue here.
I struggled with the same problem, and found an alternative approach to solving it (without the need to purge and re-install).
You can initialize the hgadmin repo manually and install the hooks, achieving the same effect as a normal installation. You need to to it as 'hg' user though.
Procedure
The commands worked for my environment (Ubuntu 10.04.4 / Hg 1.4.3)
First initialise a mercurial repository in /var/lib/mercurial-server/repos/hgadmin :
$ sudo su hg
$ cd ~/repos/hgadmin/
$ hg init
Then the only difference I found with a normally initialized hgadmin repo (that I deployed in a VM for comparison) were the hooks in .hg/hgrc file. So open the file :
$ vim .hg/hgrc
and paste this exact content :
# WARNING: when these hooks run they will entirely destroy and rewrite
# ~/.ssh/authorized_keys
[extensions]
hgext.purge =
[hooks]
changegroup.aaaab_update = hg update -C default > /dev/null
changegroup.aaaac_purge = hg purge --all > /dev/null
changegroup.refreshauth = python:mercurialserver.refreshauth.hook
Are you sure your clone command syntax is correct? I see at least two errors in it:
You must put the repo you're cloning (not just the destination)
Just as for push, you must use two slashes before hgadmin:
Example FAILING (missing the source repo and using only one '/' before 'home')
$ hg clone ssh://John#127.0.0.1/home/John/delme
Example FAILING (missing the source repo)
$ hg clone . ssh://John#127.0.0.1/home/John/delme
Example SUCCEEDING:
$ hg clone . ssh://John#127.0.0.1//home/John/delme