• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

[Ubuntu]Clean-up?

This is my first install of Ubuntu that I've actually used for longer than a month, and over this time I've probably installed, uninstalled, deleted and added some random things here and there, making things a nice big mess.

I'm thinking I'll just reinstall and start fresh, and only download the applications that I know I'll want, and all that. However, is there a better way to get rid of unused files?
 
When you get rid of package you can go:
apt-get --purge remove blah

And the --purge will get rid of configuration files.

Also there is Deborphan. This guy goes through and looks for packages which were installed for dependancies for packages you no longer have installed or are no longer relevent. (like a package upgrade removed a dependancy)

deborphan command simply shows a list of these things.. so you can go:
apt-get remove --purge `deborphan`
to remove them.

So just go through your system and uninstall what you don't want anymore, then do a command like that above to remove obsolete packages.

Then do a
apt-get clean
to clean up cache'd packages to get some disk space back if you need them.

If you want you can install 'wajig'.

I like wajig a lot, it's a front end that takes all the different dpkg, apt-get, aptitude and other debian tools and puts them under one interface.

So apt-get install wajig
then install the recommended/suggested packages their for additional functionality then go:
wajig list-commands |less

To get a list of commands you can run.

This way you can do searches on files and such to find out what packages they belong to. Help you install rpm files if you need to and stuff like that. All sorts of different things. The 'mother' of all package management tools.
 
If you can use aptitude, you can do some nice things by customizing views.

1) Start aptitude
2) Choose Views->New Flat Package List
3) Choose Search->Limit Display
4) For the filter string, enter ~i !~M

This shows a flat list of packages that were specifically requested, rather than just auto-installed to fulfill dependencies. You can purge items out of that, and then further purge any packages that are auto-removed because they're no longer needed.

You still need to know which packages are needed and which are not. Usually, you can tell when you ask to remove something and a bunch of other things are marked broken. Then you do a Ctrl-U to undo. But you can definitely break your system this way if you're not careful.
 
Whoa. I'll definitely be using that sometime. The problem I'm facing is that I don't quite remember what I had installed, since I was just starting out and copy & pasting lines. Now I know a little better than that, but it doesn't help me with my current problem. I'm not sure how I'd go about finding out which files shouldn't be here anymore without knowing the specifics. I think a reinstall would do some good, then after that I can start paying attention to what I'm installing.

Oh, and does -purge only work for packages installed via apt-get? What about things compiled from source?
 
Originally posted by: drag
Also there is Deborphan. This guy goes through and looks for packages which were installed for dependancies for packages you no longer have installed or are no longer relevent. (like a package upgrade removed a dependancy)
Does Ubuntu's default package management not track auto-installs as Debian's aptitude does?

If not, then what I said won't work. And would make the Ubuntu default seem pretty crappy IMO.

 
http://ubuntuforums.org/showthread.php?t=140920
This will help you get rid of some crap.

A lot of the usage lag comes from your own home directory so consider just making a new home dir and migrating certain files to your new one. Probably because of GNOME. I've done it and my system always seems snappier afterwards.

What you sound like you want is something to scan for packages that don't depend on anything and nothing depends on them, etc. For example, you install a library that nothing uses. Well, you'd get rid of that. I'm not sure if there's anything to find packages like that. I'm sure replies will follow. 🙂
 
Originally posted by: xtknight
http://ubuntuforums.org/showthread.php?t=140920
This will help you get rid of some crap.

A lot of the usage lag comes from your own home directory so consider just making a new home dir and migrating certain files to your new one. Probably because of GNOME. I've done it and my system always seems snappier afterwards.

What you sound like you want is something to scan for packages that don't depend on anything and nothing depends on them, etc. For example, you install a library that nothing uses. Well, you'd get rid of that. I'm not sure if there's anything to find packages like that. I'm sure replies will follow. 🙂

I found that thread a little while back. Woo, great thread. Yeah, I'm looking for what you mentioned. =)
 
~i !~M .. hmm.. that's pretty awesome. That's what I was looking for (seems extremely close to it anyway). Like performing a delta vs. the original Dapper desktop install image. Can you explain that syntax?
 
Originally posted by: LoKe
Oh, and does -purge only work for packages installed via apt-get? What about things compiled from source?

purge works for any Debian package (dpkg files). It gets rid of config files. Dpkgs can be gotten from repositories (apt-get) or some people post them on forums. If 'checkinstall' is used during compile, it will generate a dpkg from the compile. So you can purge checkinstall packages. Anything under the 'checkinstall' package section is definitely a checkinstall (custom) pkg, but checkinstall allows them to change the section of the dpkg (to "libs" for example) so there could be checkinstall packages elsewhere. Hope that makes sense.

This gives me ideas for a script. I'll have to read up on aptitude some more, it seems pretty powerful.
 
Originally posted by: xtknight
~i !~M .. hmm.. that's pretty awesome.
It is pretty awesome. It basically rolls up the old functionality of deborphan right into aptitude, so you don't have to switch between looking at deborphan's list and running package manager commands. It took me a while to realize why aptitude really was better than dselect. This is one reason why.
That's what I was looking for (seems extremely close to it anyway). Like performing a delta vs. the original Dapper desktop install image.
Mmm... it's not really that at all. It's going to show all the installed packages that are not marked "auto". This is going to include many, if not all, of the default packages because I don't think anything is marked "auto" in installation. I'm not sure, though - I haven't examined how Ubuntu handles it.
Can you explain that syntax?
~i = installed packages
~M = auto-installed packages
! = not

So, ~i !~M = the installed packages, but not the auto-installed packages. You can see a list of all the possible search patterns (there are many) here.

 
Originally posted by: LoKe
So whenever compiling, I should be using checkinstall when possible? I've used it a couple times and like it. =]

This is my minimal pain compile (tm) (saves me lots of trouble by specifying pkgconfig because it rarely works by default with some compiles!):

