Linux 下常见问题总结
来源:互联网 发布:php流媒体服务器 编辑:程序博客网 时间:2024/06/06 16:22
1.换源
编辑sources.list文件:
sudo gedit /etc/apt/sources.list
将内容替换成阿里源:
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
最后进行更新源:
sudo apt-get update
2.查看并解除端口占用
由于在服务器中经常写socket的程序,有时候ctrl+c以后重新运行提示端口被占用,如果等候或者重启的话就很麻烦了,解决办法就是查看端口占用并解除。
查看指定端口,可以结合grep命令:
netstat -ap | grep 6666
也可以使用lsof命令:
lsof -i:6666
若要关闭使用这个端口的程序,使用kill + 对应的pid
kill -9 PID号
ps:kill就是给某个进程id发送了一个信号。默认发送的信号是SIGTERM,而kill -9发送的信号是SIGKILL,即exit。exit信号不会被系统阻塞,所以kill -9能顺利杀掉进程。
3.apt-install 出现以下错误:
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?
解决:
sudo rm /var/cache/apt/archives/locksudo rm /var/lib/dpkg/lock
阅读全文
0 0
- Linux 下常见问题总结
- linux下开发常见问题总结
- Linux下ftp常见问题总结
- Real6410 Linux 常见问题总结
- Linux 中常见问题总结
- Linux下常见问题[待续]
- Linux下常见问题
- Linux新手常见问题总结(ubuntu)
- linux下上校园网常见问题
- linux下常见问题的解决办法
- Linux下常见问题及解决方法
- vm下linux的常见问题
- Linux下常见问题及解决方案
- Linux下常见问题的解决方法
- Linux下JAVA开发常见问题
- linux下网络编程常见问题
- Linux 下一些常见问题集合
- IE下css常见问题总结及解决
- 系统进程全解读
- 修改android默认屏幕超时时间
- springboot-cloud-6-config
- Hive 默认字段分隔符
- 商城系统03-商品分类总结
- Linux 下常见问题总结
- tensorflow入门实践例子—MNIST手写数字识别
- 【ZZULIOJ】 2175 GJJ的日常之再游戏
- Struts迭代器(iterator)遍历List常用的4种例子
- BFS广度优先搜索 DFS深度优先搜索 回溯算法
- 用循环打印
- Solr__luence(六)高亮器、提升权重(相关度)
- NoSession问题
- 饿了么项目---6、使用Props传递数据