pkg icon indicating copy to clipboard operation
pkg copied to clipboard

`pkg autoremove` uninstalled `pkg`

Open gahr opened this issue 5 months ago • 8 comments

$ doas pkg autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 83 packages:

Installed packages to be REMOVED:
        binutils: 2.44,1
        cmake-core: 3.31.7
        cyrus-sasl: 2.1.28_5
        encodings: 1.1.0,1
        font-alias: 1.0.4
        font-arabic-misc: 1.0.3_4
        font-cursor-misc: 1.0.3_4
        font-daewoo-misc: 1.0.3_4
        font-dec-misc: 1.0.3_4
        font-isas-misc: 1.0.3_4
        font-jis-misc: 1.0.3_4
        font-micro-misc: 1.0.3_4
        font-misc-misc: 1.1.2_4
        font-mutt-misc: 1.0.3_4
        font-schumacher-misc: 1.1.2_4
        font-sony-misc: 1.0.3_4
        font-sun-misc: 1.0.3_4
        fontconfig: 2.15.0_3,1
        freetype2: 2.13.3
        gnutls: 3.8.9
        groff: 1.23.0_5
        hidapi: 0.15.0
        hwdata: 0.397,1
        jsoncpp: 1.9.6_1
        libX11: 1.8.12,1
        libXScrnSaver: 1.2.4_1
        libXau: 1.0.12
        libXdamage: 1.1.6
        libXdmcp: 1.1.5
        libXext: 1.3.6,1
        libXfixes: 6.0.1
        libXfont2: 2.0.6
        libXft: 2.3.8
        libXrandr: 1.5.4
        libXrender: 0.9.12
        libXv: 1.0.13,1
        libXxf86vm: 1.1.6
        libassuan: 3.0.2
        libcbor: 0.12.0_2
        libdrm: 2.4.123,1
        libepoll-shim: 0.0.20240608
        libevent: 2.1.12
        libfido2: 1.16.0
        libfontenc: 1.1.8
        libglvnd: 1.7.0
        libksba: 1.6.7
        libpaper: 1.1.28_1
        libpciaccess: 0.18.1_1
        libtasn1: 4.20.0_1
        libunwind: 20240221_2
        libuv: 1.51.0
        libxcb: 1.17.0
        libxkbfile: 1.1.3
        libxshmfence: 1.3.3
        lua53: 5.3.6_1
        mesa-libs: 24.1.7_1
        mkfontscale: 1.2.3
        mpc: 1.3.1_1
        mysql80-client: 8.0.42
        nettle: 3.10.2
        ninja: 1.11.1,4
        npth: 1.8
        openldap26-client: 2.6.10
        p11-kit: 0.25.5
        pinentry: 1.3.1_2
        pinentry-curses: 1.3.1
        pixman: 0.46.2
        pkg: 2.2.1
        png: 1.6.49
        postgresql17-client: 17.5
        psutils: 1.17_6
        rhash: 1.4.4_1
        spirv-tools: 2025.3.r1
        sqlite3-icu: 3.50.2_1,1
        tcl86: 8.6.16_2
        uchardet: 0.0.8_1
        unixODBC: 2.3.12_1
        wayland: 1.23.1_1
        xkbcomp: 1.4.7
        xkeyboard-config: 2.41_4
        xorg-fonts-miscbitmaps: 7.7
        xorgproto: 2024.1
        zip: 3.0_4

Number of packages to be removed: 83

The operation will free 544 MiB.

gahr avatar Jul 16 '25 07:07 gahr

This happened after removing gcc15:

$ doas pkg delete gcc15                                                                                                                                              
Checking integrity... done (0 conflicting)                                                                                                                                             
Deinstallation has been requested for the following 5 packages (of 0 packages in the universe):                                                                                        
                                                                                                                                                                                       
Installed packages to be REMOVED:                                                                                                                                                      
        gcc15: 15.1.0_1                                                                                                                                                                
        llvm19: 19.1.7_1                                                                                                                                                               
        mesa-dri: 24.1.7_8                                                                                                                                                             
        spirv-llvm-translator-llvm19: 19.1.9                                                                                                                                           
        xorg-vfbserver: 21.1.18,1                                                                                                                                                      
                                                                                                                                                                                       
Number of packages to be removed: 5                                                                                                                                                    
                                                                                                                                                                                       
The operation will free 2 GiB.                                                                                                                                                         
                                                                                                                                                                                       
Proceed with deinstalling packages? [y/N]: y                                                                                                                                           
[dev] [1/5] Deinstalling gcc15-15.1.0_1...                                                                                                                                             
[dev] [1/5] Deleting files for gcc15-15.1.0_1: 100%                                                                                                                                    
remove symlink for gcc15                                                                                                                                                               
remove symlink for gcc15 (world)                                                                                                                                                       
remove symlink for g++15                                                                                                                                                               
remove symlink for g++15 (world)                                                                                                                                                       
remove symlink for cpp15                                                                                                                                                               
remove symlink for cpp15 (world)                                                                                                                                                       
[dev] [2/5] Deinstalling xorg-vfbserver-21.1.18,1...                                                                                                                                   
[dev] [2/5] Deleting files for xorg-vfbserver-21.1.18,1: 100%                                                                                                                          
[dev] [3/5] Deinstalling mesa-dri-24.1.7_8...                                                                                                                                          
[dev] [3/5] Deleting files for mesa-dri-24.1.7_8: 100%                                                                                                                                 
[dev] [4/5] Deinstalling spirv-llvm-translator-llvm19-19.1.9...                                                                                                                        
[dev] [4/5] Deleting files for spirv-llvm-translator-llvm19-19.1.9: 100%                                                                                                               
[dev] [5/5] Deinstalling llvm19-19.1.7_1...                                                                                                                                            
[dev] [5/5] Deleting files for llvm19-19.1.7_1: 100%                                                                                                                                   
remove symlink for clang19                                                                                                                                                             
remove symlink for clang19 (world)                                                                                                                                                     
remove symlink for clang++19                                                                                                                                                           
remove symlink for clang++19 (world)

gahr avatar Jul 16 '25 07:07 gahr

I guess, we should always treat pkg as non-automatic. Other than that, I see no problem there. These packages are automatic, I presume?

arrowd avatar Jul 16 '25 07:07 arrowd

Can pkg be considered automatic?

gahr avatar Jul 16 '25 07:07 gahr

You are right, though, not all package were removed.. but because I was left without pkg, there wasn't much I could do short of bootstrapping pkg again.

gahr avatar Jul 16 '25 07:07 gahr

You can run pkg set -A 0 pkg to make it non-automatic and will disappear from pkg autoremove. I just wonder why it is marked automatic in the first place.

arrowd avatar Jul 16 '25 07:07 arrowd

I just wonder why it is marked automatic in the first place.

yes, that's what I'm after, too

gahr avatar Jul 16 '25 08:07 gahr

I just wonder why it is marked automatic in the first place.

yes, that's what I'm after, too

I also faced the issue and reported it to FreeBSD Bugzilla.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278511

yasuhirokimura avatar Aug 04 '25 21:08 yasuhirokimura

IMO pkg autoremove should not uninstall itself even if it is marked as automatic. The backgroud of it is the behavior of pkg delete -a that it doesn't uninstall pkg itself and additional -f option is required to achieve it. So pkg autoremove should treat pkg itself specially just like pkg delete -a does, though I don't think -f option is necessary for the former.

yasuhirokimura avatar Aug 07 '25 20:08 yasuhirokimura