源更新

用新源代替旧源,以前的源要全部删除,因为已经无效

1、备份源列表
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

2、修改更新源
    sudo gedit /etc/apt/sources.list

3、启用新的更新源  
    sudo apt-get update
   如果出错,检查下网络是否连通再执行
    sudo apt-get update --fix-missing


安装ssh-server
  sudo apt-get install openssh-server
启动服务:
  sudo /etc/init.d/ssh start


一次安装过程中,输入 sudo apt-get update,不能更新,并且弹出
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

上网查询,知道有一个apt的进程正在运行,导致lock,就是没有更新源之前使用apt-get时进度条一直在 0%处,所以 ctrl+c强行终止,导致进程没有结束。查看进程,
wuwei@ubuntu:/etc/apt$ ps -e | grep apt
2396 ?        00:00:00 apt
2577 ?        00:00:02 aptd

wuwei@ubuntu:/etc/apt$ sudo kill 2396

猜你喜欢

转载自william-third.iteye.com/blog/1571353