ubuntu
apt-get 修改源 Ubuntu 18.1
sudo vi /etc/apt/source.list
备份 修改source.list文件
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main multiverse restricted universe
apt更新源
sudo apt-get update
apt-get http设置代理: /etc/apt/apt.conf
Acquire::http::proxy "http://l00273743:helloxx%21@proxyhk.huawei.com:8080/";
Acquire::https::proxy "https://l00273743:helloxx%21@proxyhk.huawei.com:8080/";
Acquire::ftp::Proxy "ftp://l00273743:helloxx%21@proxyhk.huawei.com:8080/";
Ubuntu 12.04.2 LTS 版本以上
ubuntu 系统http代理:
添加http_proxy环境变量
export http_proxy=http://l00273743:helloxx%21@proxyhk.huawei.com:8080
export ftp_proxy=http://l00273743:helloxx%21@proxyhk.huawei.com:8080
export https_proxy=https://l00273743:helloxx%21@proxyhk.huawei.com:8080
ubuntu 修改环境变量有三种方式 :
- export : 暂时性,重新登录就失效
- 写入 ~/.bashrc : 长久性,只对当前用户生效
- 写入 /etc/profile ;长久性,对所有用户生效
bash(终端)的环境变量读入顺序 /etc/profile -> ~/.bashrc -> export (后者会覆盖前者设置)
注意:后两种修改方式需要重新登录或者执行 source ~/.bashrc(/etc/profile)才可生效.
ubuntu安装
https://blog.csdn.net/wang4it/article/details/78998217
添加用户
adduser gen
passwd gen
删除用户及其目录
userdel -r gen
授予sudo
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)
$visudo
到最后一行
gen ALL=(ALL) ALL
top命令
http://www.cnblogs.com/peida/archive/2012/12/24/2831353.html