LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to remove dependencies installed from .deb files? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remove-dependencies-installed-from-deb-files-4175679693/)

peter7089 07-31-2020 05:55 AM

How to remove dependencies installed from .deb files?
 
I am unable to remove dependencies installed from .deb files. For example, I downloaded the .deb files for vlc and its dependencies with the command 'sudo apt --download-only install vlc'. I can install vlc and its dependencies with 'sudo dpkg -i *.deb', and i can remove vlc with 'sudo dpkg -r vlc', but this doesn't remove its dependencies. And 'sudo apt autoremove' doesn't remove them also.

wpeckham 07-31-2020 06:38 AM

If you can verify that they are no longer needed (see deborphan) you can remove them by name.
Why install from the deb file rather than directly using apt?
Why do you WANT to remove them?

ondoho 07-31-2020 07:14 AM

Quote:

Originally Posted by peter7089 (Post 6151251)
And 'sudo apt autoremove' doesn't remove them also.

It should, unless they are still needed by some other application.
Yes, this can happen with optional dependencies, called "Install Recommends" in Debian-speak.
It is possible to tell apt to not install recommends at all.

What dependencies did vlc pull in?

BTW, don't use dpkg unless absolutely necessary.
Why couldn't you just 'apt install vlc'?

peter7089 07-31-2020 07:38 AM

Quote:

Originally Posted by wpeckham (Post 6151259)
If you can verify that they are no longer needed (see deborphan) you can remove them by name.
Why install from the deb file rather than directly using apt?
Why do you WANT to remove them?

deborphan doesn't list them and removing them by name is not convinient when they are many. These are the deb files:
Code:

vlc-plugin-notify_3.0.11-0+deb10u1_amd64.deb
libixml10_1%3a1.8.4-2_amd64.deb
libxcb-xv0_1.13.1-2_amd64.deb
libupnp13_1%3a1.8.4-2_amd64.deb
vlc-l10n_3.0.11-0+deb10u1_all.deb
libgroupsock8_2018.11.26-1.1_amd64.deb
vlc-data_3.0.11-0+deb10u1_all.deb
libvlc5_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-video-splitter_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-visualization_3.0.11-0+deb10u1_amd64.deb
libsidplay2_2.1.1-15_amd64.deb
libaribb24-0_1.0.3-2_amd64.deb
libresid-builder0c2a_2.1.1-15_amd64.deb
libdvbpsi10_1.3.2-1_amd64.deb
libproxy-tools_0.4.15-5_amd64.deb
vlc-plugin-qt_3.0.11-0+deb10u1_amd64.deb
vlc_3.0.11-0+deb10u1_amd64.deb
libmatroska6v5_1.4.9-1+deb10u1_amd64.deb
liblirc-client0_0.10.1-5.2_amd64.deb
vlc-plugin-skins2_3.0.11-0+deb10u1_amd64.deb
libebml4v5_1.3.6-2_amd64.deb
libbasicusageenvironment1_2018.11.26-1.1_amd64.deb
libprotobuf-lite17_3.6.1.3-2_amd64.deb
vlc-bin_3.0.11-0+deb10u1_amd64.deb
libsdl-image1.2_1.2.12-10+deb10u1_amd64.deb
libvlc-bin_3.0.11-0+deb10u1_amd64.deb
libva-wayland2_2.4.0-1_amd64.deb
liblivemedia64_2018.11.26-1.1_amd64.deb
vlc-plugin-video-output_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-base_3.0.11-0+deb10u1_amd64.deb
libspatialaudio0_0.3.0+git20180730+dfsg1-2_amd64.deb
vlc-plugin-samba_3.0.11-0+deb10u1_amd64.deb
libopenmpt-modplug1_0.4.3-1+deb10u1_amd64.deb
libusageenvironment3_2018.11.26-1.1_amd64.deb
libplacebo7_1.7.0-2_amd64.deb
libvlccore9_3.0.11-0+deb10u1_amd64.deb

I want to be able to install and remove packages offline.

I don't want to have residual packages on my system.

peter7089 07-31-2020 07:40 AM

Quote:

Originally Posted by ondoho (Post 6151263)
It should, unless they are still needed by some other application.
Yes, this can happen with optional dependencies, called "Install Recommends" in Debian-speak.
It is possible to tell apt to not install recommends at all.

