LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Removing Packages (quick question) (https://www.linuxquestions.org/questions/debian-26/removing-packages-quick-question-233077/)

talkingwires 09-20-2004 04:41 PM

Removing Packages (quick question)
 
Okay, this is probably a complete newbie question, but I tried a search but didn't turn up anything. Here goes:

I'd like to remove some stuff from Debian. Mostly all the games, a big portion of KDE (keeping just the core for running the occasion QT app), and some of the more useless Gnome utilites. Y'know, stuff I'll never use. My problem is when I try to remove a file using Synaptic Package Manager, it tries to remove a lot of stuff related to the file that I kinda need. For example, when I try to kill off some random Gnome utility, it tries to remove Gnome along with the utility. There has to be a way around this, but I can't figure it out. Any help?

ToniT 09-20-2004 04:50 PM

To remove package foo:
Code:

apt-get remove foo
If there is some spesific problem with some spesific package, please give the output of the above command and let's see what is wrong with it.

leonscape 09-20-2004 04:54 PM

In additon to what ToniT said you can also do

apt-get remove --purge foo

Which also removes and configuration files, and other misc pieces for foo.

talkingwires 09-20-2004 04:58 PM

Yes, I can remove packages that way. However, I'd prefer to use the Synaptic Package Manager, so I can have a nice overview of what's installed and browse through it easily. Removing packages from the command line requires closing the Package Manager down, removing the package, and launching the Package Manager again, since it puts a lock on the package database while it is open.

Edit: For example, try marking kde-games for removal in the Package Manager. When you hit "Apply", it will try to remove kde, too.

ToniT 09-20-2004 05:44 PM

kde is a metapackage that depends on all the kde software. So, in a package management sense, if you remove kde-games (which is also a metapackage depending on all the kde games), you don't have the whole kde anymore, but just independent parts of it.

talkingwires 09-20-2004 07:42 PM

Oh. Well, that kinda sucks.

leonscape 09-20-2004 07:47 PM

Not really, as when you remove a meta-package you don't remove the actual things it installed. KDE won't disappear if you remove the kde meta-package.

the_shaman 09-21-2004 12:32 AM

talkingwires, while Synaptic is all nice and spiffy as with all GUI apps, you can never know when it will fail to fire up i.e. could well be at the next upgrade to Synaptic ;). So better get attuned to commands like COLUMNS=200 dpkg -l | less; apt-get -dy dist-upgrade; apt-get --reinstall install package; apt-get --purge remove package; apt-get -t unstable build-dep unstable package; apt-get -t unstable --build source package; dpkg --purge package; apt-cache search package; apt-cache show package; apt-cache showpkg package; apt-cache depend package; apt-cache rdepend package; apt-cache showsrc package; echo package hold|dpkg --set-selections; echo package install|dpkg --set-selections; dpkg --get-selections | grep package; dpkg -S, dpkg --listfiles and handy utilities like apt-show-versions, wajig and APT Pinning. ;)

Also the minute you get to a dpkg install error e.g.
dpkg: error while cleaning up:
subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/bash_3.0-4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Synaptic will throw exit the install and you'll be left to rectify the prob in a terminal :D. So might as well get used to the apt and dpkg commands e.g. dpkg --force overwite -i /path-to-cached-package. :)

eclypse80 03-13-2009 11:52 AM

Quote:

Originally Posted by leonscape (Post 1187537)
Not really, as when you remove a meta-package you don't remove the actual things it installed. KDE won't disappear if you remove the kde meta-package.

Is this statement accurate. Why is it when I remove kdegames, which wants to remove the kde metapackage, does it proceed to uninstall all my cd players and other things not specifically listed in kdegames?

Code:

:~> sudo aptitude remove kdegames
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following packages are BROKEN:
  kde
The following packages will be REMOVED:
  kdegames
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 53.2kB will be freed.
The following packages have unmet dependencies:
  kde: Depends: kdegames (>= 4:3.5.5) but it is not installable
The following actions will resolve these dependencies:

Remove the following packages:
kde

Score is 119

Accept this solution? [Y/n/q/?] Y
The following packages will be REMOVED:
  amor{u} ark{u} artsbuilder{u} atlantik{u} atlantikdesigner{u} blinken{u} dosfstools{u} edict{u} eyesapplet{u} fifteenapplet{u} indi{u} juk{u} kaddressbook-plugins{u} kalzium{u} kalzium-data{u}
  kanagram{u} kanjidic{u} kasteroids{u} kate-plugins{u} katomic{u} kaudiocreator{u} kbackgammon{u} kbattleship{u} kblackbox{u} kbounce{u} kbruch{u} kbstate{u} kcalc{u} kcharselect{u}
  kcoloredit{u} kde{a} kdeaccessibility{u} kdeaddons{u} kdeaddons-kfile-plugins{u} kdeartwork{u} kdeartwork-emoticons{u} kdeartwork-misc{u} kdeartwork-style{u} kdeartwork-theme-icon{u}
  kdeartwork-theme-window{u} kdeedu{u} kdeedu-data{u} kdegames kdegames-card-data{u} kdegraphics{u} kdegraphics-kfile-plugins{u} kdelirc{u} kdemultimedia{u} kdemultimedia-kappfinder-data{u}
  kdemultimedia-kfile-plugins{u} kdessh{u} kdetoys{u} kdeutils{u} kdewallpapers{u} kdewebdev{u} kdf{u} kdvi{u} kedit{u} keduca{u} kenolaba{u} kfax{u} kfaxview{u} kfilereplace{u} kfloppy{u}
  kfouleggs{u} kgamma{u} kgeography{u} kgeography-data{u} kgoldrunner{u} kgpg{u} khangman{u} khexedit{u} kicker-applets{u} kiconedit{u} kig{u} kimagemapeditor{u} kiten{u} kjots{u} kjumpingcube{u}
  klatin{u} klettres{u} klettres-data{u} klickety{u} klines{u} klinkstatus{u} kmag{u} kmahjongg{u} kmid{u} kmilo{u} kmines{u} kmix{u} kmoon{u} kmousetool{u} kmouth{u} kmplot{u} kmrml{u}
  knetwalk{u} knewsticker-scripts{u} kodo{u} kolf{u} kolourpaint{u} kommander{u} konq-plugins{u} konquest{u} kooka{u} kpat{u} kpercentage{u} kpoker{u} kpovmodeler{u} krec{u} kreversi{u} kruler{u}
  ksame{u} ksayit{u} kscd{u} kscreensaver{u} kshisen{u} ksig{u} ksim{u} ksirtet{u} ksmiletris{u} ksnake{u} ksnapshot{u} ksokoban{u} kspaceduel{u} kstars{u} kstars-data{u} ksvg{u} kteatime{u}
  ktimer{u} ktouch{u} ktron{u} kttsd{u} ktuberling{u} kturtle{u} ktux{u} kuickshow{u} kverbos{u} kview{u} kviewshell{u} kvoctrain{u} kwalletmanager{u} kweather{u} kwin4{u} kwordquiz{u}
  kworldclock{u} kxsldbg{u} libarts1-audiofile{u} libarts1-mpeglib{u} libarts1-xine{u} libboost-python1.34.1{u} libconvert-binhex-perl{u} libcrypt-ssleay-perl{u} libdb4.6++{u}
  libfinance-quote-perl{u} libhtml-tableextract-perl{u} libio-stringy-perl{u} libkdeedu3{u} libkdegames1{u} libkiten1{u} libkscan1{u} libmime-tools-perl{u} libnews-nntpclient-perl{u}
  libpoppler-qt2{u} libtidy-0.99-0{u} libtiff-tools{u} lskat{u} mpeglib{u} noatun{u} noatun-plugins{u} quanta{u} quanta-data{u} superkaramba{u} tidy{u} ttf-dustin{u} ttf-kochi-gothic{u}
  ttf-sjfonts{u}
0 packages upgraded, 0 newly installed, 177 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 303MB will be freed.
Do you want to continue? [Y/n/?]


Telemachos 03-13-2009 07:24 PM

Quote:

Originally Posted by eclypse80 (Post 3474461)
Is this statement accurate. Why is it when I remove kdegames, which wants to remove the kde metapackage, does it proceed to uninstall all my cd players and other things not specifically listed in kdegames?

It's accurate if you use apt-get, not if you use aptitude (as you do below). If you want to surgically remove a single package from a metapackage and leave the rest alone - and you normally use aptitude - do this:
Code:

apt-get remove kdegames
aptitude keep-all

Then you should be fine.

eclypse80 03-16-2009 12:41 PM

Thanks for the pointer, however that didn't quite work either. Since kdegames itself is a metapackage, the apt-get command removed just the metapackages kdegames and kde with the apt-get remove kdegames command.

I guess what I need to do instead is remove the individual packages listed in the kdegames metapackage using apt-get.

Seems there should be an easier way that I have not found yet.


Code:

