13:43 2021/2/19
1.【Linux】让命令提示符显示日期和时间
$ vi ~/.bashrc
# 添加下边这行代码
PS1='[\u@\h \d \A \W]\$ '

2.设置linux历史命令显示执行时间
以ROOT用户编辑/etc/profile文件,在里面加入下面内容(我一般习惯在最末尾加):
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
注意:在末尾的“引号”与“S”之间,加入一位空格,将日期时间和历史命令用空格相隔开来。

3.apt-get install 软件包下载路径:
/var/cache/apt/archives


4.更换yum源:
下载163yum源:菜鸟教程
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
yum clean all
yum makecache
yum缓存路径:
修改文件: /etc/yum.conf
[main]
cachedir=/var/cache/yum/
keepcache=1

5.更换apt-get源:
Ubuntu 的软件源配置文件是 /etc/apt/sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bakcup
sudo gedit /etc/apt/sources.list
删除原内容,添加下列内容
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
保存sources.list文件后需要更新apt-get。
sudo apt-get update

apt-get 安装软件后软件包缓存路径:
/var/cache/apt/archives

posted on 2021-03-10 13:50  天外来客I  阅读(277)  评论(0编辑  收藏  举报