PKG_CONFIG_PATH=/usr/lib/pkgconfig ./configure --prefix=/usr
make
sudo -H -s
checkinstall -D (this does make install by default anyway so you don't need to do checkinstall -D make install)

It's worked for all my packages so far. And it makes the stuff easy to remove (it tracks exactly what make install does and puts it into the dpkg). Plus you can distribute them to other people who may not know how to compile. It'll prompt you for descriptions/names/etc. Aptitude search ref manual: http://people.debian.org/~dburrows/aptitude-doc/en/ch02s03.html
 
How do you specify a ! on the command line?

$ aptitude search ~i~scheckinstall
From what I understand this returns all installed packages that exist in section "checkinstall"

What if I, for example, want to return all installed packages that are not from "checkinstall"?

$ aptitude search ~i!~scheckinstall
bash: !~scheckinstall: event not found
 
Can you single quote it? Or maybe backslash it? "!" is some special bash construct that I never actually use, but tends to get in my way when I'm scripting. 🙂
 
Yeah, \ works.

Here's a quick script I made to remove all "residual config" packages (removed but not purged):

I recommend you run it without the xargs~ first because I'm still a noob at scripting. 😛
 
Originally posted by: cleverhandle
Originally posted by: drag
Also there is Deborphan. This guy goes through and looks for packages which were installed for dependancies for packages you no longer have installed or are no longer relevent. (like a package upgrade removed a dependancy)
Does Ubuntu's default package management not track auto-installs as Debian's aptitude does?

If not, then what I said won't work. And would make the Ubuntu default seem pretty crappy IMO.



Ubuntu = Debian Unstable Snapshot + upgraded Gnome + upgraded X + assorted small modifications.

(all of which filter back down to Debian usually. 🙂 .. Like Xorg 7 Seriously, Debian is getting Etch out on time, the first EVER time a stable release is on track at this point in it's life! All due to Ubuntu. It's great. Ubuntu is the about the best thing to ever happen to Debian)


So it should be exactly the same.


But I don't use aptitude for anything.. I prefer straight command line.

But seriously. Check out Wajig. It kicks-ass. Incorporates aptitude commands into itself and everything...
$ wajig list
list list-alts list-commands list-files list-installed list-names list-scripts list-status
list-all list-cache list-daemons list-hold list-log list-orphans list-section list-wide
drag@tweety:~/Downloads$ wajig listcommands
All JIG commands:

addcdrom Add a CD-ROM to the list of available sources of packages
auto-alts Mark the alternative to be auto set (using set priorities)
auto-clean Remove superseded deb files from the download cache
auto-download Do an update followed by a download of all updated packages
auto-install Perform an install without asking questions (non-interactive)
available List versions of packages available for installation
bug Check reported bugs in package using the Debian Bug Tracker
build Retrieve/unpack sources and build .deb for the named packages
build-depend Retrieve packages required to build listed packages
changelog Retrieve latest changelog for the package
clean Remove all deb files from the download cache
commands List all the JIG commands and one line descriptions for each
daily-upgrade Perform an update then a dist-upgrade
dependents List of packages which depend/recommend/suggest the package
describe One line description of packages (-v and -vv for more detail)
describe-new One line description of new packages
detail Provide a detailed description of package (describe -vv)
detail-new Provide a detailed description of new packages (describe -vv)
dist-upgrade Upgrade to new distribution (installed and new rqd packages)
docs Equivalent to help with -verbose=2
download Download package files ready for an install
file-download Download packages listed in file ready for an install
file-install Install packages listed in a file
file-remove Remove packages listed in a file
find-file Search for a file within installed packages
find-pkg Search for an unofficial Debian package at apt-get.org
fix-configure Perform dpkg --configure -a (to fix interrupted configure)
fix-install Perform apt-get -f install (to fix broken dependencies)
fix-missing Perform apt-get --fix-missing upgrade
force Install packages and ignore file overwrites and depends
help Print documentation (detail depends on --verbose)
hold Place listed packages on hold so they are not upgraded
init Initialise or reset the JIG archive files
install Install (or upgrade) one or more packages or .deb files
installr Install package and associated recommended packages
installrs Install package and recommended and suggested packages
installs Install package and associated suggested packages
install/dist Install packages from specified distribution
integrity Check the integrity of installed packages (through checksums)
large List size of all large (>10MB) installed packages
last-update Identify when an update was last performed
list List the status and description of installed packages
list-all List a one line description of given or all packages
list-alts List the objects that can have alternatives configured
list-cache List the contents of the download cache
list-commands List all the JIG commands and one line descriptions for each
list-daemons List the daemons that JIG can start/stop/restart
list-files List the files that are supplied by the named package
list-hold List those packages on hold
list-installed List packages (with optional argument substring) installed
list-log List the contents of the install/remove log file (filtered)
list-names List all known packages or those containing supplied string
list-orphans List libraries not required by any installed package
list-scripts List the control scripts of the package of deb file
list-section List packages that belong to a specific section
list-section List the sections that are available
list-status Same as list but only prints first two columns, not truncated
list-wide Same as list but avoids truncating package names
local-dist-upgrade Dist-upgrade using packages already downloaded
local-upgrade Upgrade using packages already downloaded, but not any others
madison Runs the madison command of apt-cache.
move Move packages in the download cache to a local Debian mirror
new List packages that became available since last update
news Obtain the latest news about the package
new-upgrades List packages newly available for upgrading
non-free List installed packages that do not meet the DFSG
orphans List libraries not required by any installed package
package Generate a .deb file for an installed package
policy From preferences file show priorities/policy (available)
purge Remove one or more packages and configuration files
purge-depend Purge package and those it depend on and not required by others
purge-orphans Purge orphaned libraries (not required by installed packages)
readme Display the package's README file from /usr/share/doc
recursive Download package and any packages it depends on
recommended Install package and associated recommended packages
reconfigure Reconfigure the named installed packages or run gkdebconf
reinstall Reinstall each of the named packages
reload Reload daemon configs, e.g., gdm, apache (see list-daemons)
remove Remove one or more packages (see also purge)
remove-depend Remove package and its dependees not required by others
remove-orphans Remove orphaned libraries (not required by installed packages)
repackage Generate a .deb file for an installed package
reset Initialise or reset the JIG archive files
restart Stop then start a daemon, e.g., gdm, apache (see list-daemons)
rpm2deb Convert a RedHat .rpm file to a Debian .deb file
rpminstall Install a RedHat .rpm package
rpmtodeb Convert a RedHat .rpm file to a Debian .deb file
search Search for packages containing listed words
search-apt Find local Debian archives suitable for sources.list
setup Configure the sources.list file which locates Debian archives
show Provide a detailed description of package [same as detail]
showdistupgrade Trace the steps that a dist-upgrade would perform
showinstall Trace the steps that an install would perform
showremove Trace the steps that a remove would perform
showupgrade Trace the steps that an upgrade would perform
size Print out the size (in K) of all, or listed, installed packages
sizes Print out the size (in K) of all, or listed, installed packages
snapshot Generates list of package=version for all installed packages
source Retrieve and unpack sources for the named packages
start Start a daemon, e.g., gdm, apache (see list-daemons)
status Show the version and available version of packages
status-match Show the version and available version of matching packages
status-search Show the version and available version of matching packages
stop Stop a daemon, e.g., gdm, apache (see list-daemons)
suggested Install package and associated suggested packages
tasksel Run the Gnome task selector to install groups of packages
toupgrade List packages with newer versions available for upgrading
unhold Remove listed packages from hold so they are again upgraded
unofficial Search for an unofficial Debian package at apt-get.org
update Update the list of down-loadable packages
update-alts Update default alternative for things like x-window-manager
update-pci-ids Updates the local list of PCI ids from the internet master list
update-usb-ids Updates the local list of USB ids from the internet master list
upgrade Upgrade all of the installed packages or just those listed
versions List version and distribution of (all) packages.
whatis A synonym for describe
whichpkg Find the package that supplies the given command or file

Command line options:

-h|--help Print usage message.
-q|--quiet Do system commands everything quietly.
-n|--noauth Allow packages from unathenticated archives.
-s|--simulate Trace but don't execute the sequence of underlying commands.
-t|--teaching Trace the sequence of commands performed.
-v|--verbose=n Increase (or set) the level of verbosity (to n).
-y|--yes Assume yes for any questions asked.

Fuller documentation can be found at http://www.togaware.com/wajig.

So to list install packages you go:
wajig list-installed |less

bam! You got all the installed packages.


You cd /usr/bin/
look in there. Is there something you don't want anymore?

wajig find-file oggenc
vorbis-tools: /usr/share/man/man1/oggenc.1.gz
vorbis-tools: /usr/bin/oggenc

I love it.
 
Wow why do aptitude and apt-get even exist with wajig? Seems much better. It even asks you for a sudo password if you forget to type sudo. Try gjig too (GNOME frontend!)
 
Originally posted by: drag
Seriously, Debian is getting Etch out on time, the first EVER time a stable release is on track at this point in it's life! All due to Ubuntu.
Hrm... it's not obvious to me that it's all due to Ubuntu. There was a lot of hullabaloo about Sarge's release process well before Ubuntu became as big as it has. Besides, Ubuntu's not helping on the other architectures that Debian supports. I have no doubt that Debian draws from Ubuntu's stuff, I just wouldn't go so far as you do.
So it should be exactly the same.
Well, it depends on exactly how the installation works. Up through the base "essential" Debian system, everything is installed without "auto" set. After that, at least some things are marked auto, because they use aptitude to install themselves. Ubuntu's installation scheme is a bit simpler, in that it just installs a big, fixed set of packages. I don't know exactly what it uses to do that. And my Ubuntu VM seems to have recently imploded, so I can' t check at the moment.
So to list install packages you go:
wajig list-installed |less
Or you go dpkg -l | less and get the same thing.
You cd /usr/bin/
look in there. Is there something you don't want anymore?

wajig find-file oggenc
vorbis-tools: /usr/share/man/man1/oggenc.1.gz
vorbis-tools: /usr/bin/oggenc
Or you do dpkg -S /usr/bin/oggenc.

I remain unconvinced that wajig does anything that already included tools do not.

edit: I guess I should qualify the last statement as "Does anything generally useful that already included tools do not."
 
Originally posted by: xtknight
Wow why do aptitude and apt-get even exist with wajig? Seems much better. It even asks you for a sudo password if you forget to type sudo. Try gjig too (GNOME frontend!)

Because it uses aptitude and apt-get. 🙂

You know how yum is written in python and sucks? While wajig is written in python and it rocks.. because it uses fast C stuff at it's core.


edit:
All it realy does is take stuff you can already do, but it presents it in a manner were you don't have to have a brain the size of a small house in order to remember how to do.
 
Hrm... it's not obvious to me that it's all due to Ubuntu. There was a lot of hullabaloo about Sarge's release process well before Ubuntu became as big as it has. Besides, Ubuntu's not helping on the other architectures that Debian supports. I have no doubt that Debian draws from Ubuntu's stuff, I just wouldn't go so far as you do.

I agree, Ubuntu's not a bad thing but it's not really helping Debian as much as people think. There was some major threads on patches in Ubuntu not making it back into Debian, some Ubuntu developers will push the patches up to Debian but some expect DDs to watch the Ubuntu launchpad crap for fixes and to pull them on their own. And since there's no package owners in Ubuntu, everyone does what they want to any package, it confuses things even more. The best thing that I think Ubuntu is doing is getting press time and marketshare, on a purely technical level the pros and cons for Debian have probably been a wash.

edit: I guess I should qualify the last statement as "Does anything generally useful that already included tools do not."

And since wajig isn't in base, and never will be since it's done in python and python will never be in base without a rewrite and replacement of all of the current perl stuff, you can be pretty much guaranteed it's not on any systems except those that you install it on. I'd rather use the tools that I know will be there, learning a few switches to dpkg and aptitude isn't really that bad.
 
Or you do dpkg -S /usr/bin/oggenc.

I remain unconvinced that wajig does anything that already included tools do not.

edit: I guess I should qualify the last statement as "Does anything generally useful that already included tools do not."


Never said it did anything that the normal package management tools do.

It will NEVER EVER do anything that normal package management tools can't do. It is mearly a front end to existing tools, nothing beyond that.

It takes dpkg-*, aptitude, apt-get, etc etc and just scripts them all together. Personally I have a hard time remembering all the various functions and whatnot. I don't remember of the top of my head the command switch and which tool (dpkg-*, aptitude, apt-cache, apt-get, etc etc) to use to find a file. Sure I could spend some time looking it up, but I do it so rarely that I'll just forget about it again. (beleive me I've found and refound the command to do that sort of thing several times in the past few years)

Like right this second.. Can you remember how to pull down package build dependancies and packages, and then use fakeroot to rebuild debian packages for backporting to Sarge from Etch? With Wajig it's easy for me.. I know I can do it with regular tools, but I don't remember what command to even look up in 'man' at the moment for most of that stuff.

It's simply a convience, that's all.
 
Originally posted by: drag
Like right this second.. Can you remember how to pull down package build dependancies and packages
apt-get build-dep foo
...and then use fakeroot to rebuild debian packages for backporting to Sarge from Etch?
cd foo
dpkg-buildpackage -rfakeroot somethin-somethin-somethin
🙂

That one I look up, but I do remember where to find it (Debian home->Documentation->Apt How-To->Working with Source Packages). If I were more organized, I'd bookmark it.

(For reference, it's -rfakeroot -uc -b)

Just having fun, though... I understand your point. If it works for you, that's cool. I'd rather have one less tool and work with things that are guaranteed to be installed.

 
Ya forgot the command to fetch the source. "apt-get source foo"
😉

I suppose it's the "way of Linux". It's better for you to know how to do stuff in a 'real' manner then after you understand what is going on then do it the easy way. This way makes life much easier.
 
Back
Top