我正在尝试使用 bash shell 脚本从我的 Debian 6.0 服务器上的源代码构建 postgreSQL,但我遇到了问题。这是我到目前为止所做的代码:
# Initial
apt-get update
apt-get -y install aptitude bzip2 libbz2-dev git-core
aptitude -y install sudo python-all-dev python-setuptools libxml2-dev libgeoip-dev libxslt1-dev uuid-dev gcc automake autoconf libpcre3-dev libssl-dev unzip zip python-psycopg2 libpq-dev wget make libreadline-dev
aptitude -y full-upgrade
# POSTGRESQL
###############################
# Postgresql Download & Install
wget http://ftp.postgresql.org/pub/source/v8.4.6/postgresql-8.4.6.tar.gz -P /tmp
mkdir /tmp/postgresql
tar xzf /tmp/postgresql-8.4.6.tar.gz -C "/tmp/postgresql"
cd /tmp/postgresql/
mkdir /usr/local/pgsql
./configure --prefix=/usr/local/pgsql
cd /usr/local/pgsql
make
make install
# Add User
useradd -s /bin/false "postgresql_user"
chown "postgresql_user" usr/local/pgsql
# Clean Up
rm /tmp/postgresql-8.4.6.tar.gz
rm /tmp/postgresql
# Create Database
echo "CREATE ROLE PSQL LOGIN ENCRYPTED PASSWORD 'PASS';" | sudo -u postgresql_user usr/local/pgsql
sudo -u postgresql_user /opt/bin/createdb --owner PSQL DATADB
我得到的错误如下:
/root/StackScript: line 22: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
chown: cannot access `usr/local/pgsql': No such file or directory
sudo: usr/local/pgsql: command not found
sudo: /opt/bin/createdb: command not found
谁能告诉我哪里出错了?如果还有什么明显的我做错了,我总是乐于听到它!