Skip to content

Noob issue : "failed to retrieve some files" #50

Open
@dhruv8sh-kdk

Description

@dhruv8sh-kdk

So i keep hitting this error and I wonder if I'm doing something wrong.

fn main() {
    let root = "/home/user";
    let dbpath = "/home/user/.local/lib/pacman";
    let mut alpm = match alpm::Alpm::new(root, dbpath) {
        Ok(alpm) => alpm,
        Err(err) => {
            eprintln!("Failed to initialize ALPM: {}", err);
            return;
        }
    };
    let core = alpm
        .register_syncdb_mut("kde-unstable", SigLevel::USE_DEFAULT)
        .unwrap();

    core.add_server("http://mirror.4v1.in/archlinux/core/os/x86_x64").unwrap();
    // Added more servers here
    
    core.set_usage(Usage::SYNC | Usage::SEARCH).unwrap();
    match alpm.syncdbs_mut().update(true) {
        Ok(updated) => {
            if updated {
                println!("Database was updated." )
            } else {
                println!("Database is up to date.");
            }
        }
        Err(e) => {
            eprintln!("Failed to update database. {}", e);
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions