在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#1

帖子 寺島聰子 » 2017-01-31 18:20

What's the good way to clean up the system (and is Bleachbit safe) on Ubuntu 16.04?
参照 http://askubuntu.com/questions/657091/w ... -ubuntu-14

It has a "janitor" option where you can clear caches files, delete old kernels, delete orphaned .debs and more like that. But what gets removed tends to be a few MBs of software that is not longer used on your system but will not have interfered with what you normally do.
システムを よく理解していない我々初心者は、何をしておけば良いのか?
不熟悉的系统,我々初学者,What should I do?

https://sites.google.com/site/easylinux ... ject/clean
First of all: never use cleaning applications like BleachBit! Those software wrecking balls are very risky and may damage your system beyond repair. There are a few safe cleaning actions, which I'll describe below.
このリンクに 色々書いてありますが、ひとつのアプリケーションで、一気にやってしまいたいのですが
我希望、使用「単一的应用程序」
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#2

帖子 poloshiao » 2017-01-31 20:24

1. http://askubuntu.com/a/657261
On Linux there usually is no need to clean your system, even after multiple updates.
... (omitted)
このリンクに 色々書いてありますが、ひとつのアプリケーションで、一気にやってしまいたいのですが
我希望、使用「単一的应用程序」
2. create a new script file by :
gksudo gedit ~/myMaintaining
2-1. To use gksudo for the first time, You must install gksu in advance.
sudo apt install gksu
2-2. Choose those lines you think necessary from the following script file example :

代码: 全选

#!/bin/bash
#
sudo echo "sudo apt-get -y autoremove"
sudo apt-get -y autoremove
# 
sudo echo "sudo apt-get -y autoclean"
sudo apt-get -y autoclean
# 
sudo echo "sudo apt-get -y clean"
sudo apt-get -y clean
# 
sudo echo "sudo apt-get -y check"
sudo apt-get -y check
# 
# sudo echo "sudo apt-get -f -y install"
# sudo apt-get -f -y install
# 
sudo echo "sudo dpkg --configure -a"
sudo dpkg --configure -a
# 
sudo echo "sudo apt-get -y update"
sudo apt-get -y update
# 
sudo echo "sudo apt-get -y upgrade"
sudo apt-get -y upgrade
# 
sudo echo "sudo apt-get -y dist-upgrade"
sudo apt-get -y dist-upgrade
# 
sudo echo "#..........................................."
sudo echo "#.......................Finish.............."
2-3. You may add any command line if you think it will be helpful.
2-4. sudo chmod +x ~/myMaintaining
2-5. You may put myMaintaining outside your home directory.
2-6. You may change myMaintaining into any name you like.

3. Everytime you execute the following script file :
sudo ~/myMaintaining
It will begin to maintain your system.

3. Look the following pages if you want to know the meaning of above commands :
3-1. http://manpages.ubuntu.com/manpages/yak ... get.8.html
apt-get - APT package handling utility -- command-line interface
3-2. http://manpages.ubuntu.com/manpages/yak ... pkg.1.html
dpkg - package manager for Debian

4. You will need those tools like Bleachbit only if you become advanced and your system become so complicated.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#3

帖子 寺島聰子 » 2017-02-02 7:41

2. create a new script file
語釈
A collection of scripting commands, parameters and expressions that enables you to automate tasks or perform bulk operations repeatedly.
gksudo gedit
https://help.ubuntu.com/community/RootSudo
https://wiki.ubuntulinux.jp/UbuntuTips/Others/RootSudo
本文中、理解可能部分、以下引用
背景
In Linux (and Unix in general), there is a SuperUser named root. The Windows equivalent of root is the Administrators group. The SuperUser can do anything and everything, and thus doing daily work as the SuperUser can be dangerous. You could type a command incorrectly and destroy the system.

使用sudo的好处
It avoids the "I can do anything" interactive login by default. You will be prompted for a password before major changes can happen, which should make you think about the consequences of what you are doing.

