ls 目录/文件:查看是否有目录或文件
ls -a :显示所有文件,包括隐藏的文件
cat 文件路径:查看文件里面的内容
cd 文件名称:进入某个文件夹
cd ..:返回上一级文件目录
cp 要复制的文件 目的文件:复制文件
pwd:显示文件的路径
mkdir 文件名:创建文件夹
vi 文件名:编辑文件
rm -f a:强制删除文件
history:查看历史命令
0
Posted in Ubuntu

1 备份 sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

2 编辑 sources.list

rm /etc/apt/sources.list
vim /etc/apt/sources.list

3 选择其中一种国内源粘贴进去

#sohu shangdong
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

#163 guangdong
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

#aliyun
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


#tsinghua.edu
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

#neu.edu
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirror.neu.edu.cn/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://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse

4 更新源

apt-get update
0
Posted in Ubuntu

1 备份原来的sources.list

sudo su
cp -rf /etc/apt/sources.list /etc/apt/sources.list.bak

2 编辑sources.list

rm /etc/apt/sources.list
vi /etc/apt/sources.list

3 从以下源中选择一种

#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse

#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

#163源
deb http://mirrors.163.com/ubuntu/ eoan main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ eoan-backports main restricted universe multiverse

#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse

4 更新源

sudo apt-get update
0
Posted in Ubuntu

Ubuntu16.04和18.04默认是不支持php7.4的包的安装,对于一些特定的软件需要PHP7.4的软件支持,为此Ubuntu下安装PHP7.4是一个很重要的过程,下面介绍安装PHP7.4的方法,实测好使!

1、安装 add-apt-repository 命令

# 用下列命令安装
sudo apt-get install software-properties-common

效果如下:

2、添加第三方源

# 用add-apt-repository命令添加源
sudo add-apt-repository ppa:ondrej/php

效果如下:

3、安装并启动

安装与启动:

# 安装
sudo apt-get install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-mbstring php7.4-bcmath php7.4-sqlite3 php7.4-cli php7.4-soap 
# 启动
sudo service php7.4-fpm start
# 重启
sudo service php7.4-fpm restart
# 停止
sudo service php7.4-fpm stop

查看状态:

# 用netstat 命令查看监听状态
sudo netstat -nlp | grep 9000

php74-fpm默认的监听方式是sock方式,对此我们需要修改配置文件

# 用vi编辑配置文件
sudo vi /etc/php/7.4/fpm/pool.d/www.conf
# 注释 listen = /run/php/php7.4-fpm.sock
# 添加
listen = 127.0.0.1:9000

效果如下:

再次查看状态:

# 重启并用netstat 命令查看监听状态
sudo service php7.4-fpm restart
sudo netstat -nlp | grep 9000

4、Nginx中需添加这样的配置(有Nginx选择,没有可忽略)

如需安装Nginx,请参考我的博客链接:Linux下安装Nginx教程

 location ~ .php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
       }

5、测试

# 检测版本
php -v

6、配置PHP 7.4 FPM Pools(可选)

PHP 7.4 FPM允许您配置运行该服务的用户和组。您可以使用以下命令修改它们

vi /etc/php/7.4/fpm/pool.d/www.conf

通过用您的用户名替换www-data来挂起以下几行

user = username 
group = username 
listen.owner = username
listen.group = username
0
Posted in Ubuntu, 科技, 系统

  1. sudo: 无法解析主机:geology
    原因:之前用(hostname -b  主机名)修改了主机名,而没有在hosts文件里修改
    解决方法:$ pkexec nano /etc/hosts 
    加入 127.0.1.1  xxxxxxxx是你的机器名
    ctrl+o保存,ctrl+x离开
  2. lixudong@geology:~/下载$ tar zxvf hadoop-3.0.0.tar.gz
    gzip: stdin: unexpected end of file
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now                  
    原因:hadoop-3.0.0.tar.gz没有完整下载,或者正在下载
    解决方法:待下载完毕后,再进行解压
0
Posted in Ubuntu