# To delete one package completely



## TomHsiung (Jan 24, 2018)

Hi,

It is not uncommon that when you want to install a package but the shell feedbacks a list of packages, like below.

For example, I wanted to install the package "git" on my FreeBSD server but the shell feedback a list of 15 packages to be altered. How to restore the other 14 packages when I wanted to remove git in future?

Tom


```
[tomhsiung@Toms-Server ~]$ sudo pkg install git

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 15 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    git: 2.15.1
    expat: 2.2.5
    p5-Authen-SASL: 2.16_1
    p5-GSSAPI: 0.28_1
    perl5: 5.24.3
    p5-Digest-HMAC: 1.03_1
    python27: 2.7.14_1
    readline: 7.0.3_1
    libffi: 3.2.1_2
    p5-Error: 0.17025
    curl: 7.57.0
    libnghttp2: 1.29.0
    ca_root_nss: 3.34.1
    pcre: 8.40_1
    cvsps: 2.1_2

Number of packages to be installed: 15

The process will require 159 MiB more space.
32 MiB to be downloaded.
```


----------



## k.jacker (Jan 24, 2018)

`pkg autoremove` will remove these 14 packages that git pulled in.
This command is intelligent and it will only remove packages that no other installed software depends on.
pkg(8)


----------



## TomHsiung (Jan 24, 2018)

Thanks!


----------



## ShelLuser (Jan 24, 2018)

Although what k.jacker said is true do keep in mind that this doesn't apply all the time. In most cases dependencies will be pulled in because a program needs them to function, so if you remove the dependency then this can also remove the program again. I don't know from mind if this also applies here, but it's something to keep in mind.


----------