# apt-get remove kdegames
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  knetwalk kpat kalzium-data ksokoban kolf kdemultimedia-kappfinder-data blinken krec libdb4.6++ kscd kshisen kmoon kdeartwork-style kmahjongg ksig ksim libkscan1 kcharselect kcoloredit artsbuilder
  kdessh kanagram kdeartwork-theme-window kmrml katomic ksvg kruler kdemultimedia-kfile-plugins ktux libio-stringy-perl klettres kgoldrunner kbackgammon kpoker atlantikdesigner libkiten1 kgeography
  ksnapshot kooka kenolaba kblackbox libboost-python1.34.1 libnews-nntpclient-perl klatin kfloppy kstars ttf-dustin libcrypt-ssleay-perl ksame kbruch kdeaddons-kfile-plugins kfilereplace
  libmime-tools-perl kcalc kicker-applets libpoppler-qt2 dosfstools keduca libarts1-xine knewsticker-scripts kaudiocreator kdeedu-data kimagemapeditor kwalletmanager kweather kmplot ttf-kochi-gothic
  kalzium klinkstatus klickety kpovmodeler ksayit konq-plugins kmouth kworldclock mpeglib kdewebdev amor kdeaccessibility ktouch khexedit kedit kbounce kvoctrain kdetoys atlantik kbstate tidy ark
  kwordquiz superkaramba kview noatun-plugins ktron kdegraphics-kfile-plugins ttf-sjfonts kttsd kwin4 kate-plugins kdeaddons kreversi kdf kspaceduel kig juk noatun klines kfaxview kstars-data edict
  lskat kviewshell kgamma kommander kdegames-card-data libarts1-mpeglib kaddressbook-plugins kgeography-data kdeutils kjumpingcube kdegraphics khangman libfinance-quote-perl kdeartwork-theme-icon
  kdeartwork-misc kscreensaver kanjidic ksmiletris kxsldbg quanta kbattleship kiconedit kasteroids kfouleggs libkdeedu3 ksnake kiten libtiff-tools eyesapplet indi kdeedu kdewallpapers kdelirc
  kpercentage libkdegames1 kjots klettres-data kfax kdeartwork-emoticons libconvert-binhex-perl ksirtet kmines kdvi kuickshow kgpg konquest kolourpaint fifteenapplet kdemultimedia kmousetool kmag
  libtidy-0.99-0 libhtml-tableextract-perl kmilo ktuberling kturtle ktimer quanta-data kmid kteatime kverbos kmix kdeartwork kodo libarts1-audiofile
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  kde kdegames
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 94.2kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 328491 files and directories currently installed.)
Removing kde ...
Removing kdegames ...
mcarvalh-deb5-64:/home/mcarvalh# aptitude keep-all
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

kde and kdegames are now gone, but since kdegames itself was a metapackage, the packages it install remained, for example atlantik
Code:

# dpkg -l | grep atlantik
ii  atlantik                                                4:3.5.10-1                    KDE client for Monopoly-like network games
ii  atlantikdesigner                                        4:3.5.9-2                    game board designer for Atlantik


Telemachos 03-16-2009 07:26 PM

Quote:

Originally Posted by eclypse80 (Post 3477340)
Thanks for the pointer, however that didn't quite work either. Since kdegames itself is a metapackage, the apt-get command removed just the metapackages kdegames and kde with the apt-get remove kdegames command.

I guess what I need to do instead is remove the individual packages listed in the kdegames metapackage using apt-get.

My advice was aimed at the situation where you didn't want to remove all the other packages (that's why I said "surgically remove").

But yes, if you did want to remove everything, you can do it explicitly by listing the individual package names from here.

kushalkoolwal 03-16-2009 07:53 PM

Quote:

Originally Posted by talkingwires (Post 1187254)
Okay, this is probably a complete newbie question, but I tried a search but didn't turn up anything. Here goes:

I'd like to remove some stuff from Debian. Mostly all the games, a big portion of KDE (keeping just the core for running the occasion QT app), and some of the more useless Gnome utilites. Y'know, stuff I'll never use. My problem is when I try to remove a file using Synaptic Package Manager, it tries to remove a lot of stuff related to the file that I kinda need. For example, when I try to kill off some random Gnome utility, it tries to remove Gnome along with the utility. There has to be a way around this, but I can't figure it out. Any help?

Your best option WAS when you decided to install was to do:
Code:

apt-get install xserver-xorg-core xfonts-base kde-core kdm
Then you can selectively installed whatever kde software you would like to install.

craigevil 03-16-2009 10:41 PM

Turn off autoremove as well as recommends/suggests when installing things.


Create a apt.conf or modify it if it already exists and add the following:

/ auto-remove breaks on meta packages
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Debug::pkgAutoRemove "0";

And use apt-get rather than aptitude especially if you are running testing or sid, and if you tend to install/remove packages a lot.

My suggestion would be to remove the metapackages then tell apt-get to reinstall the individual packages.

I use the above in my apt.conf and I try not to install metapackages, in the 5 yrs of running Sid I have had very few issues with things wanting to be removed that I didn't want to remove.

Telemachos 03-17-2009 06:38 AM

Quote:

Originally Posted by craigevil (Post 3477801)
And use apt-get rather than aptitude especially if you are running testing or sid, and if you tend to install/remove packages a lot.

This is a preference - and you have every right to it - but there's nothing wrong with Aptitude even for Testing and Sid. (I use it on both.)


All times are GMT -5. The time now is 12:16 PM.