1

I can get the list of packages using command:
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'

and now I would like to know whether the particular package is critical for the system or not. If the package is no longer required then I will delete them. I want free up root space.

2 Answers 2

3

Deleting packages is rarely an effective way to free up space in the root filesystem. Packages are small and numerous.

  • Look for large (runaway) logfiles in /var/log. Those can free up a lot of space quickly! Remember that a runaway log is merely a symptom of a problem that still needs to be investigated and fixed.

  • Look for large personal files in your /home. A movie or two takes up a lot of storage. Occasionally, folks who have a separate /home discover that it failed to mount and all their data is in the root filesystem instead.

  • Run baobab (also known as Disk Usage Analyzer) to search for large files on your root filesystem. It's included with every stock install of Ubuntu Desktop -- use your Desktop Search to find it. If you are on a Server instead of a desktop, here are some good techniques to find big files using du

Here's one easy, safe way to determine is a package is system-critical:

apt remove --simulate <package_name>

  • The --simulate option means that the removal WON'T actually take place. An additional protection is omitting sudo.

Read the output: If only the package is removed (and perhaps a few dependencies), then it is likely safe to remove.

However, if the list of proposed removals includes one of these red flags, then DON'T do it for real:

  1. The list is lengthy
  2. The list includes applications that you use
  3. The list includes one of the desktop meta-packages (ubuntu-desktop, kubuntu-desktop, etc.)
  4. The list includes the apt, dpkg, python3, or python3-minimal packages (removing those would destroy your package manager)
0

Try

sudo apt-get autoremove

This command removes packages that were installed by other packages and are no longer needed.

Also try

sudo apt-get autoclean

This command removes .deb files for packages that are no longer installed on your system. Depending on your installation habits, removing these files from /var/cache/apt/archives may regain a significant amount of diskspace.

To get information on a package use

apt-cache show <package_name>

This command shows the description of package <package_name> and other relevant information including version, size, dependencies and conflicts.

For further info read this HowTo on AptGet

If you want to use dpkg try

dpkg -I package.deb

for information of a specific package

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .