需要重新配個(gè)ubuntu剿另,記錄一下箫锤,省得每次配都要亂翻
提示
1、TMD換源的時(shí)候記得備份原來(lái)的
2驰弄、TMD換源的時(shí)候認(rèn)真一些麻汰,可以省很多事情,阿里的源應(yīng)該夠用戚篙,裝到?jīng)]有一點(diǎn)報(bào)錯(cuò),update完之后提示讓你apt -list查看五鲫。
aptlocked
把下面四行代碼放到/bin目錄文件下,配上執(zhí)行權(quán)限岔擂,可以直接當(dāng)成命令使用
PS:apt好像不能同時(shí)執(zhí)行兩個(gè)
sudo rm -rf /var/lib/apt/lists/lock
sudo rm -rf /var/lib/apt/lists/
sudo rm -rf /var/lib/dpkg/lock
sudo rm -rf /var/lib/dpkg/lock-frontend
換源
sudo vim /etc/apt/sources.list
sudo apt-get update --fix-missing
更新中如果出現(xiàn)少key位喂,把報(bào)錯(cuò)提示的key替換了xxxx
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys xxxx
sudo apt-get upgrate
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
貼個(gè)源的source找的時(shí)候最好找最近的文章,能姑哥更好
安裝一些必須物件
apt install --fix-missing 這個(gè)參數(shù)自動(dòng)安裝依賴
sudo apt-get install vim -y
sudo apt-get install net-tools -y
apt-get install gcc -y
apt-get install proxychains -y
開(kāi)啟root
sudo passwd root
安裝docker
apt-get install curl
apt-get install ca-certificates -y
apt-get install software-properties-common
apt-get install apt-transport-https
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo 'deb https://apt.dockerproject.org/repo debian-stretch main' > /etc/apt/sources.list.d/docker.list
apt-get install docker
apt-get install docker.io
service docker status
docker --version
docker配置加速器daocloud
https://www.daocloud.io/mirror
往下拉看看會(huì)不會(huì)有
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://xxx.m.daocloud.io
如果沒(méi)有就注冊(cè)乱灵,然后再訪問(wèn)這個(gè)頁(yè)面
參考
或者百度搜索docker daocloud
2019出來(lái)一大批文章?lián)Q國(guó)內(nèi)源...和apt源差不多
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://kfwkfulq.mirror.aliyuncs.com",
"https://2lqq34jg.mirror.aliyuncs.com",
"https://pee6w651.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com"
],
"dns": ["8.8.8.8","8.8.4.4"]
}
#重啟docker服務(wù)
systemctl restart docker
安裝pip
apt源更換好后直接安裝
pip list | grep xxxx
pip uninstall xxxx 卸載
源
臨時(shí)使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
設(shè)為永久
切到root
mkdir ~/.config/pip
touch ~/.config/pip/pip.conf
echo "[global]" > ~/.config/pip/pip.conf
echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.config/pip/pip.conf
安裝jdk
因?yàn)楝F(xiàn)在jdk收費(fèi)了(也可以查到共享賬號(hào)),但一般用openjdk開(kāi)源版本就可以了
#需要再/bin/bash下搞,zsh報(bào)錯(cuò)
apt purge openjdk* #先卸載原來(lái)的,zsh這個(gè)*不匹配,換回bash
apt install openjdk-8-jdk
nginx
apt install nginx
service nginx status
nginx -t 查看配置文件
日志:
/var/log/nginx
配置php的時(shí)候看清楚php-fpm
監(jiān)聽(tīng)文件的路徑塑崖,然后再nginx/site-avxxx/default的時(shí)候配置成對(duì)應(yīng)的文件
listen = /run/php/php7.2-fpm.sock
快捷配置
~/.bash 更改快速配置
alias hgrep="history | grep" #可以直接替換的,把一些常用的替換一下,很舒服,也可以用來(lái)混肴命令
#也可以自定義函數(shù)
function set-title() { #修改shell 的title,多個(gè)shell的時(shí)候修改一下不容易忘
if [[ -z "$ORIG" ]]; then
ORIG=$PS1
fi
TITLE="\[\e]2;$*\a\]"
PS1=${ORIG}${TITLE}
}
關(guān)于第三方軟件下載
tar.gz
壓縮包,下載下來(lái)可能需要自己配置
deb
安裝包,比較無(wú)腦,這個(gè)看情況選擇tar還是deb
dpkg -i xxx.deb #安裝
dpkg -L xxx #查看安裝的位置
dpkg -P xxx #卸載,不保留配置