Linux automatically updates the software source, deletes unnecessary software packages, and
creates the script file updateLi8520. The name can be strange
. Copy updateLi8520 in the open text editor. Save the content. Close the text editor. Copy the additional permissions to /bin.
It is mainly used with Unikylin and write other Chinese desktop changed to Desktop
pluma ~/桌面/updateLi8520
#保存updateLi8520后执行下面的命令 没保存内容在内存里 保存后才会创建
chmod -R 755 ~/桌面/updateLi8520
sudo cp -r ~/桌面/updateLi8520 /bin
# rm -rf ~/桌面/updateLi8520
# 编辑 sudo pluma /bin/updateLi8520
updateLi8520 content
#!/bin/bash
#脚本运行60秒后执行后面的命令
sleep 60
#没什么作用就是传递密码 开机启动就需要用到密码
#你可以给这个脚本做个 简单加密处理 具体 自行百度
echo "当前用户密码" | sudo -S `date +%Y年%m月%d日%H:%M:%S`
#更新系统软件源
sudo apt update -y && sudo apt upgrade -y
#补依赖
sudo apt-get install -f
#删除多余的软件包
sudo apt autoremove -y
exit 0
The next step is to create a startup file in the boot-up folder and copy the content of updateLi8520.desktop in the opened file to save additional permissions
mkdir -p $HOME/.config/autostart
pluma $HOME/.config/autostart/updateLi8520.desktop
#保存updateLi8520.desktop后执行下面的命令 保存后才会创建
chmod -R 755 $HOME/.config/autostart/updateLi8520.desktop
The contents of updateLi8520.desktop
[Desktop Entry]
Name=updateLi8520
Name[zh_CN]=updateLi8520
Terminal=false
Type=Application
Categories=Graphics;
StartupNotify=false
Actions=Configure;Capture;
Exec=updateLi8520
Icon=utilities-terminal
End of work