Graphical sudo
You should never use normal sudo to start graphical applications as root. You should use gksudo to run such programs. gksudo sets HOME=~root, and copies
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#4

帖子 poloshiao » 2017-02-02 8:03

gksudo gedit
for supplement :

1. sudo or gksudo ?
sudo console-command
gksudo graphic-command

2. gedit is a graphic text editor
2-1. http://manpages.ubuntu.com/manpages/xen ... dit.1.html
gedit - text editor for the GNOME Desktop
2-2. sudo apt-rdepends gedit | grep gtk
Will help you find out those gtk- packages which gedit depends on.
In Linux (and Unix in general), there is a SuperUser named root.
3. login with username root only if you become advanced in the future.
3-1. User Root is the default user since you boot Ubuntu till login
with non-root username.
3-2. Login with non-root username would be encouraged for new user.

4. extra referrence :
4-1. https://help.ubuntu.com/community/Sudoers
Sudoers
4-2. http://manpages.ubuntu.com/manpages/yak ... ksu.1.html
gksu - GTK+ frontend for su and sudo
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#5

帖子 寺島聰子 » 2017-02-02 10:23

3. Look the following pages if you want to know the meaning of above commands :
3-1. http://manpages.ubuntu.com/manpages/yak ... get.8.html
autoremove is used to remove packages that were automatically
installed to satisfy dependencies for other packages and are now no
longer needed.

-y,--yes,--assume-yes自動是提示; 假定“是”作為所有提示的答案,並以非交互方式運行。 如果出現不希望的情況,例如更改保存的包,嘗試安裝未認證的包或刪除基本包,則apt-get將中止。

meaning of other commands 略之也
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#6

帖子 寺島聰子 » 2017-02-03 9:06

你们好
apt-get autoclean 删除不使用包的存档文件
使ってないパッケージのアーカイブファイルの削除

https://zh.wikipedia.org/wiki/Shebang#. ... D.E6.B3.95
#!/bin/bash
In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark (#!) at the beginning of a script. It is also called sha-bang,[1][2] hashbang,[3][4] pound-bang,[5] or hash-pling.[6]
在计算机科学中,Shebang(也称为 Hashbang )是一个由井号和叹号构成的字符序列 #! ,其出现在文本文件的第一行的前两个字符。 在文件中存在 Shebang 的情况下,类 Unix 操作系统的程序载入器会分析 Shebang 后的内容,将这些内容作为解释器指令,并调用该指令,并将载有 Shebang 的文件路径作为该解释器的参数[1]。

语法
Shebang 这一语法特性由 #! 开头,即井号和叹号。 在开头字符之后,可以有一个或数个空白字符,后接解释器的绝对路径,用于调用解释器。 在直接调用脚本时,调用者会利用 Shebang 提供的信息调用相应的解释器,从而使得脚本文件的调用方式与普通的可执行文件类似。
-----------
Bleachbit only if you become advanced and your system become so complicated.
我了解
2. gedit is a graphic text editor
~ $ gksudo pluma ~/myMaintaining
3. login with username root only if you become advanced in the future.
3-1. User Root is the default user since you boot Ubuntu till login
with non-root username.
3-2. Login with non-root username would be encouraged for new user.
未だ理解はできないが、今後勉強しまいります。ありがとうございました。
尚未能理解,但我们会继续研究未来。谢谢大家!

あなたのようにスクリプトを書ける
そんなレベルに なりたい
写像你这样的脚本
我想成为这样一个水平
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 在Ubuntu 16.04上清理系统(和Bleachbit safe)的好方法是什么?

#7

帖子 poloshiao » 2017-02-03 9:17

gksudo pluma ~/myMaintaining
1. Yes !
1-1. pluma is also a graphic text editor based on some gtk libraries.
http://packages.ubuntu.com/xenial/pluma
1-2. Using gksudo would better than using sudo in front of pluma, It will have better environment variables setting for desktop.
回复