-   Debian (
-   -   Commands to keep system updated and clean (

rng 01-28-2013 07:25 PM

Commands to keep system updated and clean
I am using Debian Testing with following in the sources.list:

deb testing main contrib non-free
deb testing/updates main contrib non-free
deb testing-proposed-updates main contrib non-free

I am using following commands regularly to keep my system updated and clean.

apt-get update
apt-get dist-upgrade
apt-get -f check
apt-get autoremove
apt-get autoclean

Are they all right and what should be the correct order for using them? Is there any duplicacy/repetition in above commands? There is a command 'wajig purgeorphans'. What is the apt-get equivalent of this command and should I use it regularly? Thanks for your help.

frankbell 01-28-2013 08:08 PM

I use a similar sequence, except that I replace "dist-upgrade" with just "upgrade."

The only time I've used "dist-upgrade" was to go from Lenny to Squeeze. The apt-get man file has a good, clear description of the difference between the two. Maybe I've been wrong to do so, and if so, someone will tell us.

widget 01-28-2013 08:28 PM

I don't usually go from update to dist-upgrade preferring to just use upgrade first so I can keep an eye on things better.

autoremove is a somewhat dangerous command in anything but the stable release. You could possibly remove something that you really should have kept.

-f check is pretty much for diagnostic purposes and I don't see much sense in running it unless you can't figure out what a missing depends is.

autoclean is nice to run once in a while. There could be times when you really want to back up a ways in your testing install because of breakage and you could conceivably want a package that is no longer easy to download. Whould not think that is likely to happen but you may want to concider that. My installs are large enough to be able to just keep the packages stored in /var/cache/apt/archive. You should check the size of it on occasion though just to see if it is getting out of hand.

I would just stick with;

apt-get update
apt-get upgrade
apt-get dist-upgrade

I would also HIGHLY recommend installing the package "apt-listbugs" which will tell you about KNOWN bugs in a package you are installing or upgrading.

You should probably do a little reading on dpkg.

Remember that Debian testing is soon, apon the release of Wheezy as the new stable, to "upgrade" to Jessie. Right now we are in prerelease freeze for fixing bugs. Things will get more interesting when we leave freeze.

I was not, for instance, paying attention when Squeeze was released. My sources.list also reads "testing". The day Squeeze went stable I groggily run my update and woke up quickly when upgrade listed well over 1000 packages and a few hundred held back. That all went well as do most of the regular update/upgrade cycles that have MUCH smaller numbers of packages.

Those do, however, many time have many more upgraded packages every day than we are getting now. It really is nice to know how many of them are buggy coming into your system.

You will find many people that think Sid is safer to run than testing. I do not agree completely with that. I use testing most of the time. Sid gets fixed quicker though if something does break.

I have a testing and a Sid install sharing a /home partition so that I can switch from one to the other as conditions indicate.

If you are new to Debian and used some other distro that was based on Debian in the past you should know that Wheezy is more stable now than some are several months after release. What you may not know is that Jessie will be a long way from release and testing can be quite unstable at times.

I have another pair of installs that are set up more securely that I use for business online. They also share a /home partition. Right now, it is Squeeze and (the one I am on right now) Wheezy. It is good to have a stable install somewhere on your box incase Debian testing and/or Sid become unusable to you.

You will find that knowing something about dpkg and apt-get tools will come in quite handy for keeping them going.

Not in the least trying to discourage you in using testing. Just think you should know that this is about as stable as most distros get right now. Testing is not always this stable.

Some care is called for when running update/upgrade cycles.

rng 01-28-2013 09:12 PM

Thanks for your comments and explanations.

I took the sequence apt-get update and then dist-upgrade from "wajig dailyupgrade" command which uses the same sequence.

According to the man page info, apt-get -f check: here the -f option leads to fixing the broken packages and is not just for diagnostic purpose.

I want a (1)rolling-release and (2)stable distro so that I may not need to reinstall the system every few months. Using "testing" seems to be both rolling release and likely to be more stable than sid, hence this configuration. I understand from your explanation that I have to be careful once the freeze period is over. Is there any better alternative?

Any need of "wajig purge-orphans" or "wajig fix-install"?

Randicus Draco Albus 01-28-2013 09:37 PM

I do not use Testing, but in two years on the Debian forum, I have never seen reference to wajig purge-orphans and wajig fix-install. I have also neither seen them in the basic user guide for APT nor here at LQ. So are they important? My guess is no, but I am only guessing.


I want a (1)rolling-release and (2)stable distro
You desire mutually opposing goals.

Dutch Master 01-28-2013 10:01 PM

I concur with the last speaker. If you want a reasonably stable rolling release, try the latest Mint release. Still Debian based, but the flavouring needs some "acquired taste" ;) I've heard it's good, very good even, but personally I prefer stable over fancy :p

rng 01-28-2013 11:40 PM

"apt-cache search wajig" command output is:

wajig - simple and unified package management for Debian
I found it very useful when I started with Debian as it obviates need for apt-get, apt-cache, dpkg, deselect etc.
The command "wajig commands" will show all commands options available there and it seems very comprehensive. But I am using here apt-get etc since they are more commonly used.

Regarding LMDE (linux mint debian edition) seems a good option but if I can setup Debian-testing only, I would prefer that.

Randicus Draco Albus 01-29-2013 05:14 PM

After reading the thread you linked to, I can say you answered your own question.

I only want to know why this program is not more frequently recommended (as compared to dpkg or apt-get)?

It obviates the need for using different commands like apt-get, apt-cache, dpkg, deselect, aptitude etc.
Most Debian users prefer using those simple commands to using a GUI or anything else that makes the process more complicated. That explains why wajig is so uncommonly used. It is meant to "simplify" administration by providing a tool that has simultaneous links to several different processes. It is not surprising most Debian users eschew it. [Considering how many long-time Debianites despise Synaptic. (I would add a laughing icon, but this board does not have one.)]

snowpine 01-29-2013 05:21 PM

I use simply:


apt-get update
apt-get dist-upgrade

and have never had any problems.

You may wish to edit your sources.list to "wheezy" instead of "testing" so that your install will transition to Stable at some point in the next few months; then you will have attained one of your two mutually exclusive goals (the more important one, in my opinion).

widget 01-30-2013 12:30 PM

Wajig scares the crap out of me just reading about it.

There is no need to reinstall every few months with Debian anyway. Squeeze was released in February of 2011. Will be supported for a year after Wheezy is released as stable.

At this point in development Wheezy is pretty stable. If you were to use "wheezy" instead of "testing" you would simply go on with the new stable release when Wheezy is released.

This would give you a chance to use a good, solid and up to date system for quite a while even if you feel a need for the newest versions of packages. This would give you time to learn to use the base package management system in Debian which is already one of the most simple and reliable around.

It is very rare, unless the user has been doing some rather strange things, for there to be depends problems under Debian.

You would be better off to use Synaptic than wajig. It is a gui front end for apt-get and works very well most of the time. It has enough sense to direct you to dpkg on occasion though.

These kind of tools that "automate" package systems are fine in their place. Remember that they are designed for stable systems. Using them in place of the core package tools in an unstable environment is asking for trouble.

Both apt-get and aptitude were developed to simplify package management so that you don't need to use dpkg all the time for simple things like update/upgrade cycles. Every time you add another layer on to a system you are geometricly increasing the possibility of error.

I am perfectly capable, indeed very good at, making my own mistakes. I have serious doubts about any tool that offers to make decissions for me based on what the tools developer figures is the condition of my system. Assumptions made by the tool may not be even close to reality. In that case each step it takes is complicating recovery.

When you throw something like that into an inherently unstable system it becomes nothing more than a bomb waiting to go off.

I think you could, given very little space on your box, that a Debian Testing system running with wajig, compared to an identical system not running wajig will have many more problems over the length of the testing cycle. A couple of very basic 10 to 15 gig installs run side by side with identical packages installed would show this very clearly I am sure.

Wajig sounds to me very like a command line immitation of Update Manager. Using that in a testing install is just about sure to break the install.

I have, by the way, a couple of installs of Linux Mint Debian Edition on here. I would not want to run it myself as my production OS. It has, however, over several cycles of its package management system proven to be very stable. It runs somewhat behind Debian testing giving a stable snapshot of Debian Testing in regular large "Update Packs". I installed it on my boss' personal laptop sometime last summer and she has, as someone with no knowlege of Linux, had no trouble with it.

It is proving to be a fairly up to date OS that is also stable.

rng 01-30-2013 07:11 PM

I am not clear on one point: does stable version get new versions of software such as iceweasel browser or libreoffice programs? If yes, then what really is the difference between testing and stable? Only time period of testing? So the latest software would only arrive a little later in stable than in testing?

Also, once wheezy becomes stable, can I change my sources.list to "stable"? Will that work as well? I am looking at putting an OS for years, provided it is updated regularly as well.

Randicus Draco Albus 01-30-2013 07:35 PM

Stable does not receive new software. Only security updates. The packages in Squeeze are now two years old. New packages are added to Testing, until it is frozen before being released as the next Stable. Whatever versions of applications that are currently in Wheezy will be there until Wheezy ceases to exit.

snowpine 01-30-2013 07:37 PM


Originally Posted by rng (Post 4880998)
I am not clear on one point: does stable version get new versions of software such as iceweasel browser or libreoffice programs?

No it does not. However, a "backports" repository exists to provide certain updated applications to Stable users:


Originally Posted by rng (Post 4880998)
Also, once wheezy becomes stable, can I change my sources.list to "stable"? Will that work as well? I am looking at putting an OS for years, provided it is updated regularly as well.

Sure, you could do that, in which case you will have Wheezy, then Jessie when it becomes Stable in a few years, and then whatever is the next Stable after that. The release upgrades would have to be done carefully (following the Release Notes) but you would theoretically have a very reliable system for many years to come (probably longer than the useful lifespan of your hardware due to Moore's Law).

rng 01-30-2013 08:15 PM

If applications are not being updated then stable version is not what I am trying to find.

Randicus Draco Albus 01-30-2013 08:32 PM

That is why stable systems are stable. The packages are added after the bugs have been worked out. Systems that add new packages before the bugs are worked out tend to be unstable. The newer the software, the greater the chances of instability. If you feel software that is a year or more old is too old, your search will lead you to a system with shiny new packages, bugs and all. You must decide which is more important to you: stability or freshness out of the bag.

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