ubuntu中安装vim,gcc,gdb及可能出现的问题
vim的安装
安装vim语句:sudo apt-get install vim
出现以下问题:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vim has no installation candidate
原因:源有些旧,需要更新
更新语句:sudo apt-get update,然后再用sudo apt-get install vim
gcc的安装
安装gcc语句:sudo apt-get install gcc
可能出现:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
原因:
上述提示的意思是,无法获取/var/lib/dpkg/lock 锁,解决的办法很简单,把当前的锁干掉就可以了,执行 sudo rm -rf /var/lib/dpkg/lock ,执行完就没问题了。
gdb的安装
与gcc安装类似
安装gcc语句:sudo apt-get install gdb
可能出现:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
原因:
上述提示的意思是,无法获取/var/lib/dpkg/lock 锁,解决的办法很简单,把当前的锁干掉就可以了,执行 sudo rm -rf /var/lib/dpkg/lock ,执行完就没问题了。