[SOLVED] Resetting config files from a package

Suppose I modify a file called /etc/examplefile.conf from a package example-package.
What is the easiest / most elegant way to reset this file? Reset = restore the file to its original, removing my modifications.
This[1] topic discusses this, but it is two years old. I would say the "best" solution there was the one suggested in #7:
you could move the config file first then reinstall.
But I'm not sure if this is safe. For a dummy example, removing /etc/pacman.conf then reinstalling pacman wouldn't probably be a good idea (I suspect this wouldn't work).
OBS.: Getting the original file from the package from the cache is an obvious solution, but I'm searching for a simpler (more direct) way to do this (a bash/zsh one-liner would be sufficient, for example).
[1]: https://bbs.archlinux.org/viewtopic.php?id=137526
Last edited by thiagowfx (2014-04-26 21:49:20)

FYI, pkg_scripts are available both in the AUR https://aur.archlinux.org/packages/pkg_scripts/ and in Xyne's repo: https://wiki.archlinux.org/index.php/Un … #xyne-i686 or https://wiki.archlinux.org/index.php/Un … #xyne-i686

Similar Messages

  • Reset config files for a package

    According to https://wiki.archlinux.org/index.php/Pa … save_Files I have this situation in my config files:
    original = X, current = Y, new = X
    Is there a way to set current config files of package to X and save Y as .pacsave OR install X as .pacnew and leave Y in place without removing package?
    Last edited by Evgeniuz (2012-03-12 22:00:00)

    I'm not positive I'm understanding you right, but if I am and you are talking about basically backing up a package's config file, it is pretty simple.  I believe the .pacnew and .pacsave refers to changes in the makeup of a package in general, not its config file. 
    To change back to the original config and save the modified version you can just add .backup or anything onto the end of the file that you don't want to use right now .  Then, you just need to save the file that you want to use as the config file with wthe filename of the configuration file for that package (so the same but w/o the .backup).
    Sorry if I am misunderstanding you and you really did mean .pacnew or .pacsave and not config files.  Or if I am totally wrong but that is my understanding of config files and I know it has worked for me in multiple instances.
    ~Boz~

  • [SOLVED] Find modified files from a package in local file system

    Is there a quick pacman command doing a diff between the local file system and a pacman package?
    Say I have installed a package foo and modified /etc/foo.conf. Now I want to find what's the difference between the file in my local file system and that in a clean package.
    If there's not a quick pacman command, what would you use in this case?
    Last edited by cyker (2014-10-10 05:18:46)

    amish wrote:
    Size difference does not always work!
    Lets say original conf file had two lines:
    Alert=true
    #Alert=false
    Now you changed it to:
    #Alert=true
    Alert=false
    So size will remain same!!
    So mod time is possibly better way to check!
    Right. Actually diff is the best way to check but doesn't seem to be there.

  • Creation of one single config file for 100 packages

    Hello Everyone,
    I need to create a single config file for multiple packages. Is it possible to do it?
    Could you please let me know how can it be achieved?
    Regards,
    Chinni

    Its possible
    Depending on whether all packages contain same configuration items and names you can use any of below approaches
    1. If all package configuration items and names are same, you can point all packages to same config file and it will use values from file for all of them
    2.If packages have different set of conigurations, then one method is to use parent package (wrapper package) to call and execute all of them. Then define all configurations as variable values in parent and add a config file in it. Pass only required configurations
    to each of child packages by using parent package configuration method.
    http://www.sqlis.com/sqlis/post/Using-Parent-Package-Variables-in-Package-Configurations.aspx
    The parent package has to call child packages using execute package task
    Then change any of values in your config file for parent package and change gets reflected to child package property values.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • "An error occurred while extracting files from the package "BaseSystem.pkg".

    Hello!
    I have a
    MacBookPro5,5
    Prozessortyp:Intel Core 2 Duo
    Prozessorgeschwindigkeit:2.26 GHz
    Anzahl der Prozessoren:1
    Gesamtzahl der Kerne:2
    L2-Cache:3 MB
    Speicher:2 GB
    Busgeschwindigkeit:1.07 GHz
    Boot-ROM-Version:MBP55.00AC.B03
    SMC-Version (System):1.47f2
    Hardware-UUID:A2DD27C4-9829-5A4D-854B-485EF8A6B20F
    Problem:
    I upgraded Leopard to Snow Leopard. Everything worked fine for a month. To free up disk space I deleted some of the iPhoto flders (modfied and original images). Everything worked still fine. Shut down the computer. Next day it was incredibly slow. At the same time the indexing was running. I stopped indexing, but stll slow. Every operation took minutes. I tried all the tricks that I found in the internet (repaired file permissions, repaired disk, cleared PRAM , moved big filed from desktop, etc.). After 24 full hours of trying all this I decided to erase the hard drive and reinstall, directly from the Snow Leopard Install disk, but it fails after downloading the packages. Below is the part of the log. Then I tried to use the old Leopard install DVD to reinstall Leopard, it then sais estimated time 12 hours or so and eventually crashed, spitting out a lot of "reportcrash" in the log. What is going on? I'm running out of options. Any advice? Would zeroing the hard drive help? If nothing else I plan to buy a new hard drive, since the only explanation I have is that there is a problem with the hard driven although the disk utility says it is OK. I need a bigger one anyway. Any ideas? Thank you!
    Aug 16 05:17:31 localhost OSInstaller[139]: IFPKInstallElement (191 packages)
    Aug 16 05:17:35 localhost OSInstaller[139]: PackageKit: ----- Begin install -----
    Aug 16 05:17:35 localhost OSInstaller[139]: PackageKit: request=PKInstallRequest <191 packages, destination=/Volumes/Macintosh HD>
    Aug 16 05:17:36 localhost OSInstaller[139]: PackageKit: Extracting /Volumes/Macintosh HD/Mac OS X Install Data/BaseSystem.pkg (destination=/Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root, uid=0)
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/DataPool.c:116 : Error: finished pool without filling it
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/commonUtils.c: 315: Error: fh_pread -1
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:236: Error: write failed for /Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root//System/Library/Frameworks/OpenCL.framework/Versi ons/A/Resources/runtime.amdil.bc: Invalid argument
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:260: Error: futimes failed for /Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root//System/Library/Frameworks/OpenCL.framework/Versi ons/A/Resources/runtime.amdil.bc: Invalid argument
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:829: Error: returning errno 22 from FinishStreamCompressorQueue
    Aug 16 05:32:10 localhost OSInstaller[139]: PackageKit: Install Failed: PKG: extracting "com.apple.pkg.BaseSystem"\nError Domain=PKInstallErrorDomain Code=110 UserInfo=0x12c8366a0 "An error occurred while extracting files from the package “BaseSystem.pkg”." Underlying Error=(Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 "The operation couldn’t be completed. FinishStreamCompressorQueue error") {\n    NSFilePath = "/Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root";\n    NSLocalizedDescription = "An error occurred while extracting files from the package \U201cBaseSystem.pkg\U201d.";\n    NSURL = "BaseSystem.pkg -- file://localhost/Volumes/Macintosh%20HD/Mac%20OS%20X%20Install%20Data/index.pro duct";\n    NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 \"The operation couldn\U2019t be completed. FinishStreamCompressorQueue error\"";\n    PKInstallPackageIdentifier = "com.apple.pkg.BaseSystem";\n}
    Aug 16 05:32:10 localhost OSInstaller[139]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=110 UserInfo=0x12c8366a0 "An error occurred while extracting files from the package “BaseSystem.pkg”." Underlying Error=(Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 "The operation couldn’t be completed. FinishStreamCompressorQueue error")
    Aug 16 05:32:11 localhost OSInstaller[139]: Install failed: Die Installation ist aufgrund eines Fehlers fehlgeschlagen. Wenden Sie sich an den Hersteller der Software.
    Aug 16 05:32:13 localhost OSInstaller[139]: Allowing machine sleep.
    Aug 16 05:32:15 localhost OSInstaller[139]: Memory statistics for 'Installation ist fehlgeschlagen' pane:
    Aug 16 05:32:15 localhost OSInstaller[139]: Physical Memory Allocation:   139 MB wired,   259 MB trapped,   397 MB active,     7 MB inactive,  1246 MB free,  1650 MB usable,  2048 MB total

    It sounds to me like your Internal Hard Drive is failing.
    I recommend you buy a new one, that is a good candidate for replacing the old one, but install it in an External enclosure and Install a fresh Mac OS X on it from the DVD. You can boot your Mac from any attached drive.
    The new System can be used to get some work done, check your emails, and takes the pressure off resolving this immediately. You can also attempt to salvage files off the old drive if needed.
    Once things seem to be working, then move the new drive inside the computer. Failures at this point may be due to bad cable, which has been a problem in some of these MacBooks.
    Use security erase, write Zeroes, one pass, to re-write every block on the old drive. Any block discovered to be bad will be replaced with spares the drive holds in reserve for this purpose. If more than 10 blocks are pared on one pass, "Initialization Failed!" will be the result. Although you can try the erase again, there is some question whether you want to trust this drive with your precious data.

  • Reading an XML file from a package .....

    I m trying to read an xml file from a package. The XML file is located on desktop (not on unix system). if i mention the path of the file in a package, is it sufficient ???. OR do i need to CREATE DIRECTORY in oracle and mention the file path in this directory ???
    I have granted CREATE directory permissions...
    If not any suggestion or advice is great ???
    Thank you!!

    BANNER
    1     Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    2     PL/SQL Release 11.1.0.6.0 - Production
    3     CORE     11.1.0.6.0     Production
    4     TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    5     NLSRTL Version 11.1.0.6.0 - Production
    Thank you !!!

  • Hi this message appears after 2 hours downloading Mavericks : an error occurred while extracting files from the package "mzps4135638417199433253.pkg"

    Hi this message appears after 2 hours downloading Mavericks in App Store :
    an error occurred while extracting files from the package "mzps4135638417199433253.pkg"
    Same with "CMD + R"
    Help...

    It sounds to me like your Internal Hard Drive is failing.
    I recommend you buy a new one, that is a good candidate for replacing the old one, but install it in an External enclosure and Install a fresh Mac OS X on it from the DVD. You can boot your Mac from any attached drive.
    The new System can be used to get some work done, check your emails, and takes the pressure off resolving this immediately. You can also attempt to salvage files off the old drive if needed.
    Once things seem to be working, then move the new drive inside the computer. Failures at this point may be due to bad cable, which has been a problem in some of these MacBooks.
    Use security erase, write Zeroes, one pass, to re-write every block on the old drive. Any block discovered to be bad will be replaced with spares the drive holds in reserve for this purpose. If more than 10 blocks are pared on one pass, "Initialization Failed!" will be the result. Although you can try the erase again, there is some question whether you want to trust this drive with your precious data.

  • Move config file from c160 to c170

    I am doing an RMA to our unit
    the old unit is c160
    the new is c170           
    The old appliance was OS 7.6.1-022
    The new appliance is OS 7.5.2-101
    I want to move the config file from the old one to the new one,
    however I am getting "Error   —       No available upgrades  " on the new appliance,
    Any advice?

    Call TAC and get your new device provisioned for 7.6.1...

  • [SOLVED] Pacman "config file could not be read" error during Arch ins

    I've been attempting to get Arch setup for a while now, and after having some trouble with partitions, my wireless connecting, and setting up repos and mirrors, which the Wiki helped me solve, I've hit a bigger bump.  While updating the system using pacman as the Beginners Guide says to do, I get errors when I try to continue the update process as follows :
    btw: I'm typing this on a laptop next to my computer
    [root@McArch~]# pacman -Syu
    error: config file /etc/pacman.d/core could not be read
    error: config file /etc/pacman.d/extra could not be read
    error: config file /etc/pacman.d/community could not be read
    :: Synchronizing package databases . . .
    error: failed to updated core (unexpected error)
    error: failed to updated extra (unexpected error)
    error: failed to updated community (unexpected error)
    error: failed to synchronize any databases
    Any tips as to whats going on?  I've tried to created said files, and even insert mirrors into the file, like in the /etc/pacman.d/mirrorlist file but this doesn't seem to help
    Last edited by Windfinder (2008-09-29 20:43:29)

    Glad you got it working.
    I'm not sure what happened in your install but I just finished using an old 2007.08 iso and pacman first starts out with /etc/pacman.d/core, etc/pacman.d/extra, /etc/pacman.d/community ... etc., but I never had your problem when I did the #pacman -Syu after initial install reboot.  The pacman update removes the above mentioned repos and replaces them with a single /etc/pacman.d/mirrorlist.  You must have messed up an initial config file somehow as I couldn't get the same errors you got.  It looks like you had your /etc/pacman.conf file messed up somehow and when you pointed it to the mirrorlist it could finally work properly.  I'll just include my /etc/pacman.conf file and /etc/pacman.d/mirrorlist so you can compare.  NB*  these are from my x86_64 so for 32 bit machines i686 would replace x86_64 in the files.
    # /etc/pacman.conf
    # See the pacman.conf(5) manpage for option and repository directives
    # GENERAL OPTIONS
    [options]
    # The following paths are commented out with their default values listed.
    # If you wish to use different paths, uncomment and update the paths.
    #RootDir = /
    #DBPath = /var/lib/pacman/
    #CacheDir = /var/cache/pacman/pkg/
    #LogFile = /var/log/pacman.log
    HoldPkg = pacman glibc
    # If upgrades are available for these packages they will be asked for first
    SyncFirst = pacman
    #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    #XferCommand = /usr/bin/curl %u > %o
    # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
    #IgnorePkg =
    #IgnoreGroup =
    #NoUpgrade =
    #NoExtract =
    # Misc options (all disabled by default)
    #NoPassiveFtp
    #UseSyslog
    #ShowSize
    #UseDelta
    #TotalDownload
    # REPOSITORIES
    # - can be defined here or included from another file
    # - pacman will search repositories in the order defined here
    # - local/custom mirrors can be added here or in separate files
    # - repositories listed first will take precedence when packages
    # have identical names, regardless of version number
    # - URLs will have $repo replaced by the name of the current repo
    # Repository entries are of the format:
    # [repo-name]
    # Server = ServerName
    # Include = IncludePath
    # The header [repo-name] is crucial - it must be present and
    # uncommented to enable the repo.
    # Testing is disabled by default. To enable, uncomment the following
    # two lines. You can add preferred servers immediately after the header,
    # and they will be used before the default mirrors.
    #[testing]
    #Include = /etc/pacman.d/mirrorlist
    [core]
    # Add your preferred servers here, they will be used first
    Include = /etc/pacman.d/mirrorlist
    [extra]
    # Add your preferred servers here, they will be used first
    Include = /etc/pacman.d/mirrorlist
    [community]
    # Add your preferred servers here, they will be used first
    Include = /etc/pacman.d/mirrorlist
    # An example of a custom package repository. See the pacman manpage for
    # tips on creating your own repositories.
    #[custom]
    #Server = file:///home/custompkgs
    /etc/pacman.d/mirrorlist
    # Arch Linux repository mirrorlist
    # North America
    # - United States
    Server = http://mirror.neotuli.net/arch/$repo/os/x86_64
    Server = http://holmes.umflint.edu/archlinux/$repo/os/x86_64
    Server = http://archlinux.unixheads.org/$repo/os/x86_64
    Server = ftp://ftp.archlinux.org/$repo/os/x86_64
    Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/x86_64
    Server = ftp://ftp.gtlib.gatech.edu/pub/linux/distributions/archlinux/$repo/os/x86_64
    Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/$repo/os/x86_64
    Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/x86_64
    Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/$repo/os/x86_64
    Server = http://mirror.rit.edu/archlinux/$repo/os/x86_64
    Server = http://mirror.umoss.org/archlinux/$repo/os/x86_64
    # - Canada
    Server = ftp://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/@carch
    Well it was an interesting way to kill 30+ minutes.

  • Reading a config file from servlet

    I am having an issue where my servlet on init() is trying to read a file from the filesystem in order to override the log4j configuration for the application.
    Code in servlet:
    ServletContext context = getServletContext();
    String logInitFile =
    context.getInitParameter("log-init-file");
    if (logInitFile != null) {
    File file = new File(context.getRealPath(logInitFile));
    if (file.exists()) {
    logInitFile = context.getRealPath(logInitFile);
    LogManager.getLogManager().readConfiguration(logInitFile);
    ServletLogAppender.setServletContext(context);
    logger = LogManager.getLogManager().getLogger(CLASS_NAME);
    logger.debug("Log file was loaded from \"" + logInitFile + "\"");
    END CODE
    My orion-web.xml has an entry pointing to
    <context-param-mapping name="log-init-file">C:\jDev9052\j2ee\home\application-deployments\speed\log4j.xml</context-param-mapping>
    The error I am getting is a NullPointerException on the
    File file = new File(context.getRealPath(logInitFile));
    line.
    The point of this is to override the log4j.xml file that is packaged in the /classes folder of the .ear file with one specific to its deployment target (i.e. production, test, etc).
    This worked in 9.0.2 but now that I am upgrading to 9.0.5.2 it is not working.
    Is this possible to do anymore? Could someone assist.

    I just had -and solved- the same problem. The cause was that you tried to use getServletContext().getRealPath() to resolve the file name. That only works if the file is located some place where your Web container could serve it up as a file; i.e. getRealPath() translates a path from a Web URL into a file path.
    If you have your file in the Jar, chances are it's not even accessible as a file. I used getClass().getClassLoader().getResource() to give me a URL, and used that as an argument to log4j methods.

  • Transfer old config files from old C150 to New C170

    I exported the complete configuration from the old C150  and emailed it to myself without masked passwords.  I copied the file to my machine and logged into the new C170. System Administration --> Configuration File
    Selected Load Configuration file from local computer.  I browsed to the file and seleted it and hit "load"
    It failed on so many lines that just seemed incompatible with the new XML structure I just gave up.  I ended up doing it manually but would like to know if it is possible to accomplish the original task of importing that old config file?

    The dievices have different port settings and there are some large differences in the code.  You cannot transfer the entire config file but you can do it in sections.  Such as export your HAT config and import that to the C170. 
    How I did it was hook a laptop directly to the new C170 on the management port and opened a wireless connection via browser to the live C150 and manually set all of my network configurations individually.

  • Config file from tftp at startup (6509 with Sup720)

    Hi together
    I will download the config file for my 6509 with Sup720 from a TFTP Server.
    I have configerd the GigabitEthernet 5/2, so I can ping the tftp-server. Also I'm able to down&upload files to the tftp-server.
    The configuration looks like:
    hostname Testrouter
    boot host tftp run 192.168.88.250
    boot network tftp run 192.168.88.250
    interface GigabitEthernet5/2
    switchport
    no ip address
    media-type rj45
    interface Vlan1
    ip address 192.168.88.9 255.255.255.0
    The service config command is also set!
    The big problem is, the router comes up normaly and do not access the tftp-server in any way :-(
    Have anyone a idea?
    Thanks a lot in advance
    Cheers Ralph

    I have done it now in this way, but without any improvement! :-(
    Here is my config:
    (I found the ip tftp ? command!)
    hostname Router
    boot host tftp://192.168.88.250/run
    boot network tftp://192.168.88.250/run
    no aaa new-model
    ip subnet-zero
    ip tftp source-interface GigabitEthernet5/2
    ip tftp boot-interface GigabitEthernet5/2
    interface GigabitEthernet5/2
    ip address 192.168.88.9 255.255.255.0
    media-type rj45
    ip default-gateway 192.168.88.250
    I'm able to ping the TFTP Server...
    Router#ping 192.168.88.250
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.88.250, timeout is 2 seconds:
    Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
    Router#
    Have anyone any idea??
    Cheers Ralph

  • How to generate a file from a package

    Hello Guru's,
    I oracle knowledge is very limited. I am given a task.
    A package already written is given to me. I need to generate a file of few given columns and from this package.
    How can I generate the file. Please, help.
    Thanks in advance,

    use UTL_FILE
    (do a search, or read the pl/sql supplied packages manual)

  • Migrate Config File From C350 to C370

    Hi,
    We are currently upgrading our C350 appliance to C370s. What I'd like to find out is can we export the configurations file from the C350 (with all the settings intact) and restore it on the C370 appliance.
    I am assuming the IP/Host name will have to remain the same and that we will need to ensure the Async OS version is the same on both devices.
    Is this possible? Anyone have any experience doing this?
    Thanks,
    Steve

    I've done it, but its been a while.
    They don't have to be the same IP/name (you can edit the XML file), but you do want them on the same version.
    Export from the old one, and get the XML file locally (download it via FTP, or email it to yourself, with passwords unmasked)
    Look at the XML file and edit out the Network section (I use Notepad++ as it can do syntax highlighting)
    FTP the XML file to the new box, then load it. (The last time I did it, it didn't want to upload from my desktop...
    Hope that helps.

  • How to load a xml file from a package inside of a jar file

    hi@all
    my application has got a xml configuration file which is saved inside the package tree of the class that reads this file.
    when i`m developing using eclipse the class can find that file, everything works fine. but when i create a jar file of my application to use it in another application it cannot find that file anymore.
    can anyone tell me how to solve this problem, please?
    thx a lot
    dialsc

    hi all,
    the xml file is in the jar file and
    ClassLoader.getSystemResourceAsStream(..) solved my problem.
    in fact i did nameOfClassInSamePackageAsXmlFile.class.getResourceAsStream("nameOfFile.xml");thank you all
    greez
    dialsc

Maybe you are looking for

  • How do you improve quality of QuickTime movie exported from Flash?

    Hi I have designed a Flash animation for a client who has asked me to also provide it in a format which can be used in a film he wants to produce in Apple Final Cut Pro.  I assumed the best format would be QuickTime but whenever I export the Flash fi

  • HP LaserJet Pro 100 - scans only from tray, won't scan from adf

    Hi I am having issues with my HP LaserJet Pro 100. I load the adf and upen the scan dialog however when I click scan, it will scan from the tray every time. I have cleaned the rollers and checked the paper. I have ran scan doctor and it doesn't notic

  • Any way of getting your current location in Numbers for iOS

    I was looking for a way to get geographic location information from the iPad Core Location API from within Numbers and based on the iPad's location, a cell's value would change based on the location. Does anyone know if Numbers supports location info

  • Updating large table using the WITH CLAUSE or PLSQL

    I tried to perform an update on a table with over 15million records using the merge statement below but it's very slow. Can someone help me re-writting this statement using the WITH CLAUSE or a PLSQL statement that will make it run faster? my merge s

  • Transfer Adobe files

    Hello I have created a website using Adobe Dreamweaver.  I downloaded a trial version of Adobe CC.  Is there a way I can transfer my files from DW over? Thanks Nick