0

I have a centos 7 VM in VirtualBox that I'm using for development on an OSS project. I'm not worried about updates to the VM, but the VM has downloaded pending (important) updates and has now grown to fill the entirety of my host partition's free space ... enough that I cannot manage snapshots and the host OS is complaining at me.

How can I delete these update files from the CentOS VM, and how can I set them to not download again automatically?

(I estimate the VM should be around 20GB ... it's now over 50GB.)


I tried the following commands, based on an answer, and got the output below. I still haven't freed up the space on my host OS...

[user@centos7host ~]$ yum clean packages
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras github_git-lfs github_git-lfs-source ius
              : updates
0 package files removed
[user@centos7host ~]$ yum clean metadata
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras github_git-lfs github_git-lfs-source ius
              : updates
19 metadata files removed
0 sqlite files removed
0 metadata files removed
[user@centos7host ~]$ yum clean headers
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras github_git-lfs github_git-lfs-source ius
              : updates
0 header files removed
[user@centos7host ~]$ yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras github_git-lfs github_git-lfs-source ius
              : updates
Cleaning up everything
Maybe you want: rm -rf /var/tmp/yum-user-vce72D, to also free up space taken by orphaned data from disabled or removed repos
[user@centos7host ~]$ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   43G   15G   29G  34% /
devtmpfs                 2.2G     0  2.2G   0% /dev
tmpfs                    2.3G     0  2.3G   0% /dev/shm
tmpfs                    2.3G  9.4M  2.3G   1% /run
tmpfs                    2.3G     0  2.3G   0% /sys/fs/cgroup
tmpfs                    2.3G   24K  2.3G   1% /tmp
/dev/sda1               1014M  282M  733M  28% /boot
tmpfs                    454M   28K  454M   1% /run/user/1000
[user@centos7host ~]$ rm -rf /var/tmp/yum-user-vce72D/
[user@centos7host ~]$ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   43G   15G   29G  34% /
devtmpfs                 2.2G     0  2.2G   0% /dev
tmpfs                    2.3G     0  2.3G   0% /dev/shm
tmpfs                    2.3G  9.4M  2.3G   1% /run
tmpfs                    2.3G     0  2.3G   0% /sys/fs/cgroup
tmpfs                    2.3G   24K  2.3G   1% /tmp
/dev/sda1               1014M  282M  733M  28% /boot
tmpfs                    454M   32K  454M   1% /run/user/1000
[user@centos7host ~]$ 
  • Could you just, not allow it internet access I mean if you're not interested in it getting updates? – Michael Prokopec Dec 6 '18 at 4:51
  • @MichaelProkopec No, I need to access github. – user3.1415927 Dec 6 '18 at 14:28
0

The following commands can be used:

  • To clean the package list:

    yum clean packages
    
  • To delete metadata for each enabled repository, use the following command:

    yum clean metadata
    
  • To delete package headers, use the following command:

    yum clean headers
    
  • To clean all cached information, use the following command:

    yum clean all
    

More info found: Here

I would disable the update daemon: PackageKit

  • To disable auto update to happen via PackageKit, we need to stop the “packagekit” service and disable it permanently.

    systemctl stop packagekit
    systemctl mask packagekit
    
    Create symlink from /etc/systemd/system/packagekit.service to /dev/null.
    

More information on how to do that is: Here

  • 2
    You are only providing links which could disappear or be moved. It would be better imho if short relevant useful portions were also quoted in the answer. – A.B Dec 6 '18 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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