Just thought of sharing one of the TechNet discussion regarding the removal Orphan Packages from the child sites.
Packages that are deleted at a parent site can be orphaned at a child site if the child site is down at the time of deletion (temporarily), or the replication process is unsuccessful. You won’t be able to delete those packages from child site because they appear as “locked” in the console. In this case, we will need to manually fix the problem by modifying the package record from the child site database, so that we will be allowed to delete the package from the child site console.
Steps to Remove Orphan Packages
To remove orphan packages from the
SQL Server database, use the following steps:
1. Open SQL Server Management Studio, and use the site database of the child site cs1(SMS_cs1).
2. Type and run the following command in the query window:
select PkgId, Name, SourceSite from SMSPackages
3. Search for the PkgID file that you want to remove.
You should be able to find this
package in the result of this query. If the PkgID is not found, it shouldn’t
have been displayed in the cs1 console in the first place – close and re-open
the cs1 SCCM console if this is the case.
4. Type and run the following command in the query window:
Update SMSPackages Set SourceSite=’cs1′ Where PkgID= ”
5. The package is now set to a local package and you can delete it from within the SCCM Administrator console.
Please delete it from the cs1 console, and then the deletion will be gracefully
replicated to all sites below cs1 as if it were a packages created on child