- CompTIA Linux+ Certification Guide
- Philip Inshanally
- 350字
- 2021-08-13 15:49:54
The purge option
The purge option, when used, not only removes a package, but also removes a package configuration file. This is ideal because most of the time when we uninstall a package using uninstall, it leaves unwanted configuration files in our system. Here is how we use the purge option:
root@ubuntu:/tmp# apt-get purge virtaal
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
virtaal*
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Removing virtaal (0.7.1-1) ...
Purging configuration files for virtaal (0.7.1-1) ...
root@ubuntu:/tmp#
Great!
It is always a good idea to regularly run the apt-get command with the clean option.
Whenever we install a package using the apt utility, it uses repositories to download the packages into the cache. By default, when we install a Debian distribution, the installation comes with official repositories. These are stored in the /etc/apt/sources.list file. Let's take a look at that file:
root@ubuntu:/tmp# cat /etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
root@ubuntu:/tmp#
The entries that start with deb refer to where to search for packages. The entries that start with deb-src refer to source packages.
推薦閱讀
- 零起步輕松學(xué)單片機(jī)技術(shù)(第2版)
- 數(shù)據(jù)展現(xiàn)的藝術(shù)
- Word 2000、Excel 2000、PowerPoint 2000上機(jī)指導(dǎo)與練習(xí)
- 我的J2EE成功之路
- Excel 2007函數(shù)與公式自學(xué)寶典
- 走入IBM小型機(jī)世界
- 腦動(dòng)力:PHP函數(shù)速查效率手冊(cè)
- 數(shù)據(jù)庫(kù)原理與應(yīng)用技術(shù)學(xué)習(xí)指導(dǎo)
- 21天學(xué)通C#
- 控制系統(tǒng)計(jì)算機(jī)仿真
- 電腦主板現(xiàn)場(chǎng)維修實(shí)錄
- 項(xiàng)目管理成功利器Project 2007全程解析
- 網(wǎng)絡(luò)布線與小型局域網(wǎng)搭建
- 從零開始學(xué)C++
- 軟件工程及實(shí)踐