element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Freeing storage space on Pi
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 11 May 2015 8:29 AM Date Created
  • Views 222 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended
  • df
  • disk-free
  • freeing_space
  • remove_packages
  • storage
  • raspberry-pi
  • autoclean
  • apt-get
  • autoremove

Freeing storage space on Pi

balearicdynamics
balearicdynamics
11 May 2015

I suppose that it is not rare that tying for a solution the approach will be installing packages on the Raspberry PI environment, check how the stuff works then abandoning the solution to move to a different approach. This usually means sudo apt-get install a certain number of packages and the related dependencies occupying storage space.

 

Deciding that a certain approach is not what we want we can remove the packages in the same way se installed them:


$> sudo apt-get remove <package name>

 

 

Then in few times it may occur that we go low of storage space, especially when using only a 4 or 8 Gb microSD storage. As a matter of fact all the downloaded packages are cached by the linux operating system and these are not physically removed from the system when we simply remove the package. So, when we are sure that a set of packages are not needed it is a best practice to use a couple of apt-get features to really clean the system:

 

$>sudo apt-get autoremove

 

All cached packages and their dependencies are removed from the system definitely freeing lot of space. This command does not affect the components that are instead in use. As there are also cases where some other stuff (this maybe also consistent) downloaded by the update / upgrade keep files no more needed to the system. In many cases during an upgrade there are packages and components replaced by the newer one downloaded while the old are retained. Maybe that the system needs a rollout to the previous version, the user needs to save them for some reason and so on.

 

To definitely clean the system you can also launch the cleaning command

 

$>sudo apt-get autoclean

 

to remove all the unused packages from the system. You can check the available storage space in all the linux partitions with the command df (disk-free) generating a result similar to the example below.

 

pi@RPImaster ~ $ df

Filesystem     1K-blocks    Used Available Use% Mounted on

rootfs         919001196 4502680 867792852   1% /

/dev/root      919001196 4502680 867792852   1% /

devtmpfs          437856       0    437856   0% /dev

tmpfs              88432     292     88140   1% /run

tmpfs               5120       0      5120   0% /run/lock

tmpfs             176860       0    176860   0% /run/shm

/dev/mmcblk0p5     60479   14537     45943  25% /boot

/dev/mmcblk0p3     27633     442     24898   2% /media/SETTINGS_

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube