The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I clean unused packages?

Discussion in 'General Discussion' started by Kent Brockman, Jul 12, 2013.

  1. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi! Today I have a maintanance question.

    Let's see: I run several VPS servers which over time have been used by different resellers. Some of them have evolved and moved to higher plans, others have quit. Others just have a mess because they are designers or non-tech people not willing to learn how to properly setup packages and features. I'm aware that every server have almost 300 different packages configured. For some of them one can easily detect if they are actually being used. But I need a way to detect WHICH PACKAGES AND FEATURES AREN'T BEING ACTUALLY USED, in order to be able to delete it without causing any harm.

    Is there any command I can run in the console? some grep maybe to compare the existing packages with the actually assigned ones?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    You can find out all used package list through following command

     
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Great. The next step is to know what are the unused ones. Thanks!


    I see. But I'm having the same issue as user furquan. I can run the command but the unused packages aren't being deleted. Should I open a ticket? or is there any workaround? because the post you are linking at was last answered on Apr 2011...

    Thanks!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You will need to manually delete the packages that you no longer use. Packages are stored in:

    Code:
    /var/cpanel/packages/
    You may want to copy the packages that you do use (including the default package) to a temporary directory. Then, delete all of the packages in /var/cpanel/packages/ and copy back over the ones you use.

    Thank you.
     
  5. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    ok Michael. Soooo, the command you refered in the other thread no longer work? and there are no plans to get it fixed?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I was more so referencing other user-based solutions in the other thread regarding removing packages. You may want to review them before running any custom commands or scripts as some of them appear to remove all packages. The autorepair script you mentioned still functions normally:

    Code:
    /scripts/autorepair cleanup_dead_package_limits
    It's not designed to delete packages, but rather to clean up the /var/cpanel/package-limits.yaml file.

    Thank you.
     
  7. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    oops ok, I missed that. What is the /var/cpanel/package-limits.yaml file for?

    - - - Updated - - -

    I see the script by user vivek in that post, and I believe it will delete non-reseller packages. If I would test it, I'd rather modify it to run in a separate-test-folder, and erasing the line which actually delete the files at the end, to prevent causing any harm.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's used to store reseller package limits.

    Thank you.
     
Loading...

Share This Page