Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

FreeBSD user joining your ranks. I've been asked to look after an Ubuntu Server running 10.04 LTS.

I see from /usr/lib/update-notifier/update-motd-updates-available that there are a number of updates on the server however I do not see a way to tell which will be updated.

Would anyone be able to point me in the right direction so as I can see which packages will get updated when I run apt-get upgrade

UPDATE: Cant answer my own question at the moment so throwing this in here for the time being:

Along with the apt-get upgrade --dry-run suggested below, /usr/lib/update-notifier/apt-check -p will list all packages that have updates available.

share|improve this question
    
Welcome to the ranks, use and abuse the site if you need further help ;) If you find an answer that satisfies your question please mark it with the green check box next to it. –  Bruno Pereira Jan 30 '12 at 10:45
1  
You should now be able to answer your own question since that you have enough rep to remove new user restrictions. –  jokerdino Jan 30 '12 at 10:51
    
looks like it's 100rep required or an 8hour wait to answer your own question. –  Jan Geep Jan 30 '12 at 14:29

2 Answers 2

up vote 19 down vote accepted

You could install aptitude if it isn't already installed. It's a great tool for managing packages in a headless setup.

enter image description here

Otherwise if you just want to see what's going to happen when you run something, use the --dry-run argument and it won't actually do anything, it'll just tell you what it would do:

From the apt-get man page

-s, --simulate, --just-print, --dry-run, --recon, --no-act
          No action; perform a simulation of events that would occur but do
          not actually change the system. Configuration Item:
          APT::Get::Simulate.

          Simulate prints out a series of lines each one representing a dpkg
          operation, Configure (Conf), Remove (Remv), Unpack (Inst). Square
          brackets indicate broken packages with and empty set of square
          brackets meaning breaks that are of no consequence (rare).

Add the option to the command this way

sudo apt-get upgrade --dry-run
share|improve this answer
3  
I disfigured your answer, hope you don't mind. –  Bruno Pereira Jan 30 '12 at 10:44

Below command will show you the list of installed packages which has an update available in the repositories.

dpkg --get-selections | xargs apt-cache policy {} | grep -1 Installed | sed -r 's/(:|Installed: |Candidate: )//' | uniq -u | tac | sed '/--/I,+1 d' | tac | sed '$d' | sed -n 1~2p
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.