What dependencies did vlc pull in?

BTW, don't use dpkg unless absolutely necessary.
Why couldn't you just 'apt install vlc'?

I think when you install deb files locally they are marked as manually installed and 'apt autoremove' won't remove them.

ondoho 07-31-2020 07:57 AM

How did you install these dependencies?
If manually, then apt doesn't see them as dependencies at all because you installed them yourself.
You have to then equally manually uninstall them.

It's possible to install offline with apt, too.
Recommended, less chance to break your system.

HappyTux 07-31-2020 08:07 AM

Quote:

Originally Posted by peter7089 (Post 6151277)
deborphan doesn't list them and removing them by name is not convinient when they are many. These are the deb files:
Code:

vlc-plugin-notify_3.0.11-0+deb10u1_amd64.deb
libixml10_1%3a1.8.4-2_amd64.deb
libxcb-xv0_1.13.1-2_amd64.deb
libupnp13_1%3a1.8.4-2_amd64.deb
vlc-l10n_3.0.11-0+deb10u1_all.deb
libgroupsock8_2018.11.26-1.1_amd64.deb
vlc-data_3.0.11-0+deb10u1_all.deb
libvlc5_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-video-splitter_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-visualization_3.0.11-0+deb10u1_amd64.deb
libsidplay2_2.1.1-15_amd64.deb
libaribb24-0_1.0.3-2_amd64.deb
libresid-builder0c2a_2.1.1-15_amd64.deb
libdvbpsi10_1.3.2-1_amd64.deb
libproxy-tools_0.4.15-5_amd64.deb
vlc-plugin-qt_3.0.11-0+deb10u1_amd64.deb
vlc_3.0.11-0+deb10u1_amd64.deb
libmatroska6v5_1.4.9-1+deb10u1_amd64.deb
liblirc-client0_0.10.1-5.2_amd64.deb
vlc-plugin-skins2_3.0.11-0+deb10u1_amd64.deb
libebml4v5_1.3.6-2_amd64.deb
libbasicusageenvironment1_2018.11.26-1.1_amd64.deb
libprotobuf-lite17_3.6.1.3-2_amd64.deb
vlc-bin_3.0.11-0+deb10u1_amd64.deb
libsdl-image1.2_1.2.12-10+deb10u1_amd64.deb
libvlc-bin_3.0.11-0+deb10u1_amd64.deb
libva-wayland2_2.4.0-1_amd64.deb
liblivemedia64_2018.11.26-1.1_amd64.deb
vlc-plugin-video-output_3.0.11-0+deb10u1_amd64.deb
vlc-plugin-base_3.0.11-0+deb10u1_amd64.deb
libspatialaudio0_0.3.0+git20180730+dfsg1-2_amd64.deb
vlc-plugin-samba_3.0.11-0+deb10u1_amd64.deb
libopenmpt-modplug1_0.4.3-1+deb10u1_amd64.deb
libusageenvironment3_2018.11.26-1.1_amd64.deb
libplacebo7_1.7.0-2_amd64.deb
libvlccore9_3.0.11-0+deb10u1_amd64.deb

I want to be able to install and remove packages offline.

I don't want to have residual packages on my system.

It was a tough one to do but copy and paste this line into your terminal and type in the password once you have changed into the directory containing the packages. Most likely in /var/cache/apt/archives/ now they were installed.

Code:

sudo dpkg --remove vlc-plugin-notify_3.0.11-0+deb10u1_amd64.deb libixml10_1%3a1.8.4-2_amd64.deb libxcb-xv0_1.13.1-2_amd64.deb libupnp13_1%3a1.8.4-2_amd64.deb vlc-l10n_3.0.11-0+deb10u1_all.deb libgroupsock8_2018.11.26-1.1_amd64.deb vlc-data_3.0.11-0+deb10u1_all.deb libvlc5_3.0.11-0+deb10u1_amd64.deb vlc-plugin-video-splitter_3.0.11-0+deb10u1_amd64.deb vlc-plugin-visualization_3.0.11-0+deb10u1_amd64.deb libsidplay2_2.1.1-15_amd64.deb libaribb24-0_1.0.3-2_amd64.deb libresid builder0c2a_2.1.1-15_amd64.deb libdvbpsi10_1.3.2-1_amd64.deb libproxy-tools_0.4.15-5_amd64.deb vlc-plugin-qt_3.0.11-0+deb10u1_amd64.deb vlc_3.0.11-0+deb10u1_amd64.deb libmatroska6v5_1.4.9-1+deb10u1_amd64.deb liblirc-client0_0.10.1-5.2_amd64.deb vlc-plugin-skins2_3.0.11-0+deb10u1_amd64.deb
libebml4v5_1.3.6-2_amd64.deb libbasicusageenvironment1_2018.11.26-1.1_amd64.deb libprotobuf-lite17_3.6.1.3-2_amd64.deb vlc-bin_3.0.11-0+deb10u1_amd64.deb libsdl-image1.2_1.2.12-10+deb10u1_amd64.deb libvlc-bin_3.0.11-0+deb10u1_amd64.deb libva-wayland2_2.4.0-1_amd64.deb liblivemedia64_2018.11.26-1.1_amd64.deb vlc-plugin-video-output_3.0.11-0+deb10u1_amd64.deb vlc-plugin-base_3.0.11-0+deb10u1_amd64.deb libspatialaudio0_0.3.0+git20180730+dfsg1-2_amd64.deb vlc-plugin-samba_3.0.11-0+deb10u1_amd64.deb libopenmpt-modplug1_0.4.3-1+deb10u1_amd64.deb libusageenvironment3_2018.11.26-1.1_amd64.deb libplacebo7_1.7.0-2_amd64.deb libvlccore9_3.0.11-0+deb10u1_amd64.deb

Edit: and now I think since you want no unnecessary items on your system a sudo apt clean will eliminate the packages in the already mentioned cache directory freeing up that space too...

shruggy 07-31-2020 08:33 AM

Quote:

Originally Posted by peter7089 (Post 6151277)
deborphan doesn't list them

If deborphan doesn't list those lib* packages then they're still needed, perhaps not by vlc, but by some other installed package(s). You may try harder though by specifying the -n option to deborphan.

peter7089 07-31-2020 09:27 AM

Quote:

Originally Posted by ondoho (Post 6151286)
How did you install these dependencies?
If manually, then apt doesn't see them as dependencies at all because you installed them yourself.
You have to then equally manually uninstall them.

Let me guess, you deleted the original .deb's and don't know anymore?
It's in a log file, somewhere under /var/log. Not sure dpkg logs to apt's log, maybe it has its own.

It's possible to install offline with apt, too.
Recommended, less chance to break your system.

No, i didn't delete the deb files. I run 'sudo apt clean' before running 'sudo apt --download-only install vlc', than i moved the packages to a folder.

But i think i found how to install dependency automatically when i am offline. I tested that with other application - geany, because i can't do that with vlc anymore. If i run 'sudo apt install geany' it installs only two packages - geany and geany-common. So, i downloaded the packages with 'sudo apt --download-only geany', then disconnected from internet and run 'sudo apt install geany' and this installed the application. After that i removed geany with 'sudo apt remove geany' and when i run 'sudo apt autoremove' it removed geany-common also.

So, i guess if i am offline and want to install deb packages i better copy them to /var/cache/apt/archive and run 'sudo apt install packname'. This way the dependencies will be installed automatically and after that can be removed with 'apt autoremove'.

peter7089 07-31-2020 09:31 AM

Quote:

Originally Posted by HappyTux (Post 6151291)
It was a tough one to do but copy and paste this line into your terminal and type in the password once you have changed into the directory containing the packages. Most likely in /var/cache/apt/archives/ now they were installed.

Code:

sudo dpkg --remove vlc-plugin-notify_3.0.11-0+deb10u1_amd64.deb libixml10_1%3a1.8.4-2_amd64.deb libxcb-xv0_1.13.1-2_amd64.deb libupnp13_1%3a1.8.4-2_amd64.deb vlc-l10n_3.0.11-0+deb10u1_all.deb libgroupsock8_2018.11.26-1.1_amd64.deb vlc-data_3.0.11-0+deb10u1_all.deb libvlc5_3.0.11-0+deb10u1_amd64.deb vlc-plugin-video-splitter_3.0.11-0+deb10u1_amd64.deb vlc-plugin-visualization_3.0.11-0+deb10u1_amd64.deb libsidplay2_2.1.1-15_amd64.deb libaribb24-0_1.0.3-2_amd64.deb libresid builder0c2a_2.1.1-15_amd64.deb libdvbpsi10_1.3.2-1_amd64.deb libproxy-tools_0.4.15-5_amd64.deb vlc-plugin-qt_3.0.11-0+deb10u1_amd64.deb vlc_3.0.11-0+deb10u1_amd64.deb libmatroska6v5_1.4.9-1+deb10u1_amd64.deb liblirc-client0_0.10.1-5.2_amd64.deb vlc-plugin-skins2_3.0.11-0+deb10u1_amd64.deb
libebml4v5_1.3.6-2_amd64.deb libbasicusageenvironment1_2018.11.26-1.1_amd64.deb libprotobuf-lite17_3.6.1.3-2_amd64.deb vlc-bin_3.0.11-0+deb10u1_amd64.deb libsdl-image1.2_1.2.12-10+deb10u1_amd64.deb libvlc-bin_3.0.11-0+deb10u1_amd64.deb libva-wayland2_2.4.0-1_amd64.deb liblivemedia64_2018.11.26-1.1_amd64.deb vlc-plugin-video-output_3.0.11-0+deb10u1_amd64.deb vlc-plugin-base_3.0.11-0+deb10u1_amd64.deb libspatialaudio0_0.3.0+git20180730+dfsg1-2_amd64.deb vlc-plugin-samba_3.0.11-0+deb10u1_amd64.deb libopenmpt-modplug1_0.4.3-1+deb10u1_amd64.deb libusageenvironment3_2018.11.26-1.1_amd64.deb libplacebo7_1.7.0-2_amd64.deb libvlccore9_3.0.11-0+deb10u1_amd64.deb

Edit: and now I think since you want no unnecessary items on your system a sudo apt clean will eliminate the packages in the already mentioned cache directory freeing up that space too...


This doesn't work, i already tried it. It's probably because the packages are installed with different names.

peter7089 07-31-2020 09:33 AM

Quote:

Originally Posted by shruggy (Post 6151300)
If deborphan doesn't list those lib* packages then they're still needed, perhaps not by vlc, but by some other installed package(s). You may try harder though by specifying the -n option to deborphan.

If i run 'deborphan -n' it list these packages:
Code:

fcitx-frontend-qt5
fcitx5-module-quickphrase-editor
fonts-noto-hinted
fonts-roboto-hinted
gir1.2-ayatanaappindicator3-0.1
gir1.2-gtksource-3.0
gir1.2-secret-1
gir1.2-webkit2-4.0
gnome-keyring-pkcs11
gstreamer1.0-gl
hunspell-gl-es
hunspell-sv-se
kodi-visualization-spectrum
libaacs0
libbdplus0
libblockdev-crypto2
libcanberra-gtk3-module
libcec4
libclutter-1.0-common
libcogl-common
libcupsfilters1
libenchant-voikko
libgail-common
libgdk-pixbuf2.0-bin
libmtp-runtime
libqt5sql5-sqlite
libsasl2-modules
libu2f-udev
libwacom-bin
qt5-gtk-platformtheme
qtwayland5
tix


shruggy 07-31-2020 12:45 PM

Those packages are not dependencies of anything else. You should know better than us if you need them. If you don't know what they are then you probably can remove them.

ondoho 08-01-2020 03:32 AM

Quote:

Originally Posted by peter7089 (Post 6151329)
But i think i found how to install dependency automatically when i am offline. I tested that with other application - geany, because i can't do that with vlc anymore. If i run 'sudo apt install geany' it installs only two packages - geany and geany-common. So, i downloaded the packages with 'sudo apt --download-only geany', then disconnected from internet and run 'sudo apt install geany' and this installed the application. After that i removed geany with 'sudo apt remove geany' and when i run 'sudo apt autoremove' it removed geany-common also.

That's what I meant.
It has the advantage that you allow apt to take full care of your package management which is highly recommended on a Debian system.


All times are GMT -5. The time now is 01:23 AM.