Ubuntu使用技巧
命令
获取系统安装包的编译源码及脚本
apt-get source package
查询端口被占用的进程
lsof -i:端口号
配置
配置阿里源
# mv /etc/apt/source.list /etc/apt/source.list.bak
# vim /etc/apt/sources.list
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
SSH允许ROOT登入
### 编辑配置文件,修改'PermitRootLogin without-password'为'PermitRootLogin yes'
# vim /etc/ssh/sshd_config
### 重启ssh服务
# service ssh restart
切换成GNOME界面
# apt-get install gnome-shell
# apt-get install gnome-panel
# apt-get install gnome-terminal
# apt-get install plymouth-label
# apt-get install open-vm-tools
切换窗口管理器
# dpkg-reconfigure gdm
apt源更新报错
E: Failed to fetch cdrom://Ubuntu-Server 16.04 LTS _Xenial Xerus_ - Release amd64
### 删除apt配置文件对应源 deb cdrom:XX
# vim /etc/apt/sources.list
启动VNC服务
### Ubuntu 14.04 TLS
# vnc4server -geometry 1600x1080 :2
# vnc4server -kill :2
时间同步
### 修改时区
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
### 安装NTP并同步时间
# apt install chrony
# chronyc sources
Ubuntu Server添加中文支持
### 安装language support
# apt install language-pack-zh-hans
# apt install language-selector-gnome
### language support的键盘输入模式系统选择iBus
### Region & Language的Input Sources添加Chinese(SunPinyin)
### 最后必须关机
# halt
软件自动更新设置
### 编辑自动更新配置文件,去掉需要自动更新的软件注释
# vim /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};
### 开启软件自动更新
# vim /etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1"; //显示更新包列表,0表示停用设置
APT::Periodic::Download-Upgradeable-Packages "0"; //下载更新包,0表示停用设置
APT::Periodic::AutocleanInterval "0"; //N日后自动清理软件包
APT::Periodic::Unattended-Upgrade "1"; //启用自动更新,0表示停用自动更新
安装rabbitmq-server
### 安装rabbitmq
# apt-get install rabbitmq-server
# systemctl start rabbitmq-server
# systemctl enable rabbitmq-server
### 开启web访问
# vim /etc/rabbitmq/rabbitmq.config
[{rabbit, [{loopback_users, []}]}].
# rabbitmq-plugins enable rabbitmq_management
# systemctl restart rabbitmq-server
Ubuntu使用技巧的更多相关文章
- 【Ubuntu日常技巧】【解决】Ubuntu 16 右上角的音量调节通知框不停地闪烁问题
一. 先上干货 解决问题 1.1 安装工具alsa-tools-gui sudo apt-get install alsa-tools-gui 1.2 通过hdajackretask设置 直接执行命令 ...
- 【Ubuntu日常技巧】VirtualBox多网卡路由配置,保障虚拟机连接上外网
[背景]: 配置Ubuntu 虚拟机双网卡,一个是Host-Only网络,一个是桥接网络.当在虚拟机中同时连接到两个网络后,虚拟机能够ping通内部网络,不能ping通外部网络,如www.baidu. ...
- Ubuntu 小技巧
一.获得当前文件夹的路径: 在目标文件夹下,按Ctrl+l此文件的路径会被选中 之后Ctrl+c复制.要复制到终端(Terminal),选中终端按鼠标的滚轮就粘贴到了Terminal命令行中了. 二. ...
- 2016021901 - ubuntu截图技巧
ubuntu系统自带截图功能使用介绍 ubuntu自定义截图快捷键:Shift+PrtSc 截取当前窗口快捷键:Alt+PrtSc 保存全屏截图:PrtSc
- Ubuntu小技巧——怎样安装谷歌Chrome浏览器
对于刚刚开始使用Ubuntu并想安装谷歌Chrome浏览器的新用户来说,本文所介绍的方法是最快捷的.在Ubuntu上安装谷歌Chrome的方法有很多.一些用户喜欢直接在谷歌Chrome下载页面获得 d ...
- ubuntu小技巧(不定期更新)
1.gedit打开windows保存的txt出现乱码 默认情况下,用ubuntu打开windows保存含有中文的txt文件时会出现乱码. 只需在终端运行以下两条命令则可解决. gsettings se ...
- ubuntu常用技巧积累
1.修改root密码,一般与用户密码不同 python@ubuntu:~$ sudo passwd[sudo] password for python: 输入新的 UNIX 密码: 重新输入新的 UN ...
- VMware虚拟机 Ubuntu 实用技巧 (1) -- 安装VMware Tool
1.用VM安装Ubuntu后屏幕太小? 2.Ubuntu中的文本与window中的文本不能互相复制黏贴? 如果你遇到以上问题,可以通过在VMware里安装“VMware Tool”插件解决!! 安装步 ...
- ubuntu实用技巧
添加alias ~/.bash_alias文件: alias go="python /Users/xhat/Downloads/goagent/local/proxy.py" ~/ ...
随机推荐
- Cocos2dx版本与CocosBuilder版本匹配问题
我用的是CocosBuilder 2.1版本,将ccbi导入到xcode 5中时提示: WARNING! Incompatible ccbi file version 警告;ccbi版本不兼容. 查看 ...
- node.js定时任务:node-schedule的使用
安装 npm install node-schedule 使用方法 1:确定时间 例如:2014年2月14日,15:40执行 var schedule = require("node-sch ...
- 十一 Django框架,Session
Django中默认支持Session,其内部提供了5种类型的Session供开发者使用: 1.数据库(默认)2.缓存3.文件4.缓存+数据库5.加密cookie 1.数据库Session,保存在数据库 ...
- algorithm 简单用法
algorithm 简单用法 #include <iostream> #include <vector> #include <algorithm> using na ...
- Linux-NoSQL之Redis(三)
一.Redis数据常用操作 1.string常用操作 set key1 aminglinux get key1 set key1 aming //一个key对应一个value,多次赋值,会覆盖前面 ...
- Linux-shell 练习题(一)
1.实现批量添加20个用户,用户名为user1-20,密码为user+123 #!/bin/bash count=$ if [ -n "$count" ] then ;i<= ...
- MFC实现普通DLL
库有两种:动态链接库和静态链接库. 一,使用动态链接库: 通过项目——属性——配置属性——常规——项目默认值——配置类型下,选择动态库(.dll)选项 这样会生成.lib和.dll两种文件. 只是该. ...
- 【leetcode刷题笔记】Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
- Anthem.NET的 "Bad Response" 问题,及脚本调试技巧小结
今天解决了一位朋友使用 Anthem.NET 遇到的问题.他的代码在 Windows XP 的开发机器上反应正常,而部署到 2003 Server 的服务器上就提示 "BADRESPONSE ...
- 使用Visual Studio进行单元测试-Part4
本文主要介绍Visual Studio(2012+)单元测试框架的一些技巧: 如何模拟类的构造函数 优化代码,便于测试 一.如何模拟类的构造函数 1.1 被测代码 基础代码,IShape分别有Rect ...