Skip to content

Commit 83c5d75

Browse files
authored
Update install.sh
Ubuntu 18 新机不带python2,同时prepare_software在不apt update前装不上。 GCP 的Debian9云服务器,直接装Vim也不行,也需要编译安装。
1 parent 2088e70 commit 83c5d75

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

install.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ function is_ubuntu1604()
3131
fi
3232
}
3333

34+
35+
# 判断是否是Debian版本
36+
function is_debian()
37+
{
38+
version=$(lsb_release -is)
39+
if [ "${version}" == "Debian" ]; then
40+
echo 1
41+
else
42+
echo 0
43+
fi
44+
}
45+
3446
# 在ubuntu上源代码安装vim
3547
function compile_vim_on_ubuntu()
3648
{
@@ -114,13 +126,18 @@ function install_prepare_software_on_centos()
114126
# 安装ubuntu发行版必要软件
115127
function install_prepare_software_on_ubuntu()
116128
{
117-
sudo apt-get install -y ctags build-essential cmake python-dev python3-dev fontconfig curl libfile-next-perl ack-grep
129+
sudo apt-get update
130+
sudo apt-get install -y ctags build-essential cmake python python-dev python3-dev fontconfig curl libfile-next-perl ack-grep
118131
ubuntu_1604=`is_ubuntu1604`
132+
debian=`is_debian`
119133
echo ${ubuntu_1604}
120134

121135
if [ ${ubuntu_1604} == 1 ]; then
122136
echo "Ubuntu 16.04 LTS"
123137
compile_vim_on_ubuntu
138+
elif [ ${debian} == 1 ]; then
139+
echo "Debian"
140+
compile_vim_on_ubuntu
124141
else
125142
echo "Not ubuntu 16.04 LTS"
126143
sudo apt-get install -y vim

0 commit comments

Comments
 